Cost Tracking
Estimate Cost
Estimate cost for a given model and token counts.
This endpoint uses the same cost calculation logic as actual requests, including any configured margins and discounts.
Parameters:
- model: Model name (e.g., "gpt-4", "claude-3-opus")
- input_tokens: Expected input tokens per request
- output_tokens: Expected output tokens per request
- cache_read_input_tokens: Cache-read tokens per request, counted within input_tokens (optional)
- cache_creation_input_tokens: Cache-write tokens per request, counted within input_tokens (optional)
- reasoning_tokens: Reasoning tokens per request, counted within output_tokens (optional)
- num_requests_per_day: Number of requests per day (optional)
- num_requests_per_month: Number of requests per month (optional)
Returns cost breakdown including:
- Per-request costs (input, output, margin, plus the cache-read, cache-write and reasoning shares)
- Daily costs (if num_requests_per_day provided)
- Monthly costs (if num_requests_per_month provided)
Example:
{
"model": "gpt-4",
"input_tokens": 1000,
"cache_read_input_tokens": 800,
"output_tokens": 500,
"reasoning_tokens": 200,
"num_requests_per_day": 100,
"num_requests_per_month": 3000
}
post/cost/estimate
Request
- Base URL: https://apiclaw.biz (the document declares no server; this is the origin it was published from)
- URL: https://apiclaw.biz/cost/estimate
- Auth: API key in header x-litellm-api-key
Request body
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.