POST /v1/images/generations
Submit an image generation job
Request
POST /api/v1/images/generations
Authorization: Bearer sk_xxx
Content-Type: application/jsonBody
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | ✅ | — | Description of the image |
model | string | — | nano-banana | Model id (nano-banana / flux-pro / ideogram-v3) |
aspect_ratio | string | — | '1:1' | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 |
n | number | — | 1 | Number of images (1-4) |
seed | number | — | random | Reproducibility seed |
image_inputs | string[] | — | — | Reference image URLs (first is used as the reference/edit image) |
negative_prompt | string | — | — | What to avoid |
extra | object | — | — | Provider-specific params (pass-through) |
Example
curl -X POST https://genace.ai/api/v1/images/generations \
-H "authorization: Bearer sk_xxx" \
-H "content-type: application/json" \
-d '{
"prompt": "a minimalist poster of a corgi astronaut, flat design",
"model": "nano-banana",
"aspect_ratio": "1:1",
"n": 1
}'Response
202 Accepted
{
"job_id": "abc123",
"state": "queued",
"model": "nano-banana",
"created_at": "2026-05-29T10:00:00Z",
"credits_held": 4
}401 Unauthorized
Missing or invalid API key.
402 Insufficient Credits
{
"error": {
"type": "insufficient_credits",
"code": "NOT_ENOUGH_CREDITS",
"message": "credits 不足:当前 5,需要 25"
}
}429 Rate Limited / Concurrency Limited
{
"error": {
"type": "rate_limited",
"code": "RATE_LIMIT_EXCEEDED",
"message": "请求过于频繁:每 60s 限 5 次"
}
}Next
After getting job_id, retrieve the result via:
- GET /v1/jobs/:id — single query or long-poll
- GET /v1/jobs/:id/stream — SSE progress stream
Genace Docs