Jump straight to the numbers

← All articles

4,812 Tokens: A $0.0144 Input Receipt

01 / A count is not a charge

Anthropic’s count_tokens endpoint tells you how many input tokens a request would use, before you send it to a message-generation endpoint. That makes it useful for budgeting, checking prompt changes, and spotting unexpectedly large context. The count itself is not a model response, and the endpoint does not return generated output tokens.

For a concrete example, suppose you are preparing a request for Claude Haiku 4.5 and the endpoint reports 4,812 input tokens. That number is an input estimate for the submitted request. It is not a promise that every provider or model will count the same text identically, nor does it include the tokens the model may generate later.

02 / The receipt for 4,812 input tokens

Anthropic’s published standard input rate for Claude Haiku 4.5 is $1 per million input tokens. Using that rate, the arithmetic is:

  • ■ Input counted: 4,812 tokens
  • ■ Rate used: $1 per 1,000,000 input tokens
  • ■ Calculation: 4,812 ÷ 1,000,000 × $1
  • ■ Estimated uncached input cost: $0.004812

That is about half a cent for the input. It is not the full request receipt: output tokens are billed separately, and caching can change the input charges. For example, if the response contains 1,000 output tokens, add the applicable output rate for those tokens. Do not multiply the input count by an output price or treat this estimate as a fixed quote.

Prices depend on the model and billing route. The calculation above uses Anthropic’s stated standard input rate as an example; it does not assert that CheapRelay charges that rate. Check the current rate for the exact model and route you use before estimating spend.

03 / Count the request you will actually send

Send the same model and request content you plan to use for generation. Include the system prompt, messages, tool definitions, and other supported request fields that contribute to the input. If you count only the latest user message, the result will understate a conversation that also sends earlier turns or a long system prompt.

The endpoint accepts a message-style request and returns an input_tokens value. Keep the request structure consistent between counting and generation. After changing a tool schema, adding retrieved documents, or trimming conversation history, count again: even small edits can shift the total.

A count is an estimate for input planning, not a substitute for checking the usage reported after a real request. Generation adds output usage, while cached input may be billed differently. For a cost ledger, record the model, counted input, actual output, cache usage where available, and the rate applied to each category.

04 / Use the number before you send

Counting is most valuable when a prompt is large or repeated. A 4,812-token request at the example rate is less than one cent for uncached input, but sending it 10,000 times would make that input line about $48.12 before output charges. The per-request amount is small; repetition is what makes the receipt matter.

CheapRelay offers pay-as-you-go API access through one key, with OpenAI-compatible routes under /v1 and Gemini’s native API under /v1beta. Its billing is per real token, including cache reads and writes, with no subscription or monthly fee. That makes it especially important to check the rate and usage categories for the route you select. Sign up for CheapRelay if you want to route supported model requests through one account and track usage against your own workload.

Sign up Try the prices yourself, sign-up credit included.

More reading

DateAisleWritten inTitle
2026-10-26Spend lessEN$30 a Month for AI: An Indie Hacker’s Receipt
A $30 monthly AI budget with token math, cache allowances, retry limits, and practical spending controls for solo builders.
2026-10-26Spend lessEN$3.45 for 95 accepted answers beats cheap tokens
A worked receipt shows why token prices can mislead: count retries, rejected outputs and cache charges before ranking models.
2026-10-26Spend lessENThe $0.004 AI Task With a $0.0566 Agent Receipt
A hypothetical agent receipt shows how context, retries, evaluation and logging turn a $0.004 task into $0.0566 per accepted result.
2026-10-26Spend lessEN$2.53 for 10,000 JSON Jobs: Read the Receipt
A worked JSON-output budget: token costs, schema overhead, retries, and the checks that keep cheap API calls from becoming expensive workflows.
2026-10-26Spend lessEN$0.012 Either Way: Streaming Changes the Habit
A token-by-token receipt shows why streaming has no automatic discount, but stopping early and avoiding retries can change your API bill.
2026-10-26Spend lessEN$1.71 to $1.02: A Long-Chat Summarisation Receipt
A worked token receipt shows when summarising chat history saves money, including the summary fee, break-even point and caching caveats.