Skip to main content
POST /api/v1/estimate estimates a chat request’s cost. It is free and requires no API key. Use estimate.create in either SDK.
cURL

Parameters

Response

Two numbers matter:
  • estimated_cents / estimated_cost — a realistic mid-point. The completion side uses a heuristic of 40% of the prompt tokens (at least 64), capped at max_tokens or 2,048.
  • estimated_max_cents / estimated_max — the pre-authorization hold a real request with these messages and max_tokens would reserve. The hold is a reserve, not a ceiling: the request settles to actual usage and the unused portion is returned. Use it to size routing.max_cost_usd — a cap below the hold is rejected with 400 max_cost_exceeded. See Spend controls.
cheaper_alternatives lists up to three catalog models that would cost less at this exact payload, sorted by savings. model_comparison appears only when you pass models. The numbers in the sample are illustrative; the endpoint returns live values.

Limits

  • 30 requests per minute per client IP (429 rate_limit_exceeded with retry_after and a Retry-After header).
  • Unknown model IDs return 400 validation_error with the closest matching ID in the message.

Live price sheet

GET /api/v1/pricing for every model’s metered rates.

Cap a request

routing.max_cost_usd turns an estimate into a hard ceiling.