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

StatusCodeMeaning
400invalid_requestA field is missing, unknown or out of range. message names the field and the allowed values.
401unauthorizedMissing, wrong or revoked key.
503service_unavailableProduction is paused or unreachable. Nothing was charged; retry in a few minutes.

All errors share one shape; see Errors.