Generations
Create a generation
One request starts the job and, with wait, returns the finished result.
POST /v1/generations answers 202 with the job. Add ?wait=60 and the request stays open until the job finishes (up to 60 seconds), then answers 200 with the result.
curl "https://api.opengrid.one/v1/generations?wait=60" \
-H "Authorization: Bearer $OPENGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-pro",
"variant": "2k",
"quantity": 1,
"input": {
"prompt": "A paper boat drifting down a rain gutter, golden hour",
"aspect_ratio": "16:9"
}
}'Body
| Field | Required | Meaning |
|---|---|---|
model | Yes | A model id from the catalog. |
variant | If more than one | A variant id such as 720p. |
quantity | Depends on the unit | Seconds, images or runs, within the model's range. Leave out for per_1k_chars. |
input | Yes | The model's own fields, such as prompt and aspect_ratio. |
routing | No | balanced (default), cheapest or fastest. See Routing. |
fallback | No | Default true. false runs on one provider only and refunds on failure. |
own_key_fallback | No | Default true. If you have stored your own provider key in Settings, a job whose OpenGrid providers all fail runs on your key as a last resort, at no charge from OpenGrid. false turns that off for this request. With your own Higgsfield or World Labs key stored, model can also name one of their endpoints directly, as higgsfield/<endpoint> or worldlabs/<task>: input is sent to the provider as written, and the run is on your key alone. |
max_price_usd | No | A cap. Providers that would cost more are never used. |
Headers
| Header | Required | Meaning |
|---|---|---|
Authorization | Yes | Bearer og_live_... |
Content-Type | Yes | application/json |
Idempotency-Key | Recommended | 8 to 100 characters. Makes a retry safe. See Idempotency. |
Query
| Parameter | Meaning |
|---|---|
wait | 0 to 60. Seconds to hold the request open while the job is unfinished. Default 0. |
What happens when you submit
- The request is priced on every provider that can take your exact input, and a plan of up to three providers is built.
max_usd, the highest price in that plan, is held from your balance.- The job runs on the first provider. If it fails, the job moves to the next.
- On success you are charged the price of the provider that finished it, and the rest of the hold is returned. On failure the whole hold is returned.
{
"id": "5b0e7c1e-6f0e-4a55-9d9b-3f2a8f1c2d10",
"model": "nano-banana-pro",
"variant": "2k",
"quantity": 1,
"unit": "per_image",
"routing": "balanced",
"status": "running",
"charged_usd": 0.1575,
"estimated_usd": 0.141225,
"max_usd": 0.1575,
"currency": "USD",
"attempts": 1,
"outputs": null,
"available_until": null,
"error": null,
"created_at": "2026-11-24T18:03:11.412Z",
"finished_at": null
}