Skip to main content
POST
Chat Completions
Create a model response based on the conversation context (the messages array). Every model with chat capability (OpenAI / Claude / Gemini / DeepSeek / Qwen, etc.) can be called through this endpoint.

Request

Authentication

Main parameters

messages structure

Supported roles: system / user / assistant / tool (function return).

Response

finish_reason possible values: stop / length / tool_calls / content_filter.

Streaming response

With stream: true, the server pushes chunks in SSE format:
With stream_options.include_usage: true, an extra chunk with usage is sent at the end:

Function calling

In the response:
After executing the tool, append the result to messages:
Call chat completions again to let the model continue answering based on the tool result.

Reasoning models

For the o3 / GPT-5 series, use reasoning_effort:
You can also use a suffixed model ID (o3-mini-low / -medium / -high) for the equivalent effect.

Errors

See Error codes for common errors.