What is an OpenAI-compatible API?

OpenAI-compatible API — an API that accepts and returns requests in the same wire format as OpenAI's /v1/chat/completions endpoint, so any application using the OpenAI SDK (Python, TypeScript, Go, etc.) can switch to it by changing only the base_url and api_key — no other code change.

Why this is a de facto industry standard

When OpenAI shipped /v1/chat/completions in 2023, the SDK and request shape became the most-integrated API contract in machine-learning history within months. Every framework that needed to call an LLM (LangChain, LlamaIndex, the Vercel AI SDK, every agent framework) targeted that shape. By 2026, "OpenAI-compatible" describes the wire contract more than it describes the vendor.

Every major non-OpenAI provider now offers an OpenAI-compatible mode in addition to their native API. Anthropic, Google, Mistral, Groq, DeepSeek, xAI, and Amazon Bedrock (via Converse-OpenAI) all accept the same chat completions shape. This is what makes LLM gateways possible — one shape on the customer side, N shapes on the provider side, the gateway translates.

What the wire contract covers

How GammaInfra is OpenAI-compatible

GammaInfra's /v1/chat/completions accepts every field documented above. The only code change required to migrate is the base_url:

Before (OpenAI direct):

from openai import OpenAI
client = OpenAI(
    api_key="sk-proj-...",
    base_url="https://api.openai.com/v1",
)

After (GammaInfra):

from openai import OpenAI
client = OpenAI(
    api_key="sk-gammainfra-...",
    base_url="https://api.gammainfra.com/v1",
)

Every subsequent client.chat.completions.create(...) call works as-is. Streaming works. Tool calling works. Structured output works. The same code path handles all 8 underlying providers because the GammaInfra gateway translates internally.

Common questions

What does 'OpenAI-compatible' actually mean?
It means the API accepts requests in the same JSON shape as OpenAI's /v1/chat/completions and returns responses in the same JSON shape. Same field names, same nesting, same enum values. SDK code that was working against api.openai.com works against an OpenAI-compatible endpoint after a single base_url change.
Does OpenAI-compatible mean fully feature-equivalent?
No. Compatibility is on the wire contract, not on every feature. Vendor-specific extensions (OpenAI's Assistants API, Anthropic's adaptive thinking, Google's grounding mode) are typically not exposed through the compatibility layer. The core chat completions path — streaming, tools, structured output — is the universal subset that works everywhere.
Why do gateways implement OpenAI-compat instead of inventing their own format?
Because every framework already speaks OpenAI. Inventing a new format means writing adapter code for LangChain, LlamaIndex, the Vercel AI SDK, OpenAI Agents SDK, AutoGen, Mastra, every agent framework, every IDE plugin that supports BYOK. The cost of a new format is enormous and the value is near zero — applications don't care what the gateway looks like internally.
Are there gotchas when migrating from native OpenAI to OpenAI-compatible?
A few. Some compatibility layers don't expose every newest OpenAI feature on day one. Vendor-specific quirks may surface — for example, OpenAI's GPT-5 family requires max_completion_tokens instead of max_tokens, and rejects temperature != 1. Gateways usually translate these silently. Check the gateway's docs for any rejected fields.
Can I use the Anthropic SDK against an OpenAI-compatible endpoint?
No — Anthropic's SDK targets the /v1/messages format, which has a different request and response shape. You can either use the OpenAI SDK against an OpenAI-compatible endpoint or use the Anthropic SDK against an Anthropic-native endpoint. Some gateways (including GammaInfra at present) only expose the OpenAI-compatible surface; Anthropic-native ingress is a separate compatibility layer that's not universal.

Try the gateway

Get a GammaInfra API key →

$3 free trial credit on signup, $10 minimum top-up. Pass-through provider rates plus 3% top-up fee during the launch window (5% after 2026-06-23).

Last updated 2026-05-15.