Back to guides
Compare·September 14, 2026·8 min read

OpenAI API alternative (2026) — the two different swaps, and which surfaces survive

Every roundup on this search answers "which model instead". The question that decides the migration is different: which OpenAI surfaces still work after you point your code somewhere else. Chat, streaming and tool calls travel on a base_url. Assistants, Realtime and embeddings do not.

Last reviewed on .

“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 September 14, 2026.

The three routes, and what each one costs you in code

RouteWhat changes in your codePick it when
A different vendor's own APINew SDK, new auth, new request shapesYou want one vendor's full surface, including the parts only they have
An OpenAI-compatible gatewaybase_url and the keyYou want several vendors' models without several accounts
A self-hosted OpenAI-compatible serverbase_url and the key, plus running the serverPrompt 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

swap.py
# 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-4-6",                # now reachable on the same key
    messages=[{"role": "user", "content": "Summarise this changelog."}],
    stream=True,
)

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 surfaceOn KunavoWhat it is / note
/v1/chat/completionsyesChat, streaming, tool calls — The one almost every migration is about.
/v1/responsesyesThe Responses API — Implemented — this is what Codex CLI speaks.
/v1/modelsyesList what you can call — Always the authority on availability.
/v1/images/generationsyesText to image
/v1/images/editsyesImage editing — Prompt-directed; no mask inpainting.
/v1/embeddingsroute onlyEmbeddings — Route exists, no model enabled — embed against OpenAI, Voyage or Cohere directly.
/v1/audio/speechroute onlyText to speech — Route exists, no model enabled.
/v1/audio/transcriptionsroute onlySpeech to text — Route exists, no model enabled.
/v1/filesyesUpload a source image — For image edits and image-to-video.
Assistants, Threads, Vector StoresnoOpenAI's hosted agent state — Not implemented. Keep that state in your own app.
RealtimenoRealtime voice sessions — Not implemented.
Batch, Fine-tuning, ModerationsnoNot 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 $1.20 in / $6.00 out per 1M tokens against Anthropic's $3.00 / $15.00, and GPT-5.6 Sol at $2.00 / $12.00 against OpenAI's $5.00 / $30.00. 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, the four kinds of LLM gateway, and the chat endpoint reference for the exact request and response shapes.

FAQ

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 genuinely 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 the free tiers some providers offer with hard daily caps. Treat an advertised unlimited free OpenAI-compatible API as a question about what it actually proxies and what it does with your prompts.

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 $1.20 in / $6.00 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.