Skip to main content
POST
/
api
/
ai
/
image
/
generation
curl --request POST \
  --url https://api.yourapp.com/api/ai/image/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "prompt": "A futuristic city at sunset with flying cars",
    "model": "dall-e-3",
    "n": 1,
    "stream": false
  }'
{
  "created": 1677652288,
  "data": [
    {
      "url": "https://cdn.example.com/images/generated/abc123.png",
      "b64_json": null
    }
  ]
}

Request Body

prompt
string
required
Text prompt describing the image to generate
model
string
default:"google/gemini-2.5-flash-image"
Image model identifier
provider
string
Provider name (e.g., OpenAI, Google)
n
number
default:"1"
Number of images to generate
stream
boolean
default:"false"
Enable streaming response

Response

data
array
Array of generated images
created
number
Unix timestamp of creation
curl --request POST \
  --url https://api.yourapp.com/api/ai/image/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "prompt": "A futuristic city at sunset with flying cars",
    "model": "dall-e-3",
    "n": 1,
    "stream": false
  }'
{
  "created": 1677652288,
  "data": [
    {
      "url": "https://cdn.example.com/images/generated/abc123.png",
      "b64_json": null
    }
  ]
}