Skip to main content
Two OpenAI protocols are available for text. Use models with kind: text from GET /v1/models.

Chat Completions

Every field of the protocol is forwarded to the model as sent — tools, tool_choice, response_format, logprobs, seed, stop and the rest. Whether a model honours a field is up to the model.
string
required
A model id, for example deepseek/deepseek-v4-flash.
object[]
required
The conversation. role: system, developer, user, assistant or tool. content: text, or an array of parts (text, image_url, …).
integer
Cap on output tokens, reasoning included.
boolean
default:"false"
number
From 0 to 2.
string
minimal, low, medium or high.
object[]
string | object
none, auto, required, or a specific tool.
The response is a standard chat.completion object with choices (message, finish_reason: stop, length, tool_calls, content_filter) and usage. completion_tokens includes hidden reasoning tokens.
Tool calling

Responses

For code written against client.responses.create. Required fields are model and input (a string or an array of messages); also instructions, max_output_tokens, temperature, tools, stream.
Responses are not stored. previous_response_id and retrieving a response later are not supported — send the whole conversation in input.

Streaming

Set "stream": true to receive Server-Sent Events. The stream ends with data: [DONE].
  • Chat Completions — stream_options.include_usage is always forced on; the final chunk carries usage.
  • Responses — events response.output_text.delta, …, response.completed; usage is in response.completed.
Use streaming for long answers. A long non-streamed answer may be rejected with streaming_required.
A stream that has started cannot switch to another backend. If the backend fails mid-answer, the stream ends with data: {"error": {…}} followed by data: [DONE] — treat what arrived as a partial answer.