Prompt Cost Calculator

Estimate LLM API cost from token count

API executable

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

POST
/api/v1/execute/prompt-cost

Authenticate with X-API-Key or Authorization: Bearer. See Authentication.

API reference

Path, header, and body fields accepted by this execute call.

NameInTypeRequiredDescription
tool
path
stringYes

Tool identifier used in the execute path.

Example: prompt-cost

X-API-Key
header
stringYes

Your IT-ToolBox API key. Authorization: Bearer is also accepted.

Example: YOUR_API_KEY

Content-Type
header
stringYes

Must be application/json for execute requests.

Example: application/json

input.input_price_per_m
body
numberYes

Argument for Prompt Cost Calculator.

Example: 5

input.input_tokens
body
numberYes

Argument for Prompt Cost Calculator.

Example: 1000

input.output_price_per_m
body
numberYes

Argument for Prompt Cost Calculator.

Example: 15

input.output_tokens
body
numberYes

Argument for Prompt Cost Calculator.

Example: 500

Code examples

shell
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

Back to tools catalog