# LLM Cost & Capacity Calc Token estimates, API cost, prompt-cache savings, batch discounts, context fit, rate-limit planning and model comparison from your own prices. ## How to pay Machine-payable over x402. USDC on: Base (eip155:8453), Solana (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp), Polygon (eip155:137), Arbitrum One (eip155:42161). No accounts. No API keys. No signup. The paying wallet is the account. ## Machine-readable - OpenAPI: https://llm-cost-calc.x402tookit.com/openapi.json - x402 manifest: https://llm-cost-calc.x402tookit.com/.well-known/x402 - Catalog (free): https://llm-cost-calc.x402tookit.com/catalog - Health (free): https://llm-cost-calc.x402tookit.com/health - Uptime (free): https://llm-cost-calc.x402tookit.com/uptime ## Endpoints (8) ### GET /batch-discount — $0.02 Compare realtime and batch API cost for a workload with your discount fraction, and the money saved by waiting. Params: inputTokens: number, outputTokens: number, requests: integer, inputPricePerMTok: number, outputPricePerMTok: number, batchDiscount?: number Example: https://llm-cost-calc.x402tookit.com/batch-discount?inputTokens=2000&outputTokens=300&requests=100000&inputPricePerMTok=3&outputPricePerMTok=15&batchDiscount=0.5 ### GET /cache-savings — $0.02 Prompt-cache savings for a shared prefix: cost with and without caching, break-even requests and percent saved. Params: prefixTokens: number, uncachedTokens?: number, requests: integer, inputPricePerMTok: number, writeMultiplier?: number, readMultiplier?: number Example: https://llm-cost-calc.x402tookit.com/cache-savings?prefixTokens=20000&uncachedTokens=500&requests=50&inputPricePerMTok=3 ### GET /context-fit — $0.02 Check whether a prompt fits a context window with output reserve, and how many more chat turns fit. Params: contextWindow: number, promptTokens: number, maxOutputTokens?: number, tokensPerTurn?: number, safetyPercent?: number Example: https://llm-cost-calc.x402tookit.com/context-fit?contextWindow=200000&promptTokens=150000&maxOutputTokens=4096&tokensPerTurn=1500 ### GET /llm-cost — $0.02 Cost of LLM API calls from input and output tokens and your per-million-token prices, per request and in total. Params: inputTokens: number, outputTokens: number, inputPricePerMTok: number, outputPricePerMTok: number, requests?: integer Example: https://llm-cost-calc.x402tookit.com/llm-cost?inputTokens=3000&outputTokens=500&inputPricePerMTok=3&outputPricePerMTok=15&requests=1000 ### GET /model-compare — $0.02 Rank 2 to 20 models by cost for a workload from your own prices; flags models whose context window is too small. Params: models: string, inputTokens: number, outputTokens: number, requests?: integer Example: https://llm-cost-calc.x402tookit.com/model-compare?models=%5B%7B%22name%22%3A%22Big%22%2C%22inputPricePerMTok%22%3A15%2C%22outputPricePerMTok%22%3A75%2C%22contextWindow%22%3A200000%7D%2C%7B%22name%22%3A%22Mid%22%2C%22inputPricePerMTok%22%3A3%2C%22outputPricePerMTok%22%3A15%2C%22contextWindow%22%3A200000%7D%2C%7B%22name%22%3A%22Small%22%2C%22inputPricePerMTok%22%3A0.25%2C%22outputPricePerMTok%22%3A1.25%2C%22contextWindow%22%3A32000%7D%5D&inputTokens=5000&outputTokens=800&requests=10000 ### GET /monthly-budget — $0.02 Forecast monthly and yearly LLM spend from daily requests, tokens and prices, with monthly growth and per-user cost. Params: requestsPerDay: number, inputTokens: number, outputTokens: number, inputPricePerMTok: number, outputPricePerMTok: number, monthlyGrowthPercent?: number, months?: integer, users?: integer Example: https://llm-cost-calc.x402tookit.com/monthly-budget?requestsPerDay=2000&inputTokens=1500&outputTokens=400&inputPricePerMTok=3&outputPricePerMTok=15&monthlyGrowthPercent=10&months=12&users=500 ### GET /rate-limit-plan — $0.02 Sustainable requests per minute under RPM and TPM limits, job duration for N requests, and concurrency needed. Params: requestsPerMinuteLimit: number, tokensPerMinuteLimit: number, tokensPerRequest: number, totalRequests?: integer, secondsPerRequest?: number Example: https://llm-cost-calc.x402tookit.com/rate-limit-plan?requestsPerMinuteLimit=1000&tokensPerMinuteLimit=400000&tokensPerRequest=2500&totalRequests=20000&secondsPerRequest=6 ### GET /token-estimate — $0.02 Rough LLM token estimate of text from characters and words, as a low-high range by content type. Not a tokenizer. Params: text: string, kind?: string Example: https://llm-cost-calc.x402tookit.com/token-estimate?text=The+quick+brown+fox+jumps+over+the+lazy+dog.&kind=english ## Terms Arithmetic on prices, limits and token counts that the CALLER supplies: no provider price list is built in, because prices change. Token estimates are rough heuristics, not a tokenizer; real counts differ by model and language. Not a quote or a billing statement.