{"uid":"cap__vf1OSyWqfQoQnHLMP_k4","slug":"freetier-agent-api-ai-model-cost-calculator-7972cdcc","name":"FreeTier Agent API — AI Model Cost Calculator","description":"Token & cost calculator: estimate tokens for a text (or pass input_tokens/output_tokens) and price it across several models using provider list prices (LiteLLM price table, MIT). Params: models (comma list of model ids like gpt-4o-mini, claude-sonnet-4-5, gemini/gemini-2.5-flash or search words, max 15), text or input_tokens, output_tokens, calls.","url":"https://freetier-agent-api.pages.dev/api/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":[],"properties":{"text":{"type":"string"},"calls":{"type":"string"},"models":{"type":"string"},"input_tokens":{"type":"string"},"output_tokens":{"type":"string"}}}}},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"calls":{"type":["number","null"]},"results":{"type":"array","items":{"type":["object","null"]}},"sources":{"type":"array","items":{"type":["object","null"]}},"input_tokens":{"type":["number","null"]},"output_tokens":{"type":["number","null"]},"estimate_method":{},"input_tokens_estimated":{"type":["boolean","null"]}}}}}}},"responseSchema":{"type":"json","example":{"calls":1000,"results":[{"model":"gpt-4o-mini","requested":"gpt-4o-mini","total_usd":0.36,"fits_context":true,"context_length":128000,"input_per_m_usd":0.15,"output_per_m_usd":0.6,"cost_per_call_usd":0.00036},{"model":"gemini/gemini-2.5-flash","requested":"gemini/gemini-2.5-flash","total_usd":1.11,"fits_context":true,"context_length":1048576,"input_per_m_usd":0.3,"output_per_m_usd":2.5,"cost_per_call_usd":0.00111}],"sources":[{"url":"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json","name":"BerriAI/litellm model_prices_and_context_window.json (provider list prices)","note":"USD list prices per provider/model id; check the provider page before committing spend.","license":"MIT","snapshot":"2026-10-17"}],"input_tokens":1200,"output_tokens":300,"estimate_method":null,"input_tokens_estimated":false}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_YczzpHg6Ry7SDyOphXgzD","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the estimated USD cost of running AI model inference for a given number of calls, input tokens, and output tokens across specified models","exampleAgentPrompt":"How much would it cost me to run openai/gpt-4o-mini for 1000 calls with 1200 input tokens and 300 output tokens each?","exampleUseCases":[{"title":"Budget planning for AI agent fleet","prompt":"I'm building an agent that will make about 5000 calls a day to openai/gpt-4o-mini with roughly 800 input tokens and 200 output tokens each — how much will that cost me per day in USD?"},{"title":"Comparing model costs before deployment","prompt":"Can you compare the total cost of running 2000 calls on openai/gpt-4o versus anthropic/claude-3-5-sonnet with 1000 input tokens and 500 output tokens per call so I can pick the cheaper one?"},{"title":"Estimating LLM spend for a specific project","prompt":"I need to estimate the cost of processing 10000 calls using google/gemini-flash with 600 input tokens and 150 output tokens each — what's the total USD cost and cost per call?"}],"resultDescription":"Returns a JSON object with the number of calls, a list of model results each containing the model name, total cost in USD, and cost per call in USD, plus the input and output token counts used in the calculation.","failureModes":["Missing required 'models' parameter results in empty or error response","Invalid or unrecognized model name may return no results or zero cost","Non-numeric values for calls, input_tokens, or output_tokens may cause computation errors","Stale model pricing data may not reflect the latest provider price changes"],"whenToPreferThis":"Use this endpoint when you need a quick, programmatic, pay-per-call cost estimate for specific AI models without signing up for any service. It is ideal for agents that need to self-evaluate inference costs, compare models by price, or project budgets. Prefer this over scraping provider pricing pages or maintaining your own pricing database.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-02T06:39:04.038Z","isFirstParty":false,"canonicalSlug":"freetier-agent-api-ai-model-cost-calculator-7972cdcc"}