Relay365Multi-model API relay desk
← All desk bulletins
Spend watchEN653 desk reads

Per-Million-Token Pricing: A Practical Walkthrough

#1 · Start with what a token measures

When you use a language model through an API, billing often depends on tokens rather than requests. A token is a unit of text processed by the model. It might be a word, part of a word, punctuation, or another text fragment.

There is no universal conversion from words to tokens. Language, formatting, code, and the model’s tokenizer all affect the count. For a reliable estimate, use a compatible tokenizer or inspect the usage information returned by the API.

#2 · Read “per million” as a unit price

A price quoted per million tokens is a rate, not necessarily a minimum purchase. If a service meters actual token usage, a request consuming a few thousand tokens costs the corresponding fraction of that million-token rate.

For example, 10,000 tokens represent 0.01 million tokens. At a hypothetical rate of $2 per million tokens, that quantity costs $0.02. Check the service’s billing terms for minimum charges, rounding, deposits, or other conditions that may affect your payment.

#3 · Separate input from output

Most text-model price tables distinguish between two categories:

  • Input tokens: content sent to the model, including instructions, the user’s message, conversation history, and supplied documents or tool results.
  • Output tokens: content generated by the model. Depending on the model and billing rules, this can include billable reasoning tokens as well as the visible response.

These categories often have different rates. Do not multiply the total token count by the input price alone. Also check whether cached input, long-context requests, or additional capabilities have separate pricing.

#4 · Calculate one request

Use this basic formula: request cost = (input tokens ÷ 1,000,000 × input rate) + (output tokens ÷ 1,000,000 × output rate).

Suppose a request uses 2,400 input tokens and 800 output tokens. For illustration only, assume an input rate of $1 per million tokens and an output rate of $4 per million tokens. These are hypothetical figures, not quoted prices for Relay365 or any named model.

  • Input cost: 2,400 ÷ 1,000,000 × $1 = $0.0024.
  • Output cost: 800 ÷ 1,000,000 × $4 = $0.0032.
  • Total request cost: $0.0056.

Under those same assumptions, 1,000 identical requests would cost $5.60, before any additional applicable charges.

#5 · Account for the whole workflow

A single user action can trigger several model calls. A coding assistant might inspect files, request tool execution, read results, and revise its answer. Each call can add billable usage.

Conversation history matters too: earlier messages may be included again in later requests. Caching can change the rate for eligible repeated input, but do not assume every repeated token receives a discount. Check the applicable cache rules and the usage reported for each call.

#6 · Compare models using realistic tasks

If you are considering Gemini 2.5 Flash and Claude Haiku 4.5, check their current input and output rates, then run the same representative tasks on both. Measure total cost alongside answer quality, latency, response length, and retry frequency.

A lower token rate does not automatically mean a cheaper completed task. A model that needs repeated corrections may consume more tokens overall. Start with a small test set drawn from your actual workload.

#7 · Choose access and set a budget

Relay365 is a practical option if you want pay-as-you-go access to multiple model families through one relay service. It works with Claude Code, Codex, Gemini CLI, and OpenAI SDK clients. Its API base is https://api.api365relay.com; OpenAI clients append /v1. Verify current model availability, rates, and billing terms before testing.

Create a Relay365 account if that setup fits your workflow, then begin with a small budget. Track usage by model, limit unnecessary context, cap output where appropriate, and configure spending alerts or limits where available. The useful number is not just the advertised token rate, but the measured cost of completing your task.

Further desk bulletins

Curious how it runs on your own code? Sign up →