Prompt Cost Calculator
Estimate LLM API cost from token count
Overview
ID: prompt-cost
Category: developer
Call this tool over HTTP with POST /execute/prompt-cost. Path, headers, body fields, sample responses, and errors are documented below.
Endpoint
/api/v1/execute/prompt-costAuthenticate with X-API-Key or Authorization: Bearer. See Authentication.
API reference
Path, header, and body fields accepted by this execute call.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| tool | path | string | Yes | Tool identifier used in the execute path. Example: prompt-cost |
| X-API-Key | header | string | Yes | Your IT-ToolBox API key. Authorization: Bearer is also accepted. Example: YOUR_API_KEY |
| Content-Type | header | string | Yes | Must be application/json for execute requests. Example: application/json |
| input.input_price_per_m | body | number | Yes | Argument for Prompt Cost Calculator. Example: 5 |
| input.input_tokens | body | number | Yes | Argument for Prompt Cost Calculator. Example: 1000 |
| input.output_price_per_m | body | number | Yes | Argument for Prompt Cost Calculator. Example: 15 |
| input.output_tokens | body | number | Yes | Argument for Prompt Cost Calculator. Example: 500 |
Code examples
curl -X POST /api/v1/execute/prompt-cost \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"input_price_per_m": 5,
"input_tokens": 1000,
"output_price_per_m": 15,
"output_tokens": 500
}
}'Tool UI
Open the interactive experience to try the tool without writing HTTP clients.
Open tool UI