Estimate an LLM API bill
llm_cost_estimateRead-onlyIdempotent
Cost in US dollars of calling one model, from the tokens in and out per request and the number of requests, at today's price. Handles cached input tokens and the batch price where the model has one. Use llm_price_lookup first if you are unsure of the model id.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model id such as "openai/gpt-6.1-sol-pro", or an exact model name. | |
| requests | No | Number of requests. Default 1. | |
| input_tokens | Yes | Input tokens per request. | |
| output_tokens | Yes | Output tokens per request. | |
| use_batch_price | No | Use the batch price if the model has one. Default false. | |
| cached_input_tokens | No | How many of the input tokens are read from the prompt cache. Default 0. |