Skip to main content
POST
/
v1
/
images
/
generations
curl --request POST \
  --url https://toapis.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-imagine-1.0",
    "prompt": "An orange cat sitting on a sunny windowsill, oil painting style",
    "size": "1:1",
    "n": 1
  }'
{
  "id": "task_01JNXXXXXXXXXXXXXXXXXX",
  "object": "generation.task",
  "model": "grok-imagine-1.0",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {}
}
  • Unified image generation endpoint
  • Async task mode, returns a task ID
  • Set model to grok-imagine-1.0

Authorizations

Authorization
string
required
All endpoints require Bearer Token authenticationGet API Key from API Key ManagementHeader example:
Authorization: Bearer YOUR_API_KEY

Body

model
string
required
Model name, use:
  • grok-imagine-1.0
prompt
string
required
Prompt for image generation, multilingual supported
size
string
default:"1:1"
Image generation sizeSupported formats:
  • 1:1 - Square (default)
  • 16:9 - Landscape widescreen
  • 9:16 - Portrait tall screen
  • 3:2 - Landscape
  • 2:3 - Portrait
n
integer
default:1
Number of images to generateRange: 1-10 (minimum 1, maximum 10)⚠️ Note: use a plain number (for example 1), do not wrap it in quotes

Response

id
string
Unique task ID
object
string
Always generation.task
status
string
Task status: queued / in_progress / completed / failed
curl --request POST \
  --url https://toapis.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-imagine-1.0",
    "prompt": "An orange cat sitting on a sunny windowsill, oil painting style",
    "size": "1:1",
    "n": 1
  }'
{
  "id": "task_01JNXXXXXXXXXXXXXXXXXX",
  "object": "generation.task",
  "model": "grok-imagine-1.0",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {}
}