Create a generation
Start an async generation job. Generate one Idempotency-Key for the request and reuse it only when retrying the exact same payload. Poll `GET /v1/generations/{id}` for status, or provide a `webhook_url` to be notified on completion.
Deprecated
Start an async generation job. Generate one Idempotency-Key for the request and reuse it only when retrying the exact same payload. Poll GET /v1/generations/{id} for status, or provide a webhook_url to be notified on completion.
Authorization
bearerAuth API key authentication. Use your API key as the bearer token: Authorization: Bearer roasos_sk_...
In: header
Header Parameters
A unique string that makes retries safe. Any value 16-255 characters; reuse it only when retrying the exact same request.
^[A-Za-z0-9._:-]+$16 <= length <= 255Optional label to group this request under one of your projects. Appears in your usage records.
^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$1 <= length <= 64Optional label to attribute this request to a cost center. Appears in your usage records.
^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$1 <= length <= 64Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/generations" \ -H "Idempotency-Key: stringstringstri" \ -H "Content-Type: application/json" \ -d '{ "type": "image", "prompt": "Studio product photograph of a cobalt hydration bottle", "model": "nano-banana-pro", "options": { "aspect_ratio": "1:1", "resolution": "1K", "num_outputs": 1 } }'{ "data": { "kind": "quote", "quote_id": "3c071a1d-db86-46a7-9dc8-72ba3fbca992", "reserved_credits": 1, "expires_at": "2019-08-24T14:15:22Z", "pricing_version": "string", "authorization": { "status": "auto_approved" }, "confirmation": { "generation_type": "image", "model": "string", "mode": "string", "resolution": "string", "output_count": 1, "duration_seconds": 1, "generate_audio": true, "reference_count": 0, "text_length": 0 } }}