POST
/
images
/
generations
curl --request POST \
  --url https://geekai.dev/api/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "dall-e-3",
  "prompt": "draw a cute cat",
  "size": "1024x1024",
  "n": 1,
  "quality": "hd",
  "retries": 0
}'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Note: For setting the image generation model name, refer to the System Supported Image Generation Models List, ```markdown currently supported image generation models are dall-e-3, cogview-3-flash (free), cogview-3-plus, and cogview-4. The request/response parameter structure is fully compatible with OpenAI. When switching models, you only need to modify the corresponding model name. If the model request/response parameters are inconsistent with OpenAI, GeekAI will automatically convert and align them at the underlying level. The response data format is fully compatible with OpenAI.

Different AI platforms support different image sizes for their image generation models. Please refer to the table below for the specific supported sizes:

PlatformModelSupported Sizes
OpenAIDALL·E 3

1024x1024, 1792x1024, 1024x1792 (default is 1024x1024)

ZhipuCogView Series

1024x1024, 768x1344, 864x1152, 1344x768, 1152x864, 1440x720, 720x1440 (default is 1024x1024)

cURL Request Example

curl --location 'https://geekai.dev/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: {YOUR_GEEKAI_API_KEY}' \
--data '{
    "model":"dall-e-3",
    "prompt":"Draw a cute kitten playing in the grass",
    "size": "1024x1024",
    "n":1
}'

Authorizations

Authorization
string
header
required

token

Body

application/json

Response

200
application/json

successful response

The response is of type object.