Skip to main content
/v1/chat/completions is the de facto standard interface of the LLM industry — virtually every framework, client, and SDK supports it out of the box. Through APIYI, this single endpoint reaches OpenAI, Claude, Gemini, DeepSeek, and 400+ models in total; switching models is just swapping a string.
Which endpoint to pick: using existing frameworks/clients, or want one codebase across multiple vendors → compatible mode (this page); need built-in tools (web search, code interpreter) or Pro-series models → Native Calls (/v1/responses). OpenAI’s official stance on Chat Completions: supported long-term, but Responses is recommended for new projects. Both endpoints require you to maintain conversation history yourself — see the Multi-Turn Conversation Guide.

Quick Start

One Interface, Every Provider

This is the biggest payoff of compatible mode: switching models means changing a string — not a line of code.
Full model names and prices: Models & Pricing. Note: calling Claude through the compatible format forfeits Claude’s Prompt Cache discount — for heavy Claude usage, use Claude Native Calls.

SDK Setup per Language

Every official SDK supports a custom base_url — configure once and go.

Python

Or use environment variables for zero in-code config:

Node.js / TypeScript

.NET

Go

Use the official OpenAI Go SDK (github.com/openai/openai-go):

Java

Use the official OpenAI Java SDK (com.openai:openai-java):
Legacy projects on third-party libraries (Go’s sashabaranov/go-openai, Java’s theokanning packages) still work after changing the base_url, but we recommend migrating to the official SDKs above — third-party libraries lag on new parameters such as reasoning_effort.

Common Features

Streaming

Reasoning control

On Chat Completions, use the top-level reasoning_effort parameter (different from the nested form on Responses):
On GPT-5.4 and later (including the gpt-5.6 series), tools and reasoning_effort are mutually exclusive on this endpoint: carrying tools while reasoning_effort is not none fails with a 400 — Function tools with reasoning_effort are not supported for ... in /v1/chat/completions. Omitting the parameter doesn’t help, since it defaults to medium. This is an official OpenAI restriction — for reasoning plus tool calling, switch to the Responses endpoint, or explicitly set reasoning_effort="none".
gpt-5 series reasoning models do not support temperature / top_p on this endpoint either — passing them raises an error.

Image input

Embeddings

Error Handling and Retries

The official SDKs retry automatically (2 attempts by default, on 429 / 5xx / connection errors) — prefer that over hand-rolled loops:
For finer control, catch by exception type:

Capability Boundaries of Compatible Mode

Migrating from OpenAI Direct

Already on OpenAI’s official service? Migration is two steps with zero code changes:
  1. Change base_url and key
  1. Or change environment variables only (code untouched)
Method calls, parameter formats, and response structures all stay identical.