{"uid":"cap_Gze65DDBTNy-LFomADppo","slug":"strale-llm-cost-calculator-15bacdde","name":"Strale LLM Cost Calculator","description":"The trust layer for AI agents — 250+ independently tested data capabilities across 27 countries. Execute capabilities via REST, MCP, A2A, or x402 micropayments. Every call returns an audit record with cryptographic chain hashing.","url":"https://api.strale.io/x402/v2/llm-cost-calculate","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","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["model"],"properties":{"model":{"type":"string"},"prompt_text":{"type":"string"},"prompt_tokens":{"type":"integer"},"completion_text":{"type":"string"},"completion_tokens":{"type":"integer"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0216","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.0216/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0216","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0216","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_dPBF2-6Oa-ngXleAwtmlf","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0216","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculate the estimated cost of an LLM API call given a model name and token counts or raw text","exampleAgentPrompt":"How much would it cost to call gpt-4o with a 1200-token prompt and a 400-token completion?","exampleUseCases":[{"title":"Pre-flight cost check before LLM call","prompt":"Before I send this prompt to claude-3-5-sonnet, can you estimate how much it'll cost? The prompt is about 800 tokens and I'm expecting a completion around 300 tokens."},{"title":"Budget tracking for agent pipeline","prompt":"I'm running a pipeline that calls gpt-4-turbo with roughly 2000 prompt tokens and 500 completion tokens per request. What's the cost per call so I can estimate my monthly spend?"},{"title":"Compare model costs by token count","prompt":"What would it cost to run a 1500-token prompt with a 600-token response through gpt-3.5-turbo? I want to see if it's cheaper than the model I'm currently using."}],"resultDescription":"Returns an estimated cost in USD (or USDC) for the LLM API call, likely broken down by prompt tokens, completion tokens, and total cost, based on the specified model's pricing rates.","failureModes":["Unknown or unsupported model name returns an error or null cost","Missing required 'model' query parameter returns a 400 validation error","Non-integer token counts cause schema validation failure","Model pricing data may be stale if provider updates rates","Providing both text and token count may cause ambiguity or conflict"],"whenToPreferThis":"Use this endpoint when you need a quick, reliable cost estimate for an LLM call before executing it — especially useful in agent pipelines that need budget guardrails, cost logging, or spend forecasting. Prefer this over manual token counting or hand-rolled pricing tables when you want an up-to-date, auditable cost figure with a cryptographic audit record.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:42:56.999Z","isFirstParty":false}