AI token cost arbitrage
ai_token_arbitrageCalculate multi-provider LLM API inference token costs, prompt caching economics (up to 95% discount), batch API savings (50%), and cross-model cost disparity multipliers across frontier and high-efficiency models (Anthropic Claude, OpenAI GPT, Google Gemini, DeepSeek).
Behavior: Deterministic, idempotent calculation with zero external side effects. Models official public provider pricing cards per million input/output tokens. Incorporates prompt cache hit pricing reductions and asynchronous batch API discounts. Evaluates real-time pack age and freshness status (FRESH < 14 days, AGING 14-30 days, STALE > 30 days). Returns comprehensive model cost matrix, cheapest and most expensive model arbitrage analysis, cache savings, and monthly cost projections.
Usage Guidelines: Use when budgeting AI agent inference costs, evaluating LLM providers, or deciding whether to implement prompt caching or batch inference. Do not use for cloud network egress; use cloud_egress_finops instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| isBatch | No | CamelCase alias for is_batch. | |
| asOfDate | No | CamelCase alias for as_of_date. | |
| is_batch | No | Whether asynchronous batch processing discount (50%) applies. Alias: isBatch. | |
| as_of_date | Yes | ISO date string (YYYY-MM-DD) for rate-pack historical resolution (e.g. '2026-09-07' for current, '2025-11-15' for 2025-Q4). Alias: asOfDate. | |
| promptTokens | No | CamelCase alias for prompt_tokens. | |
| cacheHitRatio | No | CamelCase alias for cache_hit_ratio. | |
| prompt_tokens | Yes | Number of input prompt tokens per API call. Must be a non-negative integer. Alias: promptTokens. | |
| cache_hit_ratio | No | Proportion of input prompt tokens served from cache (0.0 to 1.0 or 0% to 100%). Default is 0.80 (80%). Alias: cacheHitRatio. | |
| completionTokens | No | CamelCase alias for completion_tokens. | |
| completion_tokens | Yes | Number of generated output completion tokens per API call. Must be a non-negative integer. Alias: completionTokens. |