{"uid":"cap_NThBJCQAEKLKWCEWIoByZ","slug":"llm-cost-capacity-calc-per-request-total-cost-eb0708ed","name":"LLM Cost & Capacity Calc – Per-Request & Total Cost","description":"Cost of LLM API calls from input and output tokens and your per-million-token prices, per request and in total.","url":"https://llm-cost-calc.x402tookit.com/llm-cost?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["inputTokens","outputTokens","inputPricePerMTok","outputPricePerMTok"],"properties":{"requests":{"type":"integer","description":"Number of requests, 1 to 1e9 (default 1)"},"inputTokens":{"type":"number","description":"Input (prompt) tokens per request"},"outputTokens":{"type":"number","description":"Output (completion) tokens per request"},"inputPricePerMTok":{"type":"number","description":"Price per million input tokens, in your currency"},"outputPricePerMTok":{"type":"number","description":"Price per million output tokens"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"requests":{"type":["null","number"]},"totalCost":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"costPerRequest":{"type":["null","number"]},"totalInputTokens":{"type":["null","number"]},"totalOutputTokens":{"type":["null","number"]},"blendedPricePerMTok":{"type":["null","number"]},"inputCostPerRequest":{"type":["null","number"]},"outputCostPerRequest":{"type":["null","number"]},"outputShareOfCostPercent":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_s0ZS7Wqoa0SJAnSm7DGoj","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the cost of LLM API calls given input and output token counts and per-million-token prices, returning per-request and total cost breakdowns.","exampleAgentPrompt":"Calculate the total and per-request cost for 5000 LLM calls where each request uses 800 input tokens and 400 output tokens, with an input price of $3 per million tokens and an output price of $15 per million tokens.","exampleUseCases":[{"title":"GPT-4o budget check before launch","prompt":"How much will it cost me to run 10,000 requests using GPT-4o if each request sends 1,200 input tokens and gets back 600 output tokens? Input is $2.50 per million tokens and output is $10 per million tokens."},{"title":"Comparing input vs output cost split","prompt":"Break down cost per request and total cost for a single LLM call with 2,000 input tokens and 500 output tokens, at $5 per million input tokens and $20 per million output tokens — I want to see how much of my spend is on output."},{"title":"Daily batch job cost estimation","prompt":"I run 50,000 LLM API calls per day with about 300 input tokens and 150 output tokens each. My provider charges $1.50 per million input tokens and $6 per million output tokens — what's my total daily cost and blended price per million tokens?"}],"resultDescription":"Returns a structured breakdown including cost per request, total cost for all requests, input cost per request, output cost per request, total input and output tokens, blended price per million tokens, and the output share of total cost as a percentage, along with optional summary and disclaimer fields.","failureModes":["Missing required query parameters (inputTokens, outputTokens, inputPricePerMTok, outputPricePerMTok) returns an error","Non-numeric token counts or prices cause validation failure","requests value outside 1–1,000,000,000 range rejected","Payment of $0.02 USDC not fulfilled causes 402 error"],"whenToPreferThis":"Use this endpoint when you need a quick, deterministic calculation of LLM API cost from known token counts and per-million-token prices — ideal for budget checks, cost breakdowns by input vs output, and per-request vs total spend analysis. Prefer this over the forecast or caching endpoints when you have exact token counts for a defined workload and just need raw cost figures without growth projections or caching logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:12:39.691Z","isFirstParty":false,"canonicalSlug":"llm-cost-capacity-calc-per-request-total-cost-eb0708ed"}