API reference
Estimate a generation
Credit price of a single-model generation. Nothing is charged. Fields: model, prompt, seconds, count, characters (speech only, instead of prompt), aspect_ratio, resolution.
POST https://app.cookstudio.ai/api/v1/generations/estimate
Request
curl https://app.cookstudio.ai/api/v1/generations/estimate -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"model": "gpt-image-25", "aspect_ratio": "16:9"}'Response
{"object": "estimate", "model": "gpt-image-25", "credits": 3, "balance": 1240, "enough_credits": true, "available": true}Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | A field is missing, unknown or out of range. message names the field and the allowed values. |
| 401 | unauthorized | Missing, wrong or revoked key. |
| 503 | service_unavailable | Production is paused or unreachable. Nothing was charged; retry in a few minutes. |
All errors share one shape; see Errors.