{"name":"llm-cost-estimate","description":"LLM cost estimate API, token cost estimate endpoint, and token cost calculator for comparing inference cost across models before you run a prompt. Send input_tokens and output_tokens (or raw text, auto-estimated at roughly 4 characters per token) plus a list of model names, and get a per-model price breakdown from a built-in snapshot price table, with the cheapest known model called out. Pass price_overrides to price your own negotiated rates or a model missing from the table instead of getting a guess. The table is stamped with an as_of date so you know how fresh the snapshot is. Use it as a token cost calculator, a model price compare tool, or a pre-flight budget check before an LLM run or agent workflow.","price":"$0.005","method":"POST","input_schema":{"properties":{"input_tokens":{"type":"number","description":"Number of input/prompt tokens. Optional if 'text' is given."},"output_tokens":{"type":"number","description":"Number of output/completion tokens. Optional, defaults to 0."},"text":{"type":"string","description":"Raw prompt text; used to estimate input_tokens (~chars/4) when input_tokens is not given directly. Max 500,000 chars."},"models":{"type":"array","items":{"type":"string"},"description":"Model names to estimate cost for, e.g. ['gpt-4o-mini', 'claude-sonnet-4.5']. Defaults to a small built-in comparison set. Max 30."},"price_overrides":{"type":"object","description":"Optional per-model price overrides keyed by model name: { input_per_1m?: number, output_per_1m?: number }. Use for current pricing or models missing from the built-in table."}},"required":[]},"input_example":{"input_tokens":1000000,"output_tokens":250000,"models":["gpt-4o-mini","claude-sonnet-4.5","deepseek-v3"]},"output_example":{"input_tokens":1000000,"output_tokens":250000,"token_source":"input_tokens","estimates":[{"model":"gpt-4o-mini","known":true,"input_per_1m":0.15,"output_per_1m":0.6,"input_cost_usd":0.15,"output_cost_usd":0.15,"total_cost_usd":0.3,"price_source":"table"},{"model":"claude-sonnet-4.5","known":true,"input_per_1m":3,"output_per_1m":15,"input_cost_usd":3,"output_cost_usd":3.75,"total_cost_usd":6.75,"price_source":"table"}],"cheapest_known":"gpt-4o-mini","price_table_as_of":"2026-06-01","note":"Prices are a list-price snapshot as of price_table_as_of; pass price_overrides for current or negotiated pricing."},"x402_payment_required":true,"x402_facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}