Blog · · By Dhrumil Barot, Founder
6 Best OpenAI Compatible API Providers (Compared)
OpenAI compatible API providers let you keep the OpenAI SDK and swap base_url. Six compared on base URL, what breaks, and gpt-oss-120b price.
TL;DR: Six OpenAI compatible API providers worth using today are Vynaris, OpenRouter, Together AI, Fireworks AI, Groq and DeepInfra. All six take the official OpenAI SDK with a new base_url and key. They differ on three things: which request parameters fail, how they bill, and price. On the same open model (gpt-oss-120b), 10M input plus 2M output tokens costs $0.60 to $2.70 depending on provider, prices read 2026-11-14.
Try it: point your OpenAI client at https://api.vynaris.com/v1, set model to auto, and read the cost receipt on every response. Get a Vynaris API key.
An OpenAI compatible API provider is a host that serves the OpenAI Chat Completions format at its own base URL, so the openai Python or TypeScript SDK works after you change two settings: base_url and api_key. Pick by job: Vynaris if you want routing from frontier models down to cheaper ones with a per-request cost receipt; OpenRouter for the widest provider choice on one key; DeepInfra for the lowest direct price on open models; Groq for raw speed; Together AI and Fireworks AI for the broadest feature coverage including tools and structured outputs. The base URL is the easy part. What breaks is the parameters: Groq returns a 400 on logprobs, Together returns a 404 on gpt-4o, and Fireworks silently shortens max_tokens by default.

How we judged the providers
We compared each OpenAI compatible API on four things you hit in the first hour of switching:
- Base URL and model IDs: the exact string for
base_url, and whether model names are flat (gpt-4o) or namespaced (openai/gpt-oss-120b). - What breaks: parameters the provider's own docs say return errors or behave differently from OpenAI.
- Tools and structured outputs: does
toolsandresponse_formatwithjson_schemawork. - Price for the same model: gpt-oss-120b, an open-weight model most of these hosts serve, priced on a workload of 10M input and 2M output tokens a month.
Every base URL and price below comes from the vendor's own docs or pricing page, read on 2026-11-14.
Summary table: base URL, what breaks, price
| Provider | Base URL | Model IDs | Known breaks | gpt-oss-120b (in/out per 1M) | Cost on 10M in + 2M out |
|---|---|---|---|---|---|
| Vynaris | https://api.vynaris.com/v1 | auto or a model name | No native /v1/messages yet | Provider list price + 3% (1% after $500/month) | $2.78 if served at $0.15/$0.60 |
| OpenRouter | https://openrouter.ai/api/v1 | Namespaced | Parameter support varies by upstream provider | From $0.03 / $0.15 | $0.63 incl. 5.5% credit fee |
| Together AI | https://api.together.ai/v1 | Namespaced, gpt-4o returns 404 | No Assistants, OpenAI-shape Batches or Moderations | $0.15 / $0.60 | $2.70 |
| Fireworks AI | https://api.fireworks.ai/inference/v1 | accounts/fireworks/models/... | max_tokens truncated by default | $0.15 / $0.60 | $2.70 |
| Groq | https://api.groq.com/openai/v1 | Flat-ish (openai/gpt-oss-120b) | logprobs, logit_bias, messages[].name return 400; n must be 1 | $0.15 / $0.60 | $2.70 |
| DeepInfra | https://api.deepinfra.com/v1/openai | Namespaced | Chat completions only on this path | $0.037 / $0.17 | $0.71 |
Cost math: (10 x input price) + (2 x output price). OpenRouter: (10 x $0.03 + 2 x $0.15) = $0.60, plus 5.5% on the credits you buy = $0.63. Want to run your own token counts? Use the LLM cost calculator.

1. Vynaris
Vynaris is an OpenAI-compatible chat completions gateway at https://api.vynaris.com/v1 that routes each request and returns what it cost. You keep your SDK, prompts and tool definitions, and set model to auto (Vynaris docs).
from openai import OpenAI
client = OpenAI(base_url="https://api.vynaris.com/v1", api_key="vyn_sk_live_XXXX")
resp = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Say hi in five words."}],
)
print(resp.choices[0].message.content)Best for: teams sending most calls to a frontier model who want cheaper models used only where evals say quality holds, with proof per request.
What it does for this job: each request starts in a frontier pool and routes down only when "exact-version eval evidence clears the quality gate." Every response carries headers such as x-vynaris-served-model, x-vynaris-cost-usd, x-vynaris-baseline-usd and x-vynaris-saved, and the ledger exports to CSV, so you can recompute the bill yourself.
Pricing: "Provider list price + 3% / 1%": 3% until monthly usage reaches $500, then 1%. Prepaid top-ups from $20, no overages; requests stop at zero balance (Vynaris pricing). Fixed plans are $20, $50 and $150 a month, each paid entirely as API credit.
Limits, stated plainly: Vynaris is not the cheapest way to pin one open model. If you only ever call gpt-oss-120b, a direct host like DeepInfra costs less than any gateway. And the native Anthropic /v1/messages format is not implemented yet, so Anthropic-shaped traffic goes through /v1/chat/completions for now.
2. OpenRouter
OpenRouter is a hosted router with one key in front of many upstream providers. For gpt-oss-120b alone it lists more than 20 hosts, from $0.03 / $0.15 (NEAR AI, Venice) to $0.25 / $0.45 (io.net), with latency and throughput per host (OpenRouter model page).
Best for: picking the cheapest or fastest host per model without separate accounts.
Pricing: inference at provider list price; the fee is on credit purchases, 5.5% on Standard and 8% on Business. Bring-your-own-key is free up to $25,000 of list-price inference a month, then 5% (OpenRouter pricing).
What breaks: parameter support depends on which upstream serves the call. Set provider.require_parameters: true and OpenRouter only uses providers that support every parameter in your request (provider selection docs). Structured outputs work through response_format with json_schema, on supported models.
For how its auto router compares on cost, see our OpenRouter vs Vynaris fee comparison.
3. Together AI
Together AI publishes the most explicit compatibility matrix of the six. Set base_url to https://api.together.ai/v1 and chat, vision, tools, response_format, legacy completions, images, speech and models.list all map to Together endpoints (Together compatibility docs).
Best for: teams that use more than chat, such as image generation or speech, through the same OpenAI SDK.
Pricing: gpt-oss-120B at $0.15 input and $0.60 output per 1M tokens (Together pricing). The US-only endpoint https://us-api.together.ai/v1 charges 1.25x standard serverless rates.
What breaks: model IDs are namespaced, so gpt-4o or text-embedding-3-large return a 404. Assistants, OpenAI-shaped Batches and Moderations are not supported; serverless embeddings are not offered (dedicated endpoints only). Together also serves the Responses API and the Anthropic Messages API.
4. Fireworks AI
Fireworks AI serves the OpenAI format at https://api.fireworks.ai/inference/v1, with model paths like accounts/fireworks/models/gpt-oss-120b (Fireworks compatibility docs).
Best for: structured output heavy workloads: it supports json_schema and a BNF grammar mode (structured responses).
Pricing: GPT OSS 120B at $0.15 input, $0.015 cached input and $0.60 output per 1M; Priority tier $0.18 / $0.018 / $0.72 (Fireworks pricing). The 90% cache discount matters for long repeated system prompts.
What breaks: if prompt plus max_tokens exceeds the context window, Fireworks lowers max_tokens instead of returning OpenAI's error. Set context_length_exceeded_behavior to error to match OpenAI. One thing it does better: it returns usage in the last streaming chunk.
5. Groq
Groq serves an OpenAI compatible API at https://api.groq.com/openai/v1 and is the speed pick. OpenRouter's table shows Groq serving gpt-oss-120b at 346 tokens per second and 0.21 s latency, against 49 tok/s for DeepInfra's bf16 host (OpenRouter).
Best for: latency-bound agents and voice or chat UIs.
Pricing: $0.15 input, $0.60 output per 1M for gpt-oss-120b, $0.075 cache read (Groq's rate as listed on OpenRouter, 2026-11-14).
What breaks: the most documented breaks of the six. logprobs, logit_bias, top_logprobs and messages[].name return a 400, n must be 1, and temperature: 0 is converted to 1e-8 (Groq OpenAI compatibility). Strict json_schema (strict: true) runs on select models only; the default is best-effort (Groq structured outputs).
6. DeepInfra
DeepInfra offers an OpenAI-compatible chat completions API for all its LLMs at https://api.deepinfra.com/v1/openai, and the Responses API at the same base URL (DeepInfra docs).
Best for: the lowest direct price on a fixed open model.
Pricing: gpt-oss-120b at $0.037 input and $0.17 output per 1M (DeepInfra model page), $0.71 on our 10M + 2M workload.
What breaks: other model types (embeddings, images, speech) live under separate APIs, not this OpenAI path. Throughput on the bf16 host is the lowest in OpenRouter's table at 49 tok/s.
How to choose
- You mostly call frontier models and want the bill down without guessing: Vynaris. It routes down only with eval evidence and shows the served model and cost on every response.
- You want one key across many hosts: OpenRouter.
- You run one open model at volume: DeepInfra on price, Groq on speed.
- You need images, speech or grammars too: Together AI or Fireworks AI.
For the gateway layer itself, read what an LLM gateway is and our AI gateway fees audit.
FAQ
Which providers offer an OpenAI-compatible API?
Almost every inference host. The six above document the swap first-party; Google's Gemini API, Mistral, Amazon Bedrock, vLLM and Ollama also do. Compatible means the shape matches, not that every parameter is honoured.
What breaks when you switch base_url?
Model IDs first (Together returns a 404 on gpt-4o), then parameters (Groq returns 400 on logprobs; Fireworks truncates max_tokens), then cost machinery such as caching, which we measured as a 3.5x bill in what a base_url swap breaks.
Which provider is cheapest for the same open model?
For gpt-oss-120b on 10M input and 2M output tokens, OpenRouter's cheapest host at $0.63 including the credit fee, then DeepInfra at $0.71. Together, Fireworks and Groq cost $2.70: a 4.3x gap on identical weights.
Do compatible APIs support structured outputs and tool calls?
Tools, yes on all six. For json_schema, Together and Fireworks list it as supported, Fireworks adds grammar mode, Groq enforces strict: true on select models only, and OpenRouter depends on the host (use require_parameters). Test your exact schema first.
Is an OpenAI compatible API the same as using OpenAI?
No. Only the request and response format match. The model, its quality, its rate limits and the data handling belong to the provider you point at.
Can I use the official OpenAI Python SDK with these providers?
Yes. All six document the openai SDK with a changed base_url and api_key. Model names change to the provider's IDs.
Does streaming return token usage?
It depends. Fireworks returns usage in the final streaming chunk by default. Vynaris returns cost in response headers. On others, request it with stream_options where supported.
Are OpenAI compatible endpoints slower?
The format adds nothing; the host decides. On gpt-oss-120b, OpenRouter lists hosts from 30 to 346 tokens per second.
What does a gateway add on top of provider prices?
OpenRouter charges 5.5% on credit purchases (Standard). Vynaris charges 3% on the first $500 of monthly usage, then 1%. Direct hosts charge only their token prices.
Start with one base URL
Change base_url to https://api.vynaris.com/v1, set model to auto, and compare the receipt to what you pay today. Get your Vynaris API key.
Related articles
- OpenAI-compatible APIs: what one base_url swap gets you, and the 3.5x caching tax
- Best Claude Model: 5 Picks by Cost per Task (Compared)
- How to Use OpenAI Batch API in Python (With Cost Math)
- OpenAI Whisper API Pricing: $0.006/min and Its Replacement
- Model fallback chains: designing for provider outages without doubling your bill