Pricing and usage
Before you call
Use the catalog to show prices:
const catalog = await client.inference.models.catalog();
Model metadata may include textPricing, visionPricing, and toolPricing.
You can also fetch GET /v1/pricing via the HTTP API.
After you call
Successful chat responses include:
response.usage; // prompt_tokens, completion_tokens, total_tokens
response.cost; // USDC breakdown
Cost breakdown
| Field | Description |
|---|---|
inference |
Base inference charge |
vision |
Extra for image requests (when applicable) |
managedConversation |
Conversation storage fee (when applicable) |
toolCalls |
Tool-related charge (when applicable) |
total |
Total USDC charged |
Each amount is { amount: string, asset: string } (typically USDC).
The 402 payment requirement may also include a cost preview before you pay.