Skip to main content
POST /v1/chat/completions accepts OpenAI-style messages. Provide a model ID and a non-empty messages array. Keep conversation history in your application and send the messages needed for each turn.

Request settings

Unsupported provider parameters can return 400. Passing a parameter through the gateway does not guarantee model support. See compatibility.

Read the result

choices[0].message.content contains the answer text. For DeepSeek with reasoning enabled, choices[0].message.reasoning_content contains reasoning separately; see reasoning. A model that supports function tools can instead return tool_calls. DeepSeek tool calling is not currently enabled. DeepSeek supports text and inline image inputs on this endpoint. It returns one completion and accepts up to 262,144 output tokens within its shared 1,048,576-token context. The API and Playground default to high reasoning. Send reasoning_effort: "none" to disable thinking explicitly. Inspect finish_reason. A response stopped at the output limit may be incomplete. Some models consume output capacity on reasoning before returning visible text; an empty text field does not necessarily imply zero usage. When reported, usage.prompt_tokens and usage.completion_tokens contain the provider’s token counts. Use Activity for the durable request record.

Continue the conversation

Append the assistant message and your next user message to the history, then make another request. Each request is independently metered and charged using its recorded token usage. Prior messages count toward the next request’s input. For streaming, follow the streaming guide.