Blog
What is an LLM gateway?
An LLM gateway is a service that accepts requests in one API format and forwards them to one or more model providers, taking on routing, retries, key management and billing so the application talks to a single endpoint.
What it actually does
| Job | Without a gateway | With one |
|---|---|---|
| Format | One SDK per vendor | OpenAI-compatible for all |
| Failover | Your retry code, per vendor | Several upstreams per model, retried before you see an error |
| Billing | One invoice and one payment method per vendor | One prepaid balance, per token |
| Model switching | New integration | A different model id in the same request |
What it is not
- Not a model. A gateway routes requests; it does not improve the weights.
- Not a guarantee of quality. If the underlying model is wrong for the task, routing will not save it.
- Not a replacement for vendor-only products. Fine-tuning, managed retrieval and org-level audit remain vendor features.
Why teams end up using one
- Payment. One balance that accepts the rails you actually have, instead of five vendor billing systems.
- Availability. A single provider outage becomes a retry, not an incident page.
- Comparison. Switching models is a string, so price/quality experiments stop being integration projects.
How TodAPI implements it
TodAPI is an OpenAI-compatible gateway at https://todapi.work/v1. One key covers Claude, GPT, Gemini, DeepSeek, GLM, Qwen and Kimi; billing is per token in USD from a prepaid balance with no subscription; and each model id keeps several upstreams so a failure is retried before it reaches the client. DeepSeek V4.1 Flash runs at $0.0252 / 1M input and $0.1008 / 1M output — 83% below DeepSeek's official list.
What to check before adopting one
- Does it expose the endpoints you actually use, not just chat completions?
- What happens to a streaming request when an upstream dies mid-answer?
- Are prices stated per 1M tokens, input and output separately?
- Can you export usage, and does the balance expire?
FAQ
Is a gateway faster or slower than calling a provider directly?
It adds one network hop. A well-placed gateway is typically within tens of milliseconds; the retry behaviour usually matters more than the hop.
Does a gateway see my prompts?
It must process them to forward the request. Whether it stores them is a policy question — ask explicitly. TodAPI does not store request or response content; see privacy.
Can I use one for a single provider?
Yes, and the migration is smaller — you still get unified billing and failover.