Get Started

Quick Start

The PICPIK API adopts an instruction-based style, where each API request contains an instruction (Action), instruction parameters, and authentication information (PublicKey, Signature). All interfaces default to the POST method and use the application/json request content format.

Please view the Pricing page for charging details.

💰

We offer 300 free credits per user for testing.

Common Request Parameters

Common request parameters are required for all API calls and are usually displayed at the top of the request parameters list in the API reference.

Parameter NameTypeDescriptionRequired
ActionStringThe corresponding API instruction name✓
PublicKeyStringUser's public key, which can be obtained from the PICPIK User Center (opens in a new tab)✓
SignatureStringUser's signature generated based on the public key and API instruction, see Signature for details✓
request_uuidStringRequest UUID, randomly generated by using the UUID generation method. This parameter can be utilized to manage the requests of your business and clients.

Common Response Fields

Common responses are fields to be returned by all APIs and are usually displayed at the top of the response fields list in the API reference.

Field NameTypeDescriptionRequired
RetCodeIntReturn status code: 0 indicates a successful return, while non-zero indicates a failure✓
ActionStringInstruction name✓
MessageStringThe error message is returned when RetCode is non-zero, providing a detailed description
request_uuidStringReturns the UUID that was included in the request

Quick Start

1. Obtain the keys

Obtain the API keys from the PICPIK User Center (opens in a new tab), including PublicKey and PrivateKey.

2. Data preparation

In this example, assume that:

PublicKey  = "abcdefg"
PrivateKey = "123456"

Assume the user's request parameters are as follows:

{
    "Action":    "ListModels",
    "PublicKey":    "abcdefg"
}

3. Calculate the Signature

Refer to the Signature Algorithm documentation to calculate the signature, in this case, which is:

4a20bc1141494035f6aaaad13224c94c5a8bc3a5

4. Determine the request address

The addresses of different sites' requests are not the same. All request examples in the API docs are for the global site:

SiteRequest Address
Globalhttps://api.picpik.ai
Chinese Mainlandhttps://api.picpikai.com

5. Construct the request

Finally, the constructed request is:

curl -X POST \
  https://api.picpik.ai \
  -H 'Content-Type: application/json' \
  -d '{
      "Action"     :  "ListModels",
      "PublicKey"  :  "abcdefg",
      "Signature"  :  "4a20bc1141494035f6aaaad13224c94c5a8bc3a5"
  }'