v1

latestOpenAPI 3.0.02026-07-26117076.0 KB
Text Series

Responses API

Create a response from text, multimodal input, and optional tools.

post/v1/responses

Request body

modelstring required

Model name.

instructionsstring

System or developer instructions that guide the model response.

max_output_tokensinteger

Maximum number of output tokens to generate.

max_tokensinteger

Legacy compatibility field for maximum output tokens.

streamboolean

Whether to use streaming output in SSE format.

storeboolean

Whether the response should be stored when supported.

reasoningobject

Reasoning configuration, when supported by the selected model.

textobject

Text output configuration, such as structured output format options when supported.

metadataobject

Custom metadata key-value pairs for your request.

previous_response_idstring

Previous response ID for continuing a conversation.

includestring[]

Additional response fields to include, when supported.

parallel_tool_callsboolean

Whether the model may call multiple tools in parallel.

truncationstring

Truncation behavior for long context, when supported.

userstring

End-user identifier for abuse monitoring and request tracing.

backgroundboolean

Whether to run the response in background mode, when supported.

service_tierstring

Service tier selection, when supported.

promptobject

Prompt object, when supported by the selected model.

temperaturenumber

Controls output randomness, range 0-2.

top_pnumber

Nucleus sampling parameter, range 0-1.

Example request

{
  "model": "gpt-5.2",
  "input": "Write a product tagline in one sentence.",
  "tools": [
    {
      "type": "web_search_preview"
    }
  ],
  "tool_choice": "auto",
  "max_output_tokens": 200,
  "max_tokens": 200,
  "reasoning": {
    "effort": "medium"
  },
  "truncation": "auto",
  "service_tier": "auto",
  "temperature": 1,
  "top_p": 1
}

Response

Response created

codeinteger

Example response

{
  "code": 200,
  "data": {
    "id": "resp_9876543210",
    "object": "response",
    "created_at": 1677652288,
    "status": "completed",
    "model": "gpt-5.2",
    "output": [
      {
        "type": "message",
        "status": "completed",
        "role": "assistant",
        "content": [
          {
            "type": "output_text",
            "text": "Launch faster with a smarter AI workspace built for teams."
          }
        ]
      }
    ],
    "usage": {
      "input_tokens": 12,
      "output_tokens": 14,
      "total_tokens": 26
    }
  }
}