HALOWERK: Estimate token use and price for a prompt across several models before you spend
cost_estimateCalculate prompt costs across multiple AI models before spending. Input text or token count and expected output length to get per-model pricing, including cache and batch discounts.
Instructions
Estimate token use and price for a prompt across several models before you spend anything, including cache and batch discounts.
Kostenpflichtig: 0.002 USDC je Aufruf. Bezahlt per x402 auf Base, ohne Konto. Hoechstens 0.002 USDC je Aufruf.
Works out what a call would cost. Give either the text itself or a token count, plus the expected output length, and get input, output, cache-read and cache-write cost per model with the total. Token counts derived from text are estimates from character and word statistics, not a tokeniser, and typically land within about 15 percent — where an exact count matters, count with the vendor tokeniser. Prices come from a table with a stated date; a model whose price has moved since is reported with its table date, so an old figure is visible rather than silently wrong. Unknown model names are refused with the closest matches rather than guessed. Preis 0.002 USDC je Aufruf, Abrechnung über x402.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | The prompt text. Either this or input_tokens. | |
| batch | No | Apply the batch discount where the model has one. | |
| calls | No | Number of identical calls to multiply by. | |
| models | No | Model ids to price. All known models if omitted. | |
| input_tokens | No | Known input token count. Either this or text. | |
| output_tokens | No | Expected output length in tokens. | |
| cached_input_tokens | No | Of the input tokens, how many are served from cache. |