ai_token_arbitrage
Calculate multi-provider LLM API inference costs, prompt caching economics (up to 90% discount), batch discounts, and cost disparity across Claude 3.5 Sonnet, GPT-4o, DeepSeek V3/R1, and Gemini 1.5 Pro/Flash.
Behavior: Deterministic, idempotent calculation with zero external side effects. Models official pricing cards per million input/output tokens. Incorporates prompt cache hit pricing reductions and asynchronous batch API discounts (50%). Returns comprehensive cost comparison matrix, cheapest model recommendation, cache savings, and cost multiples relative to the lowest-cost model.
Usage Guidelines: Use when budgeting AI agent inference costs, evaluating LLM providers, or deciding whether to implement prompt caching. Do not use for general cloud bandwidth transfer costs; use cloud_egress_finops instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| isBatch | No | Whether the 50% asynchronous batch processing discount applies. | |
| promptTokens | No | Number of input prompt tokens per API call. Must be an integer >= 0. | |
| cacheHitRatio | No | Proportion of input prompt tokens served from cache (0.0 to 1.0 or 0 to 100%). Default is 0.80 (80%). | |
| completionTokens | No | Number of generated output completion tokens per API call. Must be an integer >= 0. |