TL;DR: The starring OpenAI-compatible conclusion APIs successful 2026 are, successful alphabetical order, DigitalOcean (Serverless Inference), Fireworks AI, Groq, Nebius Token Factory, OpenRouter, and Together AI. All six activity pinch the charismatic OpenAI SDKs aft changing only the guidelines URL and API key, and each complaint per token pinch published rates. The existent differences are successful which models they offer, really accelerated they run, and really overmuch of OpenAI’s API they support, particularly astir instrumentality calling, streaming, and embeddings.
What “OpenAI-compatible” really means
An conclusion API is OpenAI-compatible erstwhile it accepts the aforesaid requests and returns the aforesaid responses arsenic OpenAI’s API. In practice, that intends 3 things: it uses the aforesaid petition and consequence format arsenic OpenAI’s /v1/chat/completions endpoint (and ideally /v1/embeddings and /v1/models too), it handles authentication the aforesaid measurement (an API cardinal sent arsenic a bearer token successful the Authorization header), and arsenic a consequence the charismatic OpenAI SDKs activity against it without immoderate changes, you conscionable constituent them astatine a different server. Switching intends changing 2 values:
client = OpenAI( base_url="https://<provider-endpoint>/v1/", # changed api_key=os.getenv("PROVIDER_API_KEY"), # changed ) # everything other stays the sameThat’s the promise. In reality, nary supplier is 100% compatible. Some support much of OpenAI’s API than others, and the gaps usually show up successful separator cases, not successful basal requests. Three areas break astir often successful production:
Tool calling useful otherwise crossed providers. Tool calling (also called usability calling) is the characteristic wherever you picture your application’s functions to the exemplary arsenic JSON schemas, and the exemplary responds pinch “call this usability pinch these arguments” alternatively of plain text. It’s the system that powers agents. It’s besides the newest and astir analyzable portion of the OpenAI API, which makes it the portion providers transcript slightest consistently: OpenAI keeps changing it (strict structured-output mode, parallel instrumentality calls, really arguments watercourse chunk by chunk), and each provider’s transcript reflects a different constituent successful time. A actual example: your supplier model sets strict: existent successful a instrumentality definition, which connected OpenAI guarantees the model’s arguments precisely lucifer your schema. A supplier that silently ignores that emblem returns arguments pinch a missing aliases mistyped field. The petition doesn’t error, but your codification crashes erstwhile it tries to usage the result. If you tally agents, this is the first point to test.
Streaming responses don’t behave identically. Streaming is really chat apps show matter appearing connection by word: alternatively of waiting for the afloat answer, the server sends it successful mini chunks complete 1 relationship (a format called server-sent events). All providers usage the aforesaid basal chunk format, but the specifications astir the edges differ.
Three examples. OpenAI historically didn’t see token counts (usage stats) successful a streamed consequence unless you asked for them pinch stream_options={"include_usage": true}, while immoderate providers ever nonstop them, other information your codification whitethorn not expect. If you group a extremity series (a drawstring that tells the exemplary wherever to stop, for illustration "###"), immoderate providers see that drawstring astatine the extremity of the returned matter while OpenAI cuts it off, truthful your output has trailing characters you didn’t want. And OpenAI now has a newer endpoint called the Responses API alongside the original Chat Completions endpoint; support for it varies (some providers connection both, others only Chat Completions), truthful if your codification is written against Responses, cheque earlier assuming it will work.
Not each endpoint and parameter exists everywhere. OpenAI’s API is much than chat: location are abstracted endpoints for embeddings (turning matter into vectors for search), batch processing (submitting galore requests astatine erstwhile astatine a discount), and audio (speech-to-text and text-to-speech). Every supplier covers chat; sum of the remainder varies, truthful cheque each endpoint you use. Embeddings merit a person look: astir providers connection them, but pinch different models, and not each support the dimensions parameter for mounting vector size. If embeddings are portion of your move, cheque the circumstantial exemplary and parameters separately from chat.
The aforesaid applies to individual petition parameters. Three that commonly fail: logprobs (returns probability scores for each generated token), logit_bias (makes circumstantial tokens, connection pieces identified by ID, much aliases little apt to appear), and n greater than 1 (asks for aggregate answers to 1 prompt). When a supplier doesn’t support a parameter, it fails successful 1 of 2 ways: immoderate cull the petition pinch a 400 correction (Groq does this, which astatine slightest tells you immediately), others judge the petition and silently disregard the parameter, which is worse because your codification runs but doesn’t do what you think.
A elemental norm of thumb: if your exertion only sends chat requests pinch modular settings (temperature, max tokens) and doesn’t stream, each supplier beneath is simply a existent drop-in. Each other characteristic you dangle connected (streaming instrumentality calls, guaranteed JSON output, embeddings, probability scores) shrinks the database of providers that will activity without changes.
How the providers are compared
Every supplier beneath is judged connected the aforesaid six things, listed successful the bid that astir often decides a switch:
- How compatible it really is: really overmuch of OpenAI’s API the supplier supports, and whether it intelligibly documents what it doesn’t. A supplier that publishes its gaps is safer than 1 that claims afloat compatibility.
- Speed: 2 numbers matter: really agelong earlier the first portion of the reply appears (time to first token, aliases TTFT) and really accelerated the remainder of the reply arrives (tokens per second, aliases TPS). Test these yourself pinch your ain prompts, since published numbers alteration by model, region, and really engaged the servers are.
- Clear pricing: does the supplier people its per-token prices connected a nationalist page, aliases do you person to talk to sales? Are location other fees connected apical of the token price?
- Which models you tin use: immoderate providers only service unfastened models (like Llama aliases GPT-OSS, which anyone tin download and host); others besides resell closed models (GPT, Claude, Gemini, which only their owners serve).
- How overmuch activity the move takes: is it genuinely conscionable changing the server reside and API key, aliases will you request to alteration your codification too?
- Room to grow: really galore requests you tin nonstop per infinitesimal connected the default plan, and what the supplier offers erstwhile you request much (dedicated capacity, reserved throughput, endeavor tiers).
Comparison table
Providers are listed alphabetically. Pricing comes from each provider’s charismatic pricing page, checked successful July 2026, utilizing the aforesaid 2 models crossed providers truthful the numbers tin beryllium compared directly: GPT-OSS-120B and Llama 3.3 70B. Speed and latency figures are median measurements from Artificial Analysis’ GPT-OSS-120B supplier benchmark (10K-token input) wherever available; Nebius pricing and velocity figures are arsenic listed successful its Token Factory console (July 2026). Prices and capacity alteration often, truthful cheque the linked sources earlier you commit.
| DigitalOcean AI Platform | Open + closed (OpenAI, Anthropic, Meta, Mistral, DeepSeek) | GPT-OSS-120B: $0.10 / $0.70; Llama 3.3 70B: $0.65 / $0.65 | 230 t/s, 0.96s TTFT connected DeepSeek V3.2 astatine 10K input (Artificial Analysis; DO is not successful AA’s GPT-OSS-120B panel) | Speech-to-text not among listed endpoints; video and fal models usage DO-specific async endpoints |
| Fireworks AI | Open only | GPT-OSS-120B: $0.15 / $0.60 (Standard), $0.18 / $0.72 (Priority); Llama 3.3 70B: $0.90 (size-based tier) | 651.8 t/s, 5.14s clip to first reply token (Artificial Analysis) | Documented differences: max_tokens is adjusted down alternatively of erroring (configurable); usage stats returned successful streams |
| Groq | Open only, connected LPU (Language Processing Unit) hardware | GPT-OSS-120B: $0.15 / $0.60; Llama 3.3 70B Versatile: $0.59 / $0.79 | 482.1 t/s, 4.91s clip to first reply token (Artificial Analysis) | logprobs, logit_bias, top_logprobs, messages[].name return 400; n must adjacent 1 |
| Nebius Token Factory | Open (60+ models) | GPT-OSS-120B: $0.15 / $0.60; Llama 3.3 70B Instruct: $0.13 / $0.40 (Token Factory console) | 40 t/s connected GPT-OSS-120B, 25 t/s connected Llama 3.3 70B (Token Factory console); Base and Fast flavors; 99.9% SLA dedicated endpoints | Accepts vLLM-specific settings beyond OpenAI’s API; nary closed models |
| OpenRouter | Router, not a host: 300+ unfastened + closed models from different providers | Provider pass-through + 5.5% in installments acquisition fee | Depends connected the routed provider | Latency and nonstop behaviour alteration by underlying supplier per request; 5% BYOK interest past 1M req/mo |
| Together AI | Open matter models (200+ full incl. image/video/audio) | GPT-OSS-120B: $0.15 / $0.60; Llama 3.3 70B: $1.04 | 581.6 t/s, 3.96s clip to first reply token (Artificial Analysis) | No closed frontier matter models (GPT/Claude-class); JSON mode and instrumentality calling supported per model, not catalog-wide |
A statement connected the latency figures: GPT-OSS-120B is simply a reasoning model, truthful Artificial Analysis’ “time to first reply token” includes the model’s reasoning clip earlier the reply begins, which is why the figures are successful full seconds alternatively than milliseconds. DigitalOcean’s fig is besides an Artificial Analysis measurement, but connected a different exemplary (DeepSeek V3.2, aforesaid 10K-token input) because DO is not among the providers successful AA’s GPT-OSS-120B panel; dainty it arsenic a unsmooth comparison, not an nonstop one.
Two things guidelines retired from the table. First, nary supplier is 100% drop-in: everyone differs from OpenAI’s API successful immoderate way, and providers that archive those differences openly are easier to move to than ones wherever you observe gaps successful production.
Second, prices for the aforesaid unfastened exemplary are adjacent crossed providers, and unfastened models costs acold little than the large closed models (Llama 3.3 70B runs $0.13 to $1.04 per cardinal input tokens crossed these providers); successful practice, the bigger differences thin to beryllium which models a supplier offers and really overmuch of OpenAI’s API it supports. For closed models resold done a compatible endpoint, pricing usually stays adjacent to the exemplary owner’s rates, truthful the main use location is having everything down 1 endpoint alternatively than redeeming money.
Provider details
Providers look successful the aforesaid alphabetical bid arsenic the table.
DigitalOcean Inference Engine (Serverless Inference)
DigitalOcean’s Serverless Inference gives you a azygous OpenAI-compatible endpoint (https://inference.do-ai.run/v1/) that serves some open-weight models (Llama, Mistral, DeepSeek, GPT-OSS) and closed models from OpenAI and Anthropic, making it 1 of the fewer providers wherever a base-URL switch gets you Claude and GPT-class models alongside unfastened ones, per DigitalOcean’s documentation.
Every exemplary has a per-token complaint listed connected DO’s pricing page, and for commercialized models, those rates lucifer what the model’s proprietor charges directly: GPT-OSS-120B runs $0.10/$0.70 per cardinal input/output tokens, Llama 3.3 70B is $0.65 flat, and closed models are billed astatine the exemplary owner’s rates. On speed, Artificial Analysis measured DigitalOcean astatine 230 tokens per 2nd and 0.96s clip to first token connected DeepSeek V3.2 pinch 10K-token inputs, the apical output velocity among the 12 providers tested connected that model, arsenic reported successful DO’s engineering blog pinch charts originated to Artificial Analysis’ DeepSeek V3.2 benchmark. It besides covers much endpoints than most, per DO’s API endpoints documentation: Chat Completions, the newer Responses API, embeddings, image generation, and text-to-speech each activity arsenic OpenAI-style endpoints, positive an Anthropic-compatible /v1/messages endpoint for Claude Code and akin supplier tools. The OpenAI Python SDK, LangChain, and LlamaIndex activity without changes. Two gaps to note: speech-to-text (transcription) is not among the listed endpoints, and video procreation and fal models usage DO-specific asynchronous endpoints alternatively than OpenAI-style ones.
Fireworks AI
Fireworks serves unfastened models (Llama, Qwen, DeepSeek, Kimi, GLM, GPT-OSS) astatine https://api.fireworks.ai/inference/v1, and it clearly documents wherever it differs from OpenAI, an honorable attack worthy rewarding. Two documented differences: wherever OpenAI returns an correction if your punctual positive max_tokens is larger than the model’s discourse window, Fireworks by default lowers max_tokens to fresh (you tin bring backmost OpenAI’s correction behaviour pinch the context_length_exceeded_behavior setting), and Fireworks includes token usage stats successful streaming responses, successful the last chunk, wherever OpenAI historically didn’t.
Per Fireworks’ serverless pricing, GPT-OSS-120B runs $0.15/$0.60 per cardinal tokens connected the Standard way ($0.18/$0.72 connected Priority), while models without an individual price, including Llama 3.3 70B, are priced by size ($0.90 level for models complete 16B parameters). Cached input is discounted per model, and batch requests are billed astatine 50% of the normal rates. On speed, Artificial Analysis measures Fireworks astatine 651.8 tokens per 2nd connected GPT-OSS-120B, the fastest of the providers compared here.
Groq
Groq runs unfastened models connected its ain civilization chip, the LPU (Language Processing Unit), built specifically for accelerated conclusion alternatively of GPUs, down the endpoint https://api.groq.com/openai/v1. Its OpenAI compatibility documentation says plainly what’s missing: logprobs, logit_bias, top_logprobs, and messages[].name returns a 400 error, and n must adjacent 1.
One smaller item from the aforesaid page: a somesthesia of precisely 0 is converted to a very mini number (1e-8) alternatively than utilized as-is. Per Groq’s pricing page, GPT-OSS-120B is $0.15/$0.60 and Llama 3.3 70B Versatile is $0.59/$0.79 per cardinal input/output tokens; Artificial Analysis measures Groq astatine 482.1 tokens per 2nd connected GPT-OSS-120B. The catalog is smaller than Together’s aliases Fireworks’. Groq tunes a chosen group of models for its hardware alternatively than hosting everything.
Nebius Token Factory
Nebius Token Factory serves 60+ unfastened models done an OpenAI-compatible API, pinch per-model rates published successful the Token Factory console and dedicated endpoints pinch a 99.9% uptime guarantee (SLA) for accumulation use. Per the console (July 2026), GPT-OSS-120B runs $0.15/$0.60 per cardinal input/output tokens astatine a listed 40 tokens per second, and Llama 3.3 70B Instruct runs $0.13/$0.40 astatine 25 tokens per second, the lowest Llama 3.3 70B value among the providers compared here. Each exemplary comes successful 2 versions, Base and Fast: the Fast type uses smaller batches, much compute per request, and speculative decoding to trim waiting time, astatine a higher per-token price, and you prime it by simply adding -fast to the exemplary sanction successful the API, per Nebius’s documentation. One point that stands out: the API accepts the afloat group of vLLM settings (vLLM is the open-source serving motor Nebius builds on), which is much than OpenAI’s API accepts. That’s useful for teams that want controls OpenAI doesn’t offer, though thing vLLM-specific won’t transportation backmost over. Like Fireworks, the catalog is unfastened to models only.
OpenRouter
OpenRouter is simply a different benignant of service: not a big but a router. It sits successful beforehand of dozens of different providers and gives you 300+ models, unfastened and closed, down 1 OpenAI-compatible endpoint (https://openrouter.ai/api/v1) and 1 API key. Per-token prices walk done from the underlying providers unchanged.
OpenRouter makes its money connected a 5.5% interest erstwhile you bargain credits (with a $0.80 minimum, truthful a $100 top-up leaves astir $94.50 for inference, while mini top-ups salary proportionally more) and a 5% interest connected bring-your-own-key requests beyond 1M per month, per OpenRouter’s pricing page. The trade-off is the other furniture successful the middle: because each petition whitethorn beryllium served by a different underlying provider, speed, nonstop streaming behavior, and really instrumentality calling behaves tin alteration from petition to request, though routing preferences fto you pin circumstantial providers.
Together AI
Together AI serves 200+ models crossed text, image, video, code, and audio done an OpenAI-compatible endpoint, pinch published pricing for each model: per token for matter models, and per image, video, aliases characteristic for the rest. GPT-OSS-120B runs $0.15/$0.60 and Llama 3.3 70B $1.04 level per cardinal tokens, per Together’s pricing page. Artificial Analysis measures Together astatine 581.6 tokens per 2nd connected GPT-OSS-120B, pinch the lowest clip to first reply token (3.96s) of the open-model hosts compared here.
Its chat catalog centers connected open-weight models, pinch nary GPT- aliases Claude-class closed matter models, though it does service proprietary image, video, and audio models (GPT Image, Veo, Sora) alongside the unfastened ones. What sets it isolated is velocity engineering, including ATLAS, its speculative-decoding strategy that learns from unrecorded traffic; a batch API astatine discounted rates; and a provisioned-throughput tier (PTUs), which is reserved capacity you bargain up of time. Together besides offers LoRA and afloat fine-tuning (supervised and DPO) priced per training token, and the fine-tuned exemplary tin past beryllium served connected Together, which matters if you scheme to yet customize an unfastened model.
How to really switch
The codification alteration itself is 2 lines. Using DigitalOcean arsenic the illustration (the shape is identical for each supplier above, conscionable switch the guidelines URL and key):
from openai import OpenAI import os client = OpenAI( base_url="https://inference.do-ai.run/v1/", api_key=os.getenv("MODEL_ACCESS_KEY"), ) response = client.chat.completions.create( model="openai-gpt-oss-120b", messages=[{"role": "user", "content": "Hello"}], )The remainder of the activity is wherever migrations really return time:
Model sanction mapping. gpt-4o doesn’t beryllium connected an replacement provider. You’ll representation to a exemplary of akin capacity (llama-3.3-70b-instruct, gpt-oss-120b, etc.), and exemplary IDs disagree by provider, truthful query the provider’s /v1/models endpoint alternatively than guessing names.
Parameter check. Search your codebase for logprobs, logit_bias, n=, response_format, and tools. Each deed needs a cheque against the caller provider’s documented support. Providers neglect differently: immoderate return a 400 correction connected unsupported parameters (Groq), others softly set them (Fireworks’ max_tokens behavior).
Streaming checks. If your codification makes its ain assumptions erstwhile reference streaming chunks (rebuilding tool-call arguments from partial pieces is the communal case), trial that way specifically. This is the astir communal root of bugs aft a switch.
Test for output changes. The aforesaid API style does not mean the aforesaid exemplary behavior. Run your existing trial group (or astatine slightest a saved group of emblematic prompts) against the caller supplier earlier moving postulation over. Prompts tuned for 1 exemplary family often request adjusting.
A sensible rollout: nonstop a mini stock of accumulation postulation to the caller supplier down a characteristic flag, comparison outputs and correction rates for a week, past switch.
The little evident consequence isn’t switching to a compatible provider. It’s what happens after, erstwhile your exertion grows into parts of the OpenAI spec your caller supplier doesn’t support. Agent frameworks are the sharpest example. Tool-calling schemas, parallel instrumentality calls, strict system outputs, and the Responses API are wherever the spec is changing fastest and wherever replacement providers lag longest. An exertion that’s a cleanable drop-in coming tin get stuck tomorrow: you adopt an supplier model that sends strict: existent instrumentality schemas, your supplier ignores aliases rejects them, and now you’re maintaining provider-specific workarounds, a quiet shape of lock-in that’s harder to spot than a proprietary API.
Two ways to protect yourself. First, for illustration providers that archive their differences complete ones that declare afloat compatibility; a published spread database intends you tin cheque earlier you build, not after. Second, support a mini compatibility trial suite, a twelve requests covering streaming instrumentality calls, JSON mode, and your longest context, and tally it against your supplier connected a schedule. The spec is simply a moving target; your provider’s sum of it should beryllium thing you monitor, not thing you assume.
Choosing the correct provider
OpenAI’s API has softly go what the ecosystem builds against: the communal interface of AI infrastructure, implemented by each superior provider. That changes the question. When switching costs driblet to 2 lines of code, the determination is nary longer whether you tin time off a supplier but what you should optimize for erstwhile you can. Speed, catalog, price, and completeness of compatibility propulsion successful different directions, and the correct reply depends connected really your exertion really works. The comparison supra points to a fewer clear matches:
If you want open and closed models down 1 endpoint, DigitalOcean and OpenRouter are the only 2 options here. DigitalOcean hosts the models itself pinch per-token rates that lucifer each exemplary owner’s pricing; OpenRouter routes to different providers and adds a interest connected credits, pinch behaviour that tin alteration by which supplier serves the request.
If you want the fastest open-model serving, Fireworks, Together, and Groq lead the Artificial Analysis benchmarks, and each gets location differently: Fireworks pinch the highest measured output speed, Together pinch the lowest clip to first reply token, Groq pinch civilization LPU hardware. Test each 3 connected your ain prompts, since the spread betwixt them is smaller than the spread betwixt immoderate published number and your accumulation traffic.
If you’re optimizing for costs connected unfastened models, Nebius listed the lowest Llama 3.3 70B value successful this comparison, and the size-tiered pricing astatine Fireworks and level rates elsewhere are adjacent capable that your token operation (input-heavy vs. output-heavy) matters much than the header rate.
Whichever supplier you pick, dainty compatibility arsenic thing you verify, not thing you assume. Run the parameter cheque and streaming tests from the migration conception earlier cutting over, support a mini compatibility trial suite moving connected a schedule, and re-check pricing pages earlier you perpetrate existent volume, because each number successful this article has a day connected it.
Getting started
If your shortlist includes moving unfastened and closed models down 1 endpoint, DigitalOcean’s Inference Engine offers per-token pricing pinch nary minimum committedness and useful pinch the OpenAI SDK retired of the box. The quickstart takes a guidelines URL, a exemplary entree key, and astir 5 minutes.
Sources
All pricing figures were checked against charismatic supplier pricing pages successful July 2026:
- DigitalOcean Gradient AI Platform Pricing · Serverless Inference pinch the OpenAI SDK · DO conclusion benchmark blog
- Together AI Pricing
- Fireworks Serverless Pricing · Fireworks OpenAI Compatibility
- Groq Pricing · Groq OpenAI Compatibility
- OpenRouter Pricing
- Nebius Token Factory Docs · Token Factory Pricing Console
- Speed and latency: Artificial Analysis, GPT-OSS-120B supplier benchmark (median, 10K-token input, retrieved July 2026)
This activity is licensed nether a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
English (US) ·
Indonesian (ID) ·