LLM Token & API Cost Estimator
Estimate token count from text (or pass exact counts) and compute API cost at per-million prices.
A free key adds 10,000 calls a month, no card: /pricing, which also says whether the calculators are free or priced right now.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | optional | Text to estimate input tokens from (~4 chars/token) |
input_tokens | integer | optional | Exact input token count (overrides text estimate) |
output_tokens | integer | optional | Output token count |
price_per_1m_input | number | optional | USD price per 1,000,000 input tokens |
price_per_1m_output | number | optional | USD price per 1,000,000 output tokens (defaults to input price) |
calls | integer | optional | Number of identical calls to total (default 1) |
Call it over MCP (JSON-RPC 2.0)
curl -s https://agent.wingmanprotocol.com/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "token_cost", "arguments": {"text": "hello from an agent", "input_tokens": 10, "output_tokens": 10}}}'Or plain HTTP
curl -s https://wingmanprotocol.com/tools/token_cost \
-H 'Content-Type: application/json' \
-d '{"text": "hello from an agent", "input_tokens": 10, "output_tokens": 10}'Try it live
Edit the JSON and run it — this POSTs to https://wingmanprotocol.com/tools/token_cost from your browser.
This call needs a key or credits. The 402 response below says what it accepts. A free key adds 10,000 calls a month, no card, no crypto: get one at /pricing, which also has the current prices.
Related tools in Developer
developer
ANSI Escape Sequence Stripper
Remove ECMA-48 CSI (color/cursor) and OSC (hyperlink/title) terminal escape sequences from text, returning the…
developer
Number Base Converter
Convert an integer between bases 2-36, with binary/octal/decimal/hex forms.
developer
Bitwise Operations
AND, OR, XOR, NOT, shift, and popcount on integers with configurable bit width.
developer
Business-Day Calculator
Count workdays between two dates, or add N business days to a date — skipping weekends and holidays.
developer
Card Brand Detector
Luhn-validate a card number and detect its network brand (Visa/Mastercard/Amex/Discover/Diners/JCB/UnionPay) from IIN…
developer
Checksum Validator
Validate or compute check digits for IBAN, ISBN-10, and ISBN-13 identifiers.