Estimate the cost of a chat request
get_price_estimateCheck the USDC cost of a chat completion before payment. Provide model or mode, messages, and max_tokens to get an exact, local, and free estimate.
Instructions
Estimate the USDC cost of a chat completion request before paying — free, no payment, no authentication required. Read-only: no state changes and no external calls; the estimate is computed locally from server pricing config, so repeated calls with identical inputs return identical results (idempotent). Use this tool to check the exact price for a given model/mode, messages, and max_tokens before calling the paid chat_completions tool. Provide either mode (auto/eco/premium routing) or model (explicit id, mutually exclusive with mode); one of the two is required — if both are sent, model wins. mode values: auto = cheapest model fitting the context, eco = cheapest available, premium = best model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Smart routing profile (auto/eco/premium). | |
| model | No | Explicit model id (see list_models / /v1/models). Mutually exclusive with mode. | |
| messages | Yes | Chat messages (text content only). | |
| max_tokens | No | Max output tokens to estimate (billed upfront, §4.2). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| amount_usdc | No | ||
| input_tokens | No | ||
| amount_atomic | No | ||
| max_tokens_clamped | No |