{"uid":"cap_F2Hx-X2nxGlkmwVrJ393N","slug":"llm-price-calculator-17d469cf","name":"LLM Price Calculator","description":"Use when an agent must price an LLM call or pick the cheapest model. Input: model (up to 5, comma list) plus optional input_tokens, output_tokens, requests; or no model plus mode, provider, min_context, capabilities (vision, function_calling...). Output: JSON USD per 1M input/output tokens, cached/batch prices, context window, provider, capabilities, cost estimate or cheapest ranking, as_of + source commit. Example: ?model=gpt-4o&input_tokens=12000&output_tokens=800","url":"https://1gateway.dev/v1/ai/llm-prices?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":[],"properties":{"mode":{"enum":["chat","embedding","completion","rerank","image_generation","audio_transcription","audio_speech","realtime","moderation"],"type":"string","examples":["chat"],"description":"Model type for the cheapest search (default chat; chat includes responses-API models). Ignored when model is given"},"limit":{"type":"integer","maximum":25,"minimum":1,"examples":[5],"description":"Max rows per model or in the ranking (default 10)"},"model":{"type":"string","examples":["gpt-4o"],"maxLength":400,"description":"Model name(s), up to 5 comma-separated (gpt-4o, claude-sonnet-4-5, gemini/gemini-2.5-flash). Also lists the same model at other providers. Omit to rank the cheapest models. Unknown → 400 with suggestions (not charged)"},"provider":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,40}$","examples":["openai"],"description":"LiteLLM provider id filter: openai, anthropic, gemini, vertex_ai, bedrock, azure, groq, deepseek, mistral..."},"requests":{"type":"integer","maximum":1000000000,"minimum":1,"examples":[1000],"description":"Number of requests to multiply the estimate by (default 1)"},"min_context":{"type":"integer","maximum":100000000,"minimum":1,"examples":[100000],"description":"Minimum context window (max input tokens)"},"capabilities":{"type":"string","examples":["vision"],"maxLength":200,"description":"Comma-separated required capabilities: vision, function_calling, reasoning, prompt_caching, response_schema, pdf_input, audio_input, audio_output, web_search, computer_use, video_input"},"input_tokens":{"type":"integer","maximum":100000000,"minimum":0,"examples":[12000],"description":"Input (prompt) tokens per request, for the cost estimate and ranking"},"output_tokens":{"type":"integer","maximum":100000000,"minimum":0,"examples":[800],"description":"Output (completion) tokens per request"},"include_deprecated":{"enum":["true","false"],"type":"string","examples":["false"],"description":"Include models past their deprecation date in the cheapest search (default false)"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["as_of","source","kind","query","attribution"],"properties":{"kind":{"type":"string"},"as_of":{"type":"string"},"query":{"type":"object","properties":{"mode":{"type":"string"},"limit":{"type":"integer"},"model":{"type":["array","null"],"items":{"type":"string"}},"provider":{"type":["string","null"]},"requests":{"type":"integer"},"min_context":{"type":["integer","null"]},"capabilities":{"type":"array","items":{"type":"string"}},"input_tokens":{"type":["integer","null"]},"output_tokens":{"type":["integer","null"]},"include_deprecated":{"type":"boolean"}}},"models":{"type":"array","items":{"type":"object","properties":{"mode":{"type":"string"},"model":{"type":"string"},"estimate":{"type":["object","null"],"properties":{"requests":{"type":"integer"},"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"input_cost_usd":{"type":"number"},"total_cost_usd":{"type":"number"},"output_cost_usd":{"type":"number"},"cost_per_request_usd":{"type":"number"},"long_context_tier_applied":{"type":"boolean"}}},"provider":{"type":"string"},"deprecated":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"string"}},"context_window":{"type":["integer","null"]},"deprecation_date":{"type":["string","null"]},"input_per_1m_usd":{"type":["number","null"]},"long_context_tier":{"type":["object","null"],"properties":{"input_per_1m_usd":{"type":["number","null"]},"output_per_1m_usd":{"type":["number","null"]},"above_input_tokens":{"type":"integer"}}},"max_output_tokens":{"type":["integer","null"]},"output_per_1m_usd":{"type":["number","null"]},"batch_input_per_1m_usd":{"type":["number","null"]},"batch_output_per_1m_usd":{"type":["number","null"]},"cached_input_per_1m_usd":{"type":["number","null"]}}}},"source":{"type":"object","properties":{"url":{"type":"string"},"name":{"type":"string"},"commit":{"type":"string"},"license":{"type":"string"},"committed_at":{"type":"string"},"models_in_table":{"type":"integer"}}},"ranking":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"query":{"type":"string"},"listings":{"type":"array","items":{"type":"object","properties":{"mode":{"type":"string"},"model":{"type":"string"},"estimate":{"type":["object","null"],"properties":{"requests":{"type":"integer"},"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"input_cost_usd":{"type":"number"},"total_cost_usd":{"type":"number"},"output_cost_usd":{"type":"number"},"cost_per_request_usd":{"type":"number"},"long_context_tier_applied":{"type":"boolean"}}},"provider":{"type":"string"},"deprecated":{"type":"boolean"},"capabilities":{"type":"array","items":{"type":"string"}},"context_window":{"type":["integer","null"]},"deprecation_date":{"type":["string","null"]},"input_per_1m_usd":{"type":["number","null"]},"long_context_tier":{"type":["object","null"],"properties":{"input_per_1m_usd":{"type":["number","null"]},"output_per_1m_usd":{"type":["number","null"]},"above_input_tokens":{"type":"integer"}}},"max_output_tokens":{"type":["integer","null"]},"output_per_1m_usd":{"type":["number","null"]},"batch_input_per_1m_usd":{"type":["number","null"]},"batch_output_per_1m_usd":{"type":["number","null"]},"cached_input_per_1m_usd":{"type":["number","null"]}}}},"exact_match":{"type":"boolean"},"listings_total":{"type":"integer"}}}},"attribution":{"type":"string"},"matched_total":{"type":"integer"}}}}}}},"responseSchema":{"type":"json","example":{"kind":"lookup","as_of":"2026-10-18","query":{"mode":"chat","limit":3,"model":["gpt-4o"],"provider":null,"requests":1000,"min_context":null,"capabilities":[],"input_tokens":12000,"output_tokens":800,"include_deprecated":false},"source":{"url":"https://github.com/BerriAI/litellm/blob/af194c842cd8c0276f69fc05efacaa18505c7484/model_prices_and_context_window.json","name":"LiteLLM model_prices_and_context_window.json","commit":"af194c842cd8c0276f69fc05efacaa18505c7484","license":"MIT","committed_at":"2026-10-18T02:54:27Z","models_in_table":3418},"results":[{"query":"gpt-4o","listings":[{"mode":"chat","model":"gpt-4o","estimate":{"requests":1000,"input_tokens":12000,"output_tokens":800,"input_cost_usd":30,"total_cost_usd":38,"output_cost_usd":8,"cost_per_request_usd":0.038,"long_context_tier_applied":false},"provider":"openai","deprecated":false,"capabilities":["vision"],"context_window":128000,"deprecation_date":null,"input_per_1m_usd":2.5,"long_context_tier":null,"max_output_tokens":16384,"output_per_1m_usd":10,"batch_input_per_1m_usd":1.25,"batch_output_per_1m_usd":5,"cached_input_per_1m_usd":1.25}],"exact_match":true,"listings_total":5}],"attribution":"Prices: LiteLLM model_prices_and_context_window.json, MIT License, Copyright (c) 2023 Berri AI. List prices as compiled by LiteLLM; confirm with the provider b…"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","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.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_EwEljyeyX2bzxgKWuF1Oy","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns USD pricing per 1M tokens, context window, capabilities, and cost estimates for one or more LLM models, or ranks the cheapest models matching given criteria.","exampleAgentPrompt":"What would it cost to run 1000 requests to gpt-4o with 12000 input tokens and 800 output tokens each, and how does it compare to claude-sonnet-4-5 and gemini/gemini-2.5-flash?","exampleUseCases":[{"title":"Cost estimate before deploying LLM pipeline","prompt":"I'm about to run a batch job — 50000 requests to gpt-4o with about 2000 input tokens and 500 output tokens each. What's the total estimated cost in USD, and does it support batch pricing?"},{"title":"Find cheapest vision-capable chat model","prompt":"I need a chat model that supports vision and function calling with at least a 100k context window — can you rank the 5 cheapest options across all providers?"},{"title":"Compare pricing across providers for same model","prompt":"Show me the price per million tokens for claude-sonnet-4-5 across all providers it's available on, including any cached or batch discounts."}],"resultDescription":"A JSON object containing: the query echo, data freshness date and LiteLLM source commit, and per-model results with input/output/cached/batch prices per 1M tokens, context window size, capabilities list, deprecation status, and (if token counts or request count provided) a full cost breakdown including total_cost_usd and cost_per_request_usd. In ranking mode, returns models sorted by cost ascending.","failureModes":["Unknown model name returns HTTP 400 with suggested alternatives (not charged)","Invalid provider ID pattern returns 400","Requesting more than 5 models in a comma list returns error","Capability filter with no matching models returns empty results array","Stale pricing if LiteLLM upstream has not been updated recently (as_of date indicates freshness)"],"whenToPreferThis":"Use this endpoint when an AI agent needs to select or price LLM API calls programmatically — especially when comparing multiple models, filtering by capabilities or context window, or estimating costs at scale. Prefer this over manual lookup when the agent must make cost-aware routing decisions, enforce budget constraints, or present pricing comparisons to users. The endpoint is backed by the well-maintained LiteLLM price table (3400+ models) and returns structured JSON suitable for automated decision-making.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-28T12:35:40.574Z","isFirstParty":false,"canonicalSlug":"llm-price-calculator-17d469cf"}