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": "gemini-3-pro-image-preview",
    "prompt": "A bamboo forest path under moonlight",
    "size": "1:1",
    "n": 1
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini-3-pro-image-preview",
    "prompt": "A bamboo forest path under moonlight",
    "size": "1:1",
    "n": 1
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}

Authorizations

Authorization
string
required
All APIs require authentication using Bearer TokenGet API Key:Visit API Key Management Page to obtain your API KeyAdd to request header:
Authorization: Bearer YOUR_API_KEY

Body

model
string
default:"gemini-3-pro-image-preview"
required
Image generation model nameExample: "gemini-3-pro-image-preview"
prompt
string
required
Text description for image generation
size
string
Image generation sizeSupported formats:
  • Ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
n
integer
Number of images to generateFixed at 1⚠️ Note: Must be a pure number (e.g. 1), do not add quotes, otherwise it will error
image_urls
array
List of reference image URLs for image-to-image or image editing💡 Quick Fill (Try it area):
  1. Click ”+ Add an item” to add an image URL
  2. Enter the complete image URL address or base64 data
Limit: Maximum 5 images
mask_url
string
Mask image URL
  • Must be PNG format
  • Size must match reference image
  • Must not exceed 4MB

Response

code
integer
Response status code
data
array
Response data array