Log in·Sign up
BestRelay

Back to the Journal

Small Token Choices Shape Your API Bill

Your bill starts with two different meters

An AI API bill usually starts with two measurements: the tokens you send and the tokens the model generates. These are input tokens and output tokens. They often carry different prices, so a request's cost depends on more than its total size. A short question followed by a long answer can cost more than a longer question followed by a brief reply.

A token is a small unit of text, not necessarily a word. It might represent a whole word, part of one, or punctuation. The relationship changes across languages, writing styles, and tokenizers. Word counts can help you estimate size, but the provider's reported token usage is the better basis for billing.

Input charges cover more than your question

Input can include your question, application instructions, earlier messages, retrieved documents, and tool results. In a chat application, the latest message may be only a small part of the material sent to the model. If the application resends conversation history with every turn, that history can contribute to input usage repeatedly.

Imagine asking for a two-sentence answer about a lengthy report. The response is small, but processing the report still requires input tokens. Sending only relevant sections can reduce that expense, provided those sections preserve the evidence needed for an accurate answer. Removing useful context merely to shrink the request can create expensive mistakes or retries.

Output length can change the price sharply

Output tokens cover generated material. Many models price them higher than ordinary input tokens, although the difference varies. A request for a detailed report therefore has a different cost profile from a request for a label or a short explanation. Depending on the model, billable output usage can also include reasoning tokens that are not displayed as ordinary answer text.

Consider a purely illustrative rate of two dollars per million input tokens and eight dollars per million output tokens. A request using 10,000 input tokens and 1,000 output tokens would cost two cents for input and 0.8 cents for output, totaling 2.8 cents. These are example rates, not a quotation for any offered model.

Cache pricing creates a separate accounting category

Some providers support prompt caching, allowing eligible repeated input to receive different pricing. A cache write establishes reusable material; a cache read uses eligible material already stored. Their prices, availability, retention periods, and matching requirements vary. Repeating the same words does not automatically guarantee a cache hit.

For applications with stable instructions or recurring reference material, caching can reduce repeated processing costs. Nevertheless, cache reads and writes belong on separate lines in your estimate. A write can have a different rate from ordinary input, and savings depend on subsequent reuse. Check the provider's usage categories rather than assuming every input token receives one price.

Routing and usage records make spending understandable

BestRelay publishes this guide as a quality-first API relay. It forwards each request to the official model named in that request, without substitution, across families including Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, and Grok. Keeping model identity consistent makes cost comparisons meaningful: a cheaper response from a substituted model is not an equivalent service.

BestRelay works with Claude Code, Codex, Gemini CLI, and any OpenAI SDK. Its billing is pay-as-you-go, based on token counts reported by the provider, with cache reads and writes priced separately. Members also earn a referral commission when people they invite top up; that reward is separate from the token categories used to calculate request charges.

Useful answers matter more than minimal tokens

Start with a clear task, include relevant context, and specify an appropriate response length. Then inspect actual usage across representative requests. Compare cost per successful task, not just cost per call: a tiny answer that requires three follow-up attempts may be less economical than one complete response.

Create a BestRelay account to explore usage-based billing. As you evaluate spending, keep three questions separate: the material sent, the material generated, and any cache activity. Those distinctions turn an unfamiliar token bill into an understandable record of work.

Want to try the models discussed here? Sign up