By 2025-2026, the OpenAI Chat Completions request and response shape has become the closest thing the LLM industry has to a lingua franca. It was never ratified by a standards body, no IETF RFC, no W3C spec, it became a de facto standard the way HTTP status codes or the SMTP envelope did: enough of the ecosystem built against it early that everyone after had a strong incentive to speak it too. This lesson makes that concrete by calling four completely different backends with the exact same request body.
The Shape Itself
A request:
{
"model": "gpt-4o",
"messages": [
{"role": "system", "content": "You are a concise support assistant."},
{"role": "user", "content": "My order hasn't arrived in 10 days."}
],
"temperature": 0.3,
"max_tokens": 300
}
And the response shape every OpenAI-compatible backend returns:
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "gpt-4o",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "I'm sorry for the delay..."},
"finish_reason": "stop"
}
],
"usage": {"prompt_tokens": 24, "completion_tokens": 41, "total_tokens": 65}
}
messages, choices[0].message.content, and usage are the three fields almost every client, framework, and gateway is written against. This is exactly what let the “change two constructor arguments” trick from Lesson 3 work.
The Same Request, Four Backends
OpenAI, the origin of the schema:
curl https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Say hi in five words."}]}'
Groq, serving open-weight models (Llama 3.3) at very low latency, exposes a byte-for-byte compatible endpoint at a different base URL:
curl https://api.groq.com/openai/v1/chat/completions \
-H "Authorization: Bearer $GROQ_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"llama-3.3-70b-versatile","messages":[{"role":"user","content":"Say hi in five words."}]}'
Ollama, running an open-weight model entirely on your own machine, exposes the same endpoint on localhost with no real API key required:
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"llama3.2","messages":[{"role":"user","content":"Say hi in five words."}]}'
vLLM, the production-grade open-source inference server (set up fully in Lesson 8), serves the identical shape once launched with vllm serve meta-llama/Llama-3.1-8B-Instruct:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"meta-llama/Llama-3.1-8B-Instruct","messages":[{"role":"user","content":"Say hi in five words."}]}'
Four completely different companies and codebases, Groq’s custom LPU inference stack, Ollama’s local runtime, vLLM’s PagedAttention-based server, and OpenAI’s own infrastructure, all accept this exact request body and return this exact response shape. This is precisely why a gateway’s adapter layer (Lesson 6) can be thin for OpenAI-compatible backends: for these four, the adapter mostly just swaps in the right base URL and the real credential, rather than rewriting the whole payload.
Where It Still Diverges
Compatibility is not total, and knowing where it breaks is what an adapter layer is actually for. Anthropic’s native Messages API uses a different shape entirely (content blocks instead of a flat string, max_tokens required rather than optional, system as a top-level field rather than a message role), which is why Anthropic calls need real translation rather than a pass-through, covered in Lesson 6. Even among OpenAI-compatible backends, optional parameters diverge: not every provider supports logprobs, seed, or every sampling parameter, and tool-calling response shapes have subtle differences in how arguments are streamed. A gateway earns its place precisely in this gap, absorbing the divergence so that application code, which only ever sees the canonical shape, never has to know it exists. Lesson 6 builds that adapter layer for both the easy case (OpenAI-compatible pass-through) and the hard case (a genuinely different schema like Anthropic’s).