Billing
Estimate request cost
POST
Estimates the upper-bound request cost without sending a provider request or charging the account. The model string is resolved the same way a request is, and the estimate uses the most expensive of the routes that could serve it at the caller's effective price (including contract pricing), because the serving route depends on availability at request time. Time-window pricing (peak/off-peak) is resolved at the current UTC time, so the estimate uses the tier that a request would be billed at right now.
ApiKeyAuthheader
Authorization<token>application/json- body
max_completion_tokens?integermax_tokens?integermessages?array<unknown>model*stringCost estimate.
application/json- response
confidence*stringestimated_input_cost*stringestimated_input_tokens?integermax_output_cost*stringmax_output_tokens?integermax_total_cost*stringmodel*stringcurl -X POST 'https://api.ohmygpt.com/v1/cost-estimates' \ -H 'Content-Type: application/json' \ -d '{ "model": "string"}'Example Response
{ "confidence": "string", "estimated_input_cost": "string", "estimated_input_tokens": 0, "max_output_cost": "string", "max_output_tokens": 0, "max_total_cost": "string", "model": "string"}