There are two kinds of OpenAI API alternative: another model vendor's own API, or an OpenAI-compatible endpoint that keeps your SDK and changes only base_url and the key. The list below gives 8 options — four model vendors, two gateways and two self-hosted servers — with the protocol, the models, how each bills and its documentation, checked on October 22, 2026. Kunavo is one of the gateways, and it is our product.
“Alternative to the OpenAI API” is two different swaps, and most roundups on this search answer only one of them. Swapping the model — to Claude, to Gemini, to open weights — changes providers, accounts, SDKs and billing. Swapping the endpoint changes a base_url and an API key and leaves your code alone, because the OpenAI wire format is the thing being copied. Pick which swap you are making first; a list of models cannot tell you what the migration costs.
The question the lists skip is the one that decides it: which OpenAI surfaces actually survive the move. This page answers that for Kunavo specifically, including the three rows where the answer is no. Bias declared: Kunavo is our product — an independent OpenAI-compatible gateway, not OpenAI and not Anthropic. Rates and availability last verified October 23, 2026.
8 OpenAI API alternatives, side by side
| Option | Kind | Protocol | How it bills |
|---|---|---|---|
| Anthropic Claude API | Model vendor | Native Messages API; an OpenAI SDK layer for testing | Per token |
| Google Gemini API | Model vendor | OpenAI compatibility endpoint, in beta | Per token, with a free tier |
| DeepSeek API | Model vendor | OpenAI and Anthropic formats | Per token, from a topped-up balance |
| xAI API | Model vendor | OpenAI SDK with xAI's base URL | Per token |
| OpenRouter | Gateway | OpenAI-compatible | Credits bought in advance |
| Kunavo (ours) | Gateway | OpenAI chat completions and Responses, Anthropic Messages | Per token, per image, per video or per second; no free tier |
| Ollama | Self-hosted server | OpenAI-compatible | Free software on your hardware |
| vLLM | Self-hosted server | OpenAI-compatible | Free software on your hardware |
Each entry below states only what the provider's own documentation said on October 22, 2026. The order is not a ranking, and no entry is a supplier of Kunavo's.
1. Anthropic Claude API
Anthropic's own API for the Claude models. The native interface is the Messages API. Anthropic also offers an OpenAI SDK compatibility layer at https://api.anthropic.com/v1/, which it describes as primarily for testing and comparing models rather than a long-term production solution; prompt caching is not supported on it. Billed per token at Anthropic's list prices. Documentation.
2. Google Gemini API
Google's API for the Gemini models, with an OpenAI compatibility endpoint at https://generativelanguage.googleapis.com/v1beta/openai/ that Google describes as beta. Google lists a free tier with free input and output tokens on some models, and a paid tier with higher rate limits. Documentation.
3. DeepSeek API
DeepSeek's API for its own models, in both the OpenAI and the Anthropic formats (https://api.deepseek.com and https://api.deepseek.com/anthropic). Usage is billed per token and deducted from a topped-up or granted balance. Documentation.
4. xAI API
xAI's API for the Grok models at https://api.x.ai/v1; its quick start uses the OpenAI SDK with xAI's base URL and key. Prices are per million tokens. Documentation.
5. OpenRouter
A gateway to hundreds of models from many vendors behind one OpenAI-compatible endpoint, https://openrouter.ai/api/v1. Its FAQ says credits are bought in advance with a fee on the purchase and no markup on inference, and that some models are free with low daily rate limits. Documentation.
6. Kunavo
Our product: an independent gateway with one key for Claude, GPT, image and video models, on the OpenAI chat completions and Responses formats and on Anthropic's Messages API, at https://api.kunavo.com/v1. Text models are billed per token, image models per image and video models per video or per second, at the rates on each model's page; there is no free tier. Which OpenAI surfaces survive the switch is in the table further down. Documentation.
7. Ollama
Runs open-weight models on your own machine and serves them on an OpenAI-compatible endpoint at http://localhost:11434/v1/: chat completions, completions, embeddings, models and a non-stateful Responses API. The SDK needs a key, which the local server ignores. The software is free; you pay for the hardware. Documentation.
8. vLLM
An open-source inference server: vllm serve with a model name exposes OpenAI-compatible Chat Completions, Responses and Embeddings routes, and audio transcription for speech models. Free software on your own GPUs. Documentation.
The three routes, and what each one costs you in code
| Route | What changes in your code | Pick it when |
|---|---|---|
| A different vendor's own API | New SDK, new auth, new request shapes | You want one vendor's full surface, including the parts only they have |
| An OpenAI-compatible gateway | base_url and the key | You want several vendors' models without several accounts |
| A self-hosted OpenAI-compatible server | base_url and the key, plus running the server | Prompt text cannot leave your infrastructure |
A provider's own compatibility endpoint is a fourth, narrower option: Google publishes an OpenAI-compatibility layer for the Gemini API, which is the same base_url move confined to one vendor's models.
Swapping the endpoint, in full
# The whole migration, when you swap the endpoint rather than the model.
from openai import OpenAI
client = OpenAI(
api_key="sk-kn-...", # was sk-proj-...
base_url="https://api.kunavo.com/v1", # the only other line that moves
)
# Same SDK, same call shape, same streaming, same tool-call format.
resp = client.chat.completions.create(
model="claude-sonnet-5", # now reachable on the same key
messages=[{"role": "user", "content": "Summarise this changelog."}],
stream=True,
)The full walk-through, from creating a key to the first request, is the quickstart.
Which OpenAI surfaces survive the swap
Read the middle column before migrating. “Route only” means the wire format is implemented and no model is enabled behind it, so the call fails — that is a worse surprise than an unimplemented route, and it is why the row exists rather than being quietly omitted.
| OpenAI surface | On Kunavo | What it is / note |
|---|---|---|
/v1/chat/completions | yes | Chat, streaming, tool calls — The one almost every migration is about. |
/v1/responses | yes | The Responses API — Implemented — this is what Codex CLI speaks. |
/v1/models | yes | List what you can call — Always the authority on availability. |
/v1/images/generations | yes | Text to image |
/v1/images/edits | yes | Image editing — Prompt-directed; no mask inpainting. |
/v1/embeddings | route only | Embeddings — Route exists, no model enabled — embed against OpenAI, Voyage or Cohere directly. |
/v1/audio/speech | route only | Text to speech — Route exists, no model enabled. |
/v1/audio/transcriptions | route only | Speech to text — Route exists, no model enabled. |
/v1/files | yes | Upload a source image — For image edits and image-to-video. |
Assistants, Threads, Vector Stores | no | OpenAI's hosted agent state — Not implemented. Keep that state in your own app. |
Realtime | no | Realtime voice sessions — Not implemented. |
Batch, Fine-tuning, Moderations | no | Not implemented. |
The 3 “route only” rows are the ones to plan around. A RAG pipeline is the common case: embed against an embedding provider directly, generate against the gateway. The two are separate HTTP calls either way, so the cost is a second key rather than a second architecture. GET /v1/models is always the authority on what is callable today.
What the swap costs per token
Comparing like for like on Kunavo as of September 2026: Claude Sonnet 4.6 at $2.10 in / $10.50 out per 1M tokens against Anthropic's $3.00 / $15.00, and GPT-5.6 Sol at $2.00 / $12.00 against the promotional $4.00 / $20.00 OpenAI is charging now (list $5.00 / $30.00; the promotion runs at least through November 21, 2026). Check OpenAI's side on their pricing page rather than taking ours for it. The lever that usually moves a bill more than the vendor choice is prompt caching: an agent re-sends a large system prompt every turn, so uncached input dominates.
What Kunavo is not
Not OpenAI, and not a way to get OpenAI's hosted agent infrastructure somewhere cheaper — Assistants, Threads, Vector Stores, Realtime, Batch, fine-tuning and moderations are not implemented, and an app built on those is not a base_url away from moving. Not open-weight hosting either: if the answer you want is Llama or Qwen on your own hardware, a self-hosted OpenAI-compatible server is the route and this is not it. And not an embeddings provider, per the table above.
For the neighbouring comparisons: OpenRouter alternatives, LiteLLM alternatives for a proxy you run yourself over your own provider keys, the four kinds of LLM gateway, and the chat endpoint reference for the exact request and response shapes.
Frequently asked questions
What are the best alternatives to the OpenAI API?
It depends which swap you are making, and the roundups on this search mostly answer one of two. If you want a different model, the shortlist is Anthropic's Claude, Google's Gemini and the open-weight families served by inference providers. If you want to keep your OpenAI code and change where it points, the shortlist is a different shape: an OpenAI-compatible gateway such as Kunavo or OpenRouter, a provider's own compatibility endpoint such as Google's, or a self-hosted OpenAI-compatible server such as Ollama or vLLM. The second kind of move costs a base_url and a key; the first can cost an SDK migration.
Is there a free alternative to the OpenAI API?
Not for production traffic from a hosted provider — inference is real GPU time and nobody serves it uncapped for free. The free routes are self-hosting open weights on hardware you already pay for (Ollama and vLLM both expose an OpenAI-compatible endpoint, so the code change is the same base_url swap), and free tiers with hard limits: Google lists one for the Gemini API, and OpenRouter has free models with low daily rate limits. Kunavo has no free tier; every request is billed per token. Treat an advertised unlimited free OpenAI-compatible API as a question about what it actually proxies and what it does with your prompts.
Which OpenAI API alternative has Claude?
Anthropic's own API, and gateways that carry the Claude models, Kunavo among them. Anthropic also has an OpenAI SDK compatibility layer, but it describes that layer as mainly for testing and comparing models and it does not support prompt caching; for production Anthropic points to its native Messages API. On Kunavo the Claude models sit on the same key as GPT, through the OpenAI chat completions format or Anthropic's Messages API.
Which API is cheaper, OpenAI or Anthropic?
Neither is uniformly cheaper — it depends on the tier you use and on how much of your input repeats. Comparing like for like on Kunavo as of September 2026: Claude Sonnet 4.6 is $2.10 in / $10.50 out per 1M tokens and GPT-5.6 Sol is $2.00 / $12.00. The lever that usually moves a bill more than the vendor choice is prompt caching, because an agent re-sends a large system prompt every turn, and cached input is billed at a fraction of fresh input on both families.
Can I switch off the OpenAI API without changing my code?
Mostly, and the exceptions are what this page's compatibility table is for. If your app uses chat completions, streaming, tool calls and the Responses API, an OpenAI-compatible gateway is a base_url and an API key — the SDK, the request shapes and the response shapes stay. What does not travel is OpenAI's hosted agent state (Assistants, Threads, Vector Stores), the Realtime API, Batch, fine-tuning and moderations, none of which Kunavo implements. Check the specific surfaces your code calls before assuming a drop-in.
Does an OpenAI-compatible gateway support embeddings?
Not automatically, and it is the surface most likely to be missing — check before you migrate rather than after. On Kunavo specifically, /v1/embeddings is an implemented wire format with no model enabled behind it, so the call fails and the embedding step of a RAG pipeline has to go to OpenAI, Voyage or Cohere directly. That costs a second API key and nothing else, because the embedding call and the generation call are separate requests either way. GET /v1/models is always the authority on what is actually callable.
Is an OpenAI-compatible API the same thing as OpenAI?
No. An OpenAI-compatible API copies the wire format — the URL shapes, the request bodies, the response bodies — so your existing client can talk to it. It is not run by OpenAI, it does not necessarily serve OpenAI's models, and it makes its own decisions about data retention, rate limits and which surfaces to implement. Kunavo is an independent gateway, not OpenAI and not Anthropic, which is exactly why the table above lists what does not work as well as what does.