AI API cost
ai_api_costEstimate USD cost per request, day, and month from token counts, caching, and batch discounts for API workload budgeting.
Instructions
Estimate USD per request, day and month from token counts, caching and published batch discounts. Use for an API workload budget, not chat subscriptions. Model IDs use providerId/id from the bundled src/data/pricing-snapshot.json catalog. Rates are from the dated catalog snapshot returned with the result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modelIds | Yes | ||
| inputTokens | Yes | ||
| outputTokens | Yes | ||
| batchModelIds | No | Optional model IDs using a published batch discount. | |
| requestsPerDay | Yes | ||
| requestsPerMonth | Yes | ||
| cachedInputTokens | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool | Yes | ||
| input | Yes | ||
| units | Yes | ||
| method | Yes | ||
| estimates | Yes | ||
| provenance | Yes | ||
| assumptions | Yes |