Skip to main content
POST
/
images
/
generations
Image Generation API
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 31024x1024, 1792x1024, 1024x1792 (default is 1024x1024)
ZhipuCogView Series1024x1024, 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
model
string
required

image model

Example:

"dall-e-3"

prompt
string
required

text prompt

Example:

"draw a cute cat"

size
string

image size

Example:

"1024x1024"

n
integer

number of images

Example:

1

quality
string

image quality

Example:

"hd"

retries
integer
default:0

auto retry times, default 0, means no retry

Example:

0

Response

successful response

created
integer
required

creation timestamp

data
object[]
required

image data list

I