Skip to main content
POST

Authorizations

Authorization
string
header
required

Authenticate with an API key using Bearer authentication. Do not expose real keys in documentation, code, or repositories.

Body

application/json

Responses protocol request body. model and input are required.

model
string
required

ID of the model to generate the response. Use GET /models to list models and confirm that the model supports the Responses protocol.

Example:

"deepseek-ai/deepseek-v4.1-flash-1017"

input
required

Input text or an array of input items. Items may include messages, reasoning items, function calls, and function call results.

instructions
string

Instructions passed to the model.

max_output_tokens
integer

Total token budget for this generation, including reasoning tokens and visible output tokens. Must be at least 1; the model determines the maximum. This parameter name applies to the Responses protocol.

Required range: x >= 1
Example:

128

text
object

Text output format configuration. Use format to specify JSON Schema requirements for structured output.

stream
enum<boolean>

Whether to stream output. When true, receive incremental results through named SSE events.

Available options:
true,
false
tools
object[]

Function tools available to the model. When the model returns a function_call item, the client executes the function and returns its result through function_call_output.

tool_choice

Controls tool selection. Use auto to let the model choose, none to disable tool calls, or required to require a tool call. Use {"type":"function","name":"get_weather"} to select a specific function.

Available options:
auto,
none,
required

Response

Response successful. Streaming examples show only selected events and fields.

id
string
required

Response identifier.

object
string
required

Response object type.

created_at
integer
required

Response creation time as a Unix timestamp in seconds.

status
string
required

Response status, such as in_progress, completed, or incomplete.

model
string
required

Identifier of the model that generated the response.

output
object[]
required

Output items, which may include messages, reasoning items, and function calls.

usage
object | null

Token usage for this request. May be null.