Skip to main content
POST
/
v1
/
images
/
generations
curl --request POST \
  --url https://api.apimart.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "imagen-4.0-apimart",
    "prompt": "A corgi wearing an astronaut helmet, standing on the lunar surface, Earth in the background, cinematic lighting, 8k",
    "size": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "imagen-4.0-apimart",
    "prompt": "A corgi wearing an astronaut helmet, standing on the lunar surface, Earth in the background, cinematic lighting, 8k",
    "size": "16:9"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX"
    }
  ]
}

Authorizations

Authorization
string
required
All APIs require Bearer Token authenticationGet API Key:Visit the API Key Management Page to obtain your API KeyAdd the following to your request header:
Authorization: Bearer YOUR_API_KEY

Body

model
string
default:"imagen-4.0-apimart"
required
Image generation model nameFixed value: imagen-4.0-apimart
prompt
string
required
Text description for image generationBoth English and Chinese descriptions are supported
n
integer
default:"1"
Number of images to generateValue range: 1
size
string
default:"16:9"
Image generation ratioSupported formats:
  • 16:9 - Landscape (default)
  • 9:16 - Portrait

Response

code
integer
Response status code
data
array
Response data array