Responses

Send typed input, continue stored conversations and return function results.

Create a response

POST /v1/responses accepts a string or a typed input array.

JSON
{
  "model": "deepseek-v4.1-flash-1017",
  "input": "Explain backpressure in two sentences.",
  "max_output_tokens": 256,
  "store": false
}

For raw HTTP, concatenate the text values from output[] message entries whose content type is output_text. OpenAI-compatible SDKs also expose output_text as a convenience property. Check status and incomplete_details before treating an answer as complete.

Continue a stored response

Save the first response by using store: true or omitting store. Send its id as previous_response_id on the next turn.

JSON
{
  "model": "deepseek-v4.1-flash-1017",
  "previous_response_id": "resp_your_stored_response_id",
  "input": "Give one example of that pattern.",
  "max_output_tokens": 256
}

Send instructions, system_prompt and agents_md again if you want them on the new request. You can also send your own message history in input for a stateless request.

Return a tool result

Use the call_id from the model’s function_call item. The following example assumes the call is available through the stored previous response.

JSON
{
  "model": "deepseek-v4.1-flash-1017",
  "previous_response_id": "resp_your_stored_response_id",
  "input": [
    {"type": "function_call_output", "call_id": "call_from_the_response", "output": "{\"temperature\":17}"}
  ],
  "max_output_tokens": 256
}

For a stateless continuation, include the original input, the function_call item and its matching function_call_output. See client tools for the call and result sequence.

Reasoning and structured output

Choose a supported value with reasoning: {"effort":"high"}, and use thinking: false to suppress reasoning reporting. Discover supported levels before setting an effort. For structured JSON, use text.format with type: "json_schema", name and schema.

Set stream: true to follow response.output_text.delta and the terminal response event. Streaming details.

Search the docs