The problem it solves
Each model maker has its own account, billing, keys, rate limits, SDK and request format. A product that uses one model from each of three companies has three of everything. Trying a fourth means another sign-up, another payment method and another integration.
A unified AI API puts one interface in front of all of them. You get one base URL, one API key and one bill, and you choose the model by changing a name in the request. Nothing else in your code moves.
How it works
A unified API is a service that accepts requests in a standard format, works out which provider serves the model you named, forwards the request with its own credentials, and returns the answer in the same standard format. Along the way it records the tokens used and charges your balance.
from openai import OpenAI
client = OpenAI(base_url="https://cheaptokens.pw/v1", api_key="YOUR_API_KEY")
for model in ["gpt-6-luna", "claude-haiku-5-5", "deepseek-v4-pro"]:
reply = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Summarise this in one line: ..."}],
)
print(model, "→", reply.choices[0].message.content)The loop above talks to three different companies' models. The only thing that changes between them is the model name.
Which formats matter
"Unified" usually means "OpenAI-compatible", because that format is what most tools already speak. In practice three formats cover nearly everything:
| Format | Used by | Notes |
|---|---|---|
| OpenAI Chat Completions | Most SDKs, editors and agents | The common denominator. Works with every text model. |
| OpenAI Responses | Codex and newer OpenAI tools | Required by some tools that no longer speak Chat Completions. |
| Claude Messages | Claude Code and Anthropic SDKs | The native format for Claude tools. |
A unified API that offers all three lets each tool use the format it was built for, on the same key. CheapTokens does this; the docs list which models support which format.
What you gain
- Freedom to change models. When a better or cheaper model appears, you change a setting, not an integration.
- The right model for each job. A small model for classification, a large one for hard reasoning, an image model for pictures, all on one key.
- One balance and one history. Every request, whatever the model, is in the same list with its tokens and cost.
- Less to secure. One credential to store and rotate instead of several.
- Easy comparison. Running the same prompts across models takes a loop, as above.
- Often a lower price. Services that buy capacity in volume can sell below list price.
What it can't hide
One format does not make all models the same. These differences remain, and your app should expect them:
- Context size. Models accept different amounts of input. A prompt that fits one may be rejected by another.
- Tool calling. Quality varies a great deal. Test it for each model an agent will use.
- Images and files. Not every model can read them.
- Reasoning. Some models think before answering and bill those tokens as output.
- Behaviour. The same prompt gets different answers. Prompts tuned for one model often need adjusting for another.
- Parameters. Options such as JSON mode or temperature ranges may be ignored or refused by some models.
The tradeoffs
A unified API is an extra party between you and the model. That has real costs, and it is better to weigh them than to ignore them:
- Dependency. If the unified API is down, all your models are down. Keep a direct key as a fallback for anything critical.
- Latency. One more hop adds a little time, usually small next to the time the model takes to answer.
- New features. A brand-new option from a model maker may take a while to be supported.
- Data. Your requests pass through one more company. Read what it stores. CheapTokens keeps usage records such as token counts and cost, not the content of your prompts or replies.
Designing your app for it
- Keep the base URL, key and model name in configuration. Never in code.
- Wrap model calls in one function. Everything else in your app calls that function, so a change of model or provider happens in one place.
- Choose models by task. Name the tasks ("classify", "draft", "review") and map each to a model in configuration.
- Keep a small test set. Twenty to fifty real prompts with known good answers. Run it whenever you change a model.
- Handle errors by type. Retry rate limits and outages with a delay; never retry an invalid request.
- Record cost per task. Usage comes back with every response. Log it next to the feature that caused it.
Is it right for you?
A unified API suits you if you use, or want to try, more than one model; if you want one bill and one key; or if you want a lower price than list. It suits you less if you depend on a provider's newest experimental features the day they launch, or if a contract requires your data to go to one named provider only.
To try it, create a CheapTokens account, pick models on the models page, and use the setup wizard to connect your tools.
Create a CheapTokens account ↗