chat-completions-api

Solid

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).

AI & Automation 3 stars 1 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 79/100

Stars 20%
20
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# 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"); xAI, Groq, and Azure likewise declare it legacy. 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 loops. `references/cloud-compat.md`. - **Silent-drop vs hard-400 split**: Ollama silently drops `tool_choice` (forced tool calls no-op!) and `max_...

Details

Author
air-gapped
Repository
air-gapped/skills
Created
3 months ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category