← ClaudeAtlas

chat-completions-apilisted

Reference for the OpenAI Chat Completions API (/v1/chat/completions) and legacy /v1/completions as the lingua-franca compatibility protocol — the official spec incl. deprecation timeline and Responses-only feature delta, how 7 local servers (vLLM, SGLang, llama.cpp, Ollama, mistral.rs, Llama Stack/OGX, Lemonade) actually implement it, gateways (LiteLLM, Bifrost), 10 cloud providers' CC-compat endpoints (Anthropic, Gemini, DeepSeek, xAI, Groq, OpenRouter, Azure...), the reasoning_content/reasoning field schism, finish_reason divergences, and client wire behavior (opencode, Vercel AI SDK). NOT for the Responses API (responses-api skill) or Anthropic Messages protocol (messages-api skill).
air-gapped/skills · ★ 5 · AI & Automation · score 78
Install: claude install-skill air-gapped/skills
# Chat Completions Compatibility Reference Chat Completions is the lingua franca of LLM serving — and because everyone has implemented and extended it longest, it carries the MOST undocumented divergence of the three open protocols. OpenAI keeps it fully supported but second-choice ("we recommend trying Responses") — and since 2026-07-29 OpenAI's own publications call it "our **legacy** Chat Completions API" (ARC-AGI-3 post; still no deprecation or sunset date); xAI, Groq, and Azure declare it legacy too. Legacy `/v1/completions` loses its last first-party OpenAI models 2026-09-28 and survives as a local/third-party surface. **Fleet property: stateless.** Full history resent every turn, like Messages; no server-side session state to break load-balanced fleets (contrast responses-api's `previous_response_id`). **Last refreshed**: 2026-07-19 (source-examined at commits of 2026-07-16..18; provenance in `references/sources.md`). ## Critical Gotchas - **The reasoning-field schism**: `reasoning_content` (SGLang, llama.cpp, mistral.rs, DeepSeek, xAI) vs `reasoning` (vLLM, Ollama, Together, Groq, OpenRouter) vs inline `<think>` — and vLLM silently RENAMES incoming `reasoning_content`→`reasoning`. Servers should emit both; clients should read both. Full table: `references/backend-implementations.md`. - **Reasoning must be passed BACK in tool loops** on DeepSeek v4 (with tool calls) and OpenRouter (exact block sequence) — clients that strip reasoning break agentic loop