> ## Documentation Index
> Fetch the complete documentation index at: https://docs.routeway.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Responses

> Generate a unified response block from various input configurations.

Generate a unified response block from various input configurations. The Responses API is a higher-level alternative to Chat Completions with built-in tools and optional server-side conversation state.

## Create Response

To create a response, use the following endpoint:

`POST /v1/responses`

### Request Body

<ParamField body="model" type="string" required>
  The model ID to use for the response (e.g. `"gpt-4o"`, `"gpt-4o-mini"`). Only models that
  advertise `/v1/responses` in their `endpoints` array are supported. See
  [Models](/getting-started/models) for the full list.
</ParamField>

<ParamField body="input" type="string | array" required>
  The input for the model. Can be a plain text string or an array of input items (text,
  image, file, etc.).
</ParamField>

<ParamField body="instructions" type="string">
  A system-level instruction that guides the model's behavior throughout the response.
  Equivalent to the `system` message in Chat Completions.
</ParamField>

<ParamField body="max_output_tokens" type="integer">
  The maximum number of tokens to generate in the output.
</ParamField>

<ParamField body="temperature" type="number">
  Sampling temperature between 0 and 2. Higher values make output more random; lower values
  make it more deterministic.
</ParamField>

<ParamField body="stream" type="boolean">
  Whether to stream the response back as Server-Sent Events (SSE).
</ParamField>

<ParamField body="previous_response_id" type="string">
  The ID of a previous response to continue from. Enables multi-turn conversations without
  resending full message history.
</ParamField>

<ParamField body="tools" type="array">
  A list of custom tools the model may call.
</ParamField>

<ParamField body="tool_choice" type="string | object">
  Controls whether and how the model calls tools. Can be `"auto"`, `"none"`, `"required"`,
  or an object specifying a particular tool.
</ParamField>

<ParamField body="store" type="boolean">
  Whether to store the response server-side so it can be referenced by future requests via
  `previous_response_id`. Defaults to `true`.
</ParamField>

<RequestExample>
  ```python Python theme={null}
  import os
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.routeway.ai/v1",
      api_key=os.getenv("ROUTEWAY_API_KEY")
  )

  response = client.responses.create(
      model="gpt-4o",
      input="What is the capital of France?"
  )

  print(response.output_text)
  ```

  ```javascript Node.js theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://api.routeway.ai/v1",
    apiKey: process.env.ROUTEWAY_API_KEY,
  });

  const response = await client.responses.create({
    model: "gpt-4o",
    input: "What is the capital of France?",
  });

  console.log(response.output_text);
  ```

  ```bash cURL theme={null}
  curl https://api.routeway.ai/v1/responses \
    -H "Authorization: Bearer $ROUTEWAY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-4o",
      "input": "What is the capital of France?"
    }'
  ```
</RequestExample>


## OpenAPI

````yaml POST /v1/responses
openapi: 3.1.0
info:
  title: Routeway API
  version: 1.0.0
servers:
  - url: https://api.routeway.ai
security:
  - HTTPBearer: []
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Create Responses
      description: Generate a unified response block from various input configurations.
      operationId: chat_completions_v1_responses_post
      parameters:
        - name: x-api-key
          in: header
          required: false
          schema:
            type: string
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateResponseBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseResource'
        '400':
          description: Bad Request - Invalid query parameters or body format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - Key does not have permission or is disabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity - Request body validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - Internal error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Bad Gateway - Provider error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateResponseBody:
      properties:
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        input:
          anyOf:
            - items:
                $ref: '#/components/schemas/ItemParam'
              type: array
            - type: string
              maxLength: 10485760
            - type: 'null'
          title: Input
        previous_response_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Response Id
        include:
          anyOf:
            - items:
                $ref: '#/components/schemas/IncludeEnum'
              type: array
            - type: 'null'
          title: Include
        tools:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResponsesToolParam'
              type: array
            - type: 'null'
          title: Tools
        tool_choice:
          anyOf:
            - $ref: '#/components/schemas/ToolChoice'
            - type: 'null'
        text:
          anyOf:
            - $ref: '#/components/schemas/TextParam'
            - type: 'null'
        temperature:
          anyOf:
            - type: number
            - type: 'null'
          title: Temperature
        top_p:
          anyOf:
            - type: number
            - type: 'null'
          title: Top P
        presence_penalty:
          anyOf:
            - type: number
            - type: 'null'
          title: Presence Penalty
        frequency_penalty:
          anyOf:
            - type: number
            - type: 'null'
          title: Frequency Penalty
        parallel_tool_calls:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Parallel Tool Calls
        stream:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Stream
          description: Whether to stream response events as server-sent events.
        background:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Background
          description: Whether to run the request in the background and return immediately.
        max_output_tokens:
          anyOf:
            - type: integer
              minimum: 16
            - type: 'null'
          title: Max Output Tokens
        max_tool_calls:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Tool Calls
        reasoning:
          anyOf:
            - $ref: '#/components/schemas/ReasoningParam'
            - type: 'null'
        prompt_cache_key:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Prompt Cache Key
        truncation:
          anyOf:
            - $ref: '#/components/schemas/TruncationEnum'
            - type: 'null'
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
        store:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Store
          description: Whether to store the response so it can be retrieved later.
        service_tier:
          anyOf:
            - $ref: '#/components/schemas/ServiceTierEnum'
            - type: 'null'
        top_logprobs:
          anyOf:
            - type: integer
              maximum: 20
              minimum: 0
            - type: 'null'
          title: Top Logprobs
      type: object
      title: CreateResponseBody
    ResponseResource:
      properties:
        id:
          type: string
          title: Id
          description: The unique ID of the response that was created.
        object:
          $ref: '#/components/schemas/Object'
          description: The object type, which was always `response`.
        created_at:
          type: integer
          title: Created At
          description: The Unix timestamp (in seconds) for when the response was created.
        completed_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Completed At
        status:
          type: string
          title: Status
          description: The status that was set for the response.
        incomplete_details:
          anyOf:
            - $ref: '#/components/schemas/IncompleteDetails'
            - type: 'null'
        model:
          type: string
          title: Model
          description: The model that generated this response.
        previous_response_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Response Id
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
        output:
          items:
            $ref: '#/components/schemas/ItemField'
          type: array
          title: Output
          description: The output items that were generated by the model.
        error:
          anyOf:
            - $ref: '#/components/schemas/Error1'
            - type: 'null'
        tools:
          items:
            $ref: '#/components/schemas/Tool-Output'
          type: array
          title: Tools
          description: >-
            The tools that were available to the model during response
            generation.
        tool_choice:
          anyOf:
            - $ref: '#/components/schemas/FunctionToolChoice'
            - $ref: '#/components/schemas/ToolChoiceValueEnum'
            - $ref: '#/components/schemas/AllowedToolChoice'
          title: Tool Choice
        truncation:
          $ref: '#/components/schemas/TruncationEnum'
        parallel_tool_calls:
          type: boolean
          title: Parallel Tool Calls
          description: Whether the model was allowed to call multiple tools in parallel.
        text:
          $ref: '#/components/schemas/TextField'
        top_p:
          type: number
          title: Top P
          description: The nucleus sampling parameter that was used for this response.
        presence_penalty:
          type: number
          title: Presence Penalty
          description: >-
            The presence penalty that was used to penalize new tokens based on
            whether they appear in the text so far.
        frequency_penalty:
          type: number
          title: Frequency Penalty
          description: >-
            The frequency penalty that was used to penalize new tokens based on
            their frequency in the text so far.
        top_logprobs:
          type: integer
          title: Top Logprobs
          description: >-
            The number of most likely tokens that were returned at each
            position, along with their log probabilities.
        temperature:
          type: number
          title: Temperature
          description: The sampling temperature that was used for this response.
        reasoning:
          anyOf:
            - $ref: '#/components/schemas/Reasoning'
            - type: 'null'
        usage:
          anyOf:
            - $ref: '#/components/schemas/schemas__responsesv2__Usage'
            - type: 'null'
        max_output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Output Tokens
        max_tool_calls:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Tool Calls
        store:
          type: boolean
          title: Store
          description: Whether this response was stored so it can be retrieved later.
        background:
          type: boolean
          title: Background
          description: Whether this request was run in the background.
        service_tier:
          type: string
          title: Service Tier
          description: The service tier that was used for this response.
        prompt_cache_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt Cache Key
      type: object
      required:
        - id
        - object
        - created_at
        - completed_at
        - status
        - incomplete_details
        - model
        - previous_response_id
        - instructions
        - output
        - error
        - tools
        - tool_choice
        - truncation
        - parallel_tool_calls
        - text
        - top_p
        - presence_penalty
        - frequency_penalty
        - top_logprobs
        - temperature
        - reasoning
        - usage
        - max_output_tokens
        - max_tool_calls
        - store
        - background
        - service_tier
        - prompt_cache_key
      title: ResponseResource
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: ErrorResponse
    ItemParam:
      anyOf:
        - $ref: '#/components/schemas/ItemReferenceParam'
        - $ref: '#/components/schemas/ReasoningItemParam'
        - $ref: '#/components/schemas/CompactionSummaryItemParam'
        - $ref: '#/components/schemas/UserMessageItemParam'
        - $ref: '#/components/schemas/SystemMessageItemParam'
        - $ref: '#/components/schemas/DeveloperMessageItemParam'
        - $ref: '#/components/schemas/AssistantMessageItemParam'
        - $ref: '#/components/schemas/FunctionCallItemParam'
        - $ref: '#/components/schemas/FunctionCallOutputItemParam'
      title: ItemParam
    IncludeEnum:
      type: string
      enum:
        - reasoning.encrypted_content
        - message.output_text.logprobs
      title: IncludeEnum
    ResponsesToolParam:
      anyOf:
        - $ref: '#/components/schemas/FunctionToolParam'
        - additionalProperties: true
          type: object
      title: ResponsesToolParam
    ToolChoice:
      anyOf:
        - $ref: '#/components/schemas/ToolChoice2'
        - $ref: '#/components/schemas/ToolChoice3'
        - $ref: '#/components/schemas/ToolChoice4'
      title: ToolChoice
    TextParam:
      properties:
        format:
          anyOf:
            - $ref: '#/components/schemas/TextFormatParam'
            - type: 'null'
          description: The format configuration for text output.
        verbosity:
          anyOf:
            - $ref: '#/components/schemas/VerbosityEnum'
            - type: 'null'
      type: object
      title: TextParam
    ReasoningParam:
      properties:
        effort:
          anyOf:
            - $ref: '#/components/schemas/ReasoningEffortEnum'
            - type: 'null'
        summary:
          anyOf:
            - $ref: '#/components/schemas/ReasoningSummaryEnum'
            - type: 'null'
      type: object
      title: ReasoningParam
    TruncationEnum:
      type: string
      enum:
        - auto
        - disabled
      title: TruncationEnum
    ServiceTierEnum:
      type: string
      enum:
        - auto
        - default
        - flex
        - priority
      title: ServiceTierEnum
    Object:
      type: string
      enum:
        - response
      title: Object
    IncompleteDetails:
      properties:
        reason:
          type: string
          title: Reason
          description: The reason the response could not be completed.
      type: object
      required:
        - reason
      title: IncompleteDetails
    ItemField:
      anyOf:
        - $ref: '#/components/schemas/Message-Output'
        - $ref: '#/components/schemas/FunctionCall'
        - $ref: '#/components/schemas/FunctionCallOutput'
        - $ref: '#/components/schemas/ReasoningBody'
        - $ref: '#/components/schemas/CompactionBody'
      title: ItemField
    Error1:
      properties:
        code:
          type: string
          title: Code
          description: A machine-readable error code that was returned.
        message:
          type: string
          title: Message
          description: A human-readable description of the error that was returned.
      type: object
      required:
        - code
        - message
      title: Error1
    Tool-Output:
      $ref: '#/components/schemas/FunctionTool'
      title: Tool
    FunctionToolChoice:
      properties:
        type:
          $ref: '#/components/schemas/Type35'
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - type
      title: FunctionToolChoice
    ToolChoiceValueEnum:
      type: string
      enum:
        - none
        - auto
        - required
      title: ToolChoiceValueEnum
    AllowedToolChoice:
      properties:
        type:
          $ref: '#/components/schemas/Type37'
        tools:
          items:
            $ref: '#/components/schemas/FunctionToolChoice'
          type: array
          title: Tools
        mode:
          $ref: '#/components/schemas/ToolChoiceValueEnum'
      type: object
      required:
        - type
        - tools
        - mode
      title: AllowedToolChoice
    TextField:
      properties:
        format:
          anyOf:
            - $ref: '#/components/schemas/TextResponseFormat-Output'
            - $ref: '#/components/schemas/JsonObjectResponseFormat-Output'
            - $ref: '#/components/schemas/JsonSchemaResponseFormat-Output'
          title: Format
        verbosity:
          anyOf:
            - $ref: '#/components/schemas/VerbosityEnum'
            - type: 'null'
      type: object
      required:
        - format
      title: TextField
    Reasoning:
      properties:
        effort:
          anyOf:
            - $ref: '#/components/schemas/ReasoningEffortEnum'
            - type: 'null'
        summary:
          anyOf:
            - $ref: '#/components/schemas/ReasoningSummaryEnum'
            - type: 'null'
      type: object
      required:
        - effort
        - summary
      title: Reasoning
    schemas__responsesv2__Usage:
      properties:
        input_tokens:
          type: integer
          title: Input Tokens
          description: The number of input tokens that were used to generate the response.
        output_tokens:
          type: integer
          title: Output Tokens
          description: The number of output tokens that were generated by the model.
        total_tokens:
          type: integer
          title: Total Tokens
          description: The total number of tokens that were used.
        input_tokens_details:
          $ref: '#/components/schemas/InputTokensDetails'
        output_tokens_details:
          $ref: '#/components/schemas/OutputTokensDetails'
      type: object
      required:
        - input_tokens
        - output_tokens
        - total_tokens
        - input_tokens_details
        - output_tokens_details
      title: Usage
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: A human-readable description of the error.
        type:
          type: string
          title: Type
          description: >-
            The type of error returned (e.g. invalid_request_error,
            rate_limit_error).
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: The parameter that caused the error, if applicable.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            A short code identifier for the error type (e.g. invalid_request,
            rate_limit).
        status_code:
          type: integer
          title: Status Code
          description: The HTTP status code.
        id:
          type: string
          title: Id
          description: Unique error or trace ID associated with this request.
        tip:
          anyOf:
            - type: string
            - type: 'null'
          title: Tip
          description: An optional troubleshooting tip or resolution suggestion.
        docs:
          anyOf:
            - type: string
            - type: 'null'
          title: Docs
          description: Link to the documentation related to this error.
          default: https://docs.routeway.ai
        support:
          anyOf:
            - type: string
            - type: 'null'
          title: Support
          description: Link to support for further help.
          default: https://discord.gg/RjX2CpdPpd
        community:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Community
          description: Links to community resources like Discord and Twitter.
      type: object
      required:
        - message
        - type
        - status_code
        - id
      title: ErrorDetail
    ItemReferenceParam:
      properties:
        type:
          type: string
          const: item_reference
          title: Type
          description: The item type. Always `item_reference`.
        id:
          type: string
          title: Id
          description: The ID of the item to reference.
      type: object
      required:
        - type
        - id
      title: ItemReferenceParam
    ReasoningItemParam:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        type:
          type: string
          const: reasoning
          title: Type
          description: The item type. Always `reasoning`.
        summary:
          items:
            $ref: '#/components/schemas/ReasoningSummaryContentParam'
          type: array
          title: Summary
          description: Reasoning summary content associated with this item.
        content:
          type: 'null'
          title: Content
        encrypted_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Encrypted Content
      type: object
      required:
        - type
        - summary
      title: ReasoningItemParam
    CompactionSummaryItemParam:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        type:
          type: string
          const: compaction
          title: Type
          description: The type of the item. Always `compaction`.
        encrypted_content:
          type: string
          maxLength: 10485760
          title: Encrypted Content
          description: The encrypted content of the compaction summary.
      type: object
      required:
        - type
        - encrypted_content
      title: CompactionSummaryItemParam
    UserMessageItemParam:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        type:
          type: string
          const: message
          title: Type
          default: message
        role:
          $ref: '#/components/schemas/Role'
          description: The message role. Always `user`.
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/Content'
              type: array
            - type: string
              maxLength: 10485760
          title: Content
          description: The message content, as an array of content parts.
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      required:
        - role
        - content
      title: UserMessageItemParam
    SystemMessageItemParam:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        type:
          type: string
          const: message
          title: Type
          default: message
        role:
          $ref: '#/components/schemas/Role1'
          description: The message role. Always `system`.
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/Content1'
              type: array
            - type: string
              maxLength: 10485760
          title: Content
          description: The message content, as an array of content parts.
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      required:
        - role
        - content
      title: SystemMessageItemParam
    DeveloperMessageItemParam:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        type:
          type: string
          const: message
          title: Type
          default: message
        role:
          $ref: '#/components/schemas/Role2'
          description: The message role. Always `developer`.
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/Content1'
              type: array
            - type: string
              maxLength: 10485760
          title: Content
          description: The message content, as an array of content parts.
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      required:
        - role
        - content
      title: DeveloperMessageItemParam
    AssistantMessageItemParam:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        type:
          type: string
          const: message
          title: Type
          default: message
        role:
          $ref: '#/components/schemas/Role3'
          description: The role of the message author. Always `assistant`.
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/Content3'
              type: array
            - type: string
              maxLength: 10485760
          title: Content
          description: The message content, as an array of content parts.
        phase:
          anyOf:
            - $ref: '#/components/schemas/Phase'
            - type: 'null'
          description: >-
            Labels an `assistant` message as intermediate commentary
            (`commentary`) or the final answer (`final_answer`). For models like
            `gpt-5.3-codex` and beyond, when sending follow-up requests,
            preserve and resend phase on all assistant messages. Omitting it can
            degrade performance. Not used for user messages.
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      required:
        - role
        - content
      title: AssistantMessageItemParam
    FunctionCallItemParam:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        call_id:
          type: string
          maxLength: 64
          minLength: 1
          title: Call Id
          description: The unique ID of the function tool call generated by the model.
        type:
          type: string
          const: function_call
          title: Type
          description: The item type. Always `function_call`.
        name:
          type: string
          maxLength: 64
          minLength: 1
          pattern: ^[a-zA-Z0-9_-]+$
          title: Name
          description: The name of the function to call.
        arguments:
          type: string
          title: Arguments
          description: The function arguments as a JSON string.
        status:
          anyOf:
            - $ref: '#/components/schemas/FunctionCallStatus'
            - type: 'null'
      type: object
      required:
        - call_id
        - type
        - name
        - arguments
      title: FunctionCallItemParam
    FunctionCallOutputItemParam:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        call_id:
          type: string
          maxLength: 64
          minLength: 1
          title: Call Id
          description: The unique ID of the function tool call generated by the model.
        type:
          type: string
          const: function_call_output
          title: Type
          description: >-
            The type of the function tool call output. Always
            `function_call_output`.
        output:
          anyOf:
            - type: string
              maxLength: 10485760
            - items:
                $ref: '#/components/schemas/Output'
              type: array
          title: Output
          description: Text, image, or file output of the function tool call.
        status:
          anyOf:
            - $ref: '#/components/schemas/FunctionCallStatus'
            - type: 'null'
      type: object
      required:
        - call_id
        - type
        - output
      title: FunctionCallOutputItemParam
    FunctionToolParam:
      properties:
        name:
          type: string
          maxLength: 64
          minLength: 1
          pattern: ^[a-zA-Z0-9_-]+$
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
        type:
          $ref: '#/components/schemas/Type16'
      type: object
      required:
        - name
        - type
      title: FunctionToolParam
    ToolChoice2:
      properties: {}
      type: object
      title: ToolChoice2
    ToolChoice3:
      type: string
      enum:
        - none
        - auto
        - required
      title: ToolChoice3
    ToolChoice4:
      properties:
        type:
          $ref: '#/components/schemas/Type18'
          description: The tool choice type. Always `allowed_tools`.
        tools:
          items:
            $ref: '#/components/schemas/SpecificToolChoiceParam'
          type: array
          maxItems: 128
          minItems: 1
          title: Tools
          description: The list of tools that are permitted for this request.
        mode:
          anyOf:
            - $ref: '#/components/schemas/ToolChoiceValueEnum'
            - type: 'null'
      type: object
      required:
        - type
        - tools
      title: ToolChoice4
    TextFormatParam:
      anyOf:
        - $ref: '#/components/schemas/schemas__responsesv2__TextResponseFormat'
        - $ref: '#/components/schemas/JsonSchemaResponseFormatParam'
      title: TextFormatParam
    VerbosityEnum:
      type: string
      enum:
        - low
        - medium
        - high
      title: VerbosityEnum
    ReasoningEffortEnum:
      type: string
      enum:
        - none
        - low
        - medium
        - high
        - xhigh
      title: ReasoningEffortEnum
    ReasoningSummaryEnum:
      type: string
      enum:
        - concise
        - detailed
        - auto
      title: ReasoningSummaryEnum
    Message-Output:
      properties:
        type:
          type: string
          const: message
          title: Type
          description: The type of the message. Always set to `message`.
        id:
          type: string
          title: Id
          description: The unique ID of the message.
        status:
          $ref: '#/components/schemas/MessageStatus'
        role:
          $ref: '#/components/schemas/MessageRole'
        content:
          items:
            $ref: '#/components/schemas/Content4'
          type: array
          title: Content
          description: The content of the message
        phase:
          anyOf:
            - $ref: '#/components/schemas/Phase'
            - type: 'null'
          description: >-
            Labels an `assistant` message as intermediate commentary
            (`commentary`) or the final answer (`final_answer`). For models like
            `gpt-5.3-codex` and beyond, when sending follow-up requests,
            preserve and resend phase on all assistant messages. Omitting it can
            degrade performance. Not used for user messages.
      type: object
      required:
        - type
        - id
        - status
        - role
        - content
      title: Message
    FunctionCall:
      properties:
        type:
          type: string
          const: function_call
          title: Type
          description: The type of the item. Always `function_call`.
        id:
          type: string
          title: Id
          description: The unique ID of the function call item.
        call_id:
          type: string
          title: Call Id
          description: The unique ID of the function tool call that was generated.
        name:
          type: string
          title: Name
          description: The name of the function that was called.
        arguments:
          type: string
          title: Arguments
          description: The arguments JSON string that was generated.
        status:
          $ref: '#/components/schemas/FunctionCallStatus'
      type: object
      required:
        - type
        - id
        - call_id
        - name
        - arguments
        - status
      title: FunctionCall
    FunctionCallOutput:
      properties:
        type:
          type: string
          const: function_call_output
          title: Type
          description: >-
            The type of the function tool call output. Always
            `function_call_output`.
        id:
          type: string
          title: Id
          description: >-
            The unique ID of the function tool call output. Populated when this
            item is returned via API.
        call_id:
          type: string
          title: Call Id
          description: The unique ID of the function tool call generated by the model.
        output:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/Output1'
              type: array
          title: Output
        status:
          $ref: '#/components/schemas/FunctionCallOutputStatusEnum'
      type: object
      required:
        - type
        - id
        - call_id
        - output
        - status
      title: FunctionCallOutput
    ReasoningBody:
      properties:
        type:
          type: string
          const: reasoning
          title: Type
          description: The type of the item. Always `reasoning`.
        id:
          type: string
          title: Id
          description: The unique ID of the reasoning item.
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/Content5'
              type: array
            - type: 'null'
          title: Content
          description: The reasoning content that was generated.
        summary:
          items:
            $ref: '#/components/schemas/Summary'
          type: array
          title: Summary
          description: The reasoning summary content that was generated.
        encrypted_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Encrypted Content
          description: The encrypted reasoning content that was generated.
      type: object
      required:
        - type
        - id
        - summary
      title: ReasoningBody
    CompactionBody:
      properties:
        type:
          type: string
          const: compaction
          title: Type
          description: The type of the item. Always `compaction`.
        id:
          type: string
          title: Id
          description: The unique ID of the compaction item.
        encrypted_content:
          type: string
          title: Encrypted Content
          description: The encrypted content that was produced by compaction.
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: The identifier of the actor that created the item.
      type: object
      required:
        - type
        - id
        - encrypted_content
      title: CompactionBody
    FunctionTool:
      properties:
        type:
          $ref: '#/components/schemas/Type35'
          description: The type of the function tool. Always `function`.
        name:
          type: string
          title: Name
          description: The name of the function to call.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
      type: object
      required:
        - type
        - name
        - description
        - parameters
        - strict
      title: FunctionTool
    Type35:
      type: string
      enum:
        - function
      title: Type35
    Type37:
      type: string
      enum:
        - allowed_tools
      title: Type37
    TextResponseFormat-Output:
      properties:
        type:
          $ref: '#/components/schemas/Type38'
      type: object
      required:
        - type
      title: TextResponseFormat
    JsonObjectResponseFormat-Output:
      properties:
        type:
          $ref: '#/components/schemas/Type39'
      type: object
      required:
        - type
      title: JsonObjectResponseFormat
    JsonSchemaResponseFormat-Output:
      properties:
        type:
          $ref: '#/components/schemas/Type40'
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        schema:
          type: 'null'
          title: Schema
        strict:
          type: boolean
          title: Strict
      type: object
      required:
        - type
        - name
        - description
        - schema
        - strict
      title: JsonSchemaResponseFormat
    InputTokensDetails:
      properties:
        cached_tokens:
          type: integer
          title: Cached Tokens
          description: The number of input tokens that were served from cache.
      type: object
      required:
        - cached_tokens
      title: InputTokensDetails
    OutputTokensDetails:
      properties:
        reasoning_tokens:
          type: integer
          title: Reasoning Tokens
          description: The number of output tokens that were attributed to reasoning.
      type: object
      required:
        - reasoning_tokens
      title: OutputTokensDetails
    ReasoningSummaryContentParam:
      properties:
        type:
          $ref: '#/components/schemas/Type1'
          description: The content type. Always `summary_text`.
        text:
          type: string
          maxLength: 10485760
          title: Text
          description: The reasoning summary text.
      type: object
      required:
        - type
        - text
      title: ReasoningSummaryContentParam
    Role:
      type: string
      enum:
        - user
      title: Role
    Content:
      anyOf:
        - $ref: '#/components/schemas/InputTextContentParam'
        - $ref: '#/components/schemas/InputImageContentParamAutoParam'
        - $ref: '#/components/schemas/InputFileContentParam'
      title: Content
    Role1:
      type: string
      enum:
        - system
      title: Role1
    Content1:
      $ref: '#/components/schemas/InputTextContentParam'
      title: Content1
    Role2:
      type: string
      enum:
        - developer
      title: Role2
    Role3:
      type: string
      enum:
        - assistant
      title: Role3
    Content3:
      anyOf:
        - $ref: '#/components/schemas/OutputTextContentParam'
        - $ref: '#/components/schemas/RefusalContentParam'
      title: Content3
    Phase:
      type: string
      enum:
        - commentary
        - final_answer
      title: Phase
    FunctionCallStatus:
      type: string
      enum:
        - in_progress
        - completed
        - incomplete
      title: FunctionCallStatus
    Output:
      anyOf:
        - $ref: '#/components/schemas/InputTextContentParam'
        - $ref: '#/components/schemas/InputImageContentParamAutoParam'
        - $ref: '#/components/schemas/InputFileContentParam'
        - $ref: '#/components/schemas/InputVideoContent'
      title: Output
    Type16:
      type: string
      enum:
        - function
      title: Type16
    Type18:
      type: string
      enum:
        - allowed_tools
      title: Type18
    SpecificToolChoiceParam:
      $ref: '#/components/schemas/SpecificFunctionParam'
      title: SpecificToolChoiceParam
    schemas__responsesv2__TextResponseFormat:
      properties:
        type:
          $ref: '#/components/schemas/Type38'
      type: object
      required:
        - type
      title: TextResponseFormat
    JsonSchemaResponseFormatParam:
      properties:
        type:
          anyOf:
            - $ref: '#/components/schemas/Type66'
            - type: 'null'
          description: The type of response format being defined. Always `json_schema`.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: >
            A description of what the response format is for, used by the model
            to

            determine how to respond in the format.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: |
            The name of the response format. Must be a-z, A-Z, 0-9, or contain
            underscores and dashes, with a maximum length of 64.
        schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: JSON schema
          description: >
            The schema for the response format, described as a JSON Schema
            object.
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
      type: object
      title: JsonSchemaResponseFormatParam
    MessageStatus:
      type: string
      enum:
        - in_progress
        - completed
        - incomplete
      title: MessageStatus
    MessageRole:
      type: string
      enum:
        - user
        - assistant
        - system
        - developer
      title: MessageRole
    Content4:
      anyOf:
        - $ref: '#/components/schemas/InputTextContent'
        - $ref: '#/components/schemas/OutputTextContent'
        - $ref: '#/components/schemas/TextContent-Output'
        - $ref: '#/components/schemas/SummaryTextContent'
        - $ref: '#/components/schemas/ReasoningTextContent'
        - $ref: '#/components/schemas/RefusalContent'
        - $ref: '#/components/schemas/InputImageContent'
        - $ref: '#/components/schemas/InputFileContent'
        - $ref: '#/components/schemas/InputVideoContent'
      title: Content4
    Output1:
      anyOf:
        - $ref: '#/components/schemas/InputTextContent'
        - $ref: '#/components/schemas/InputImageContent'
        - $ref: '#/components/schemas/InputFileContent'
      title: Output1
    FunctionCallOutputStatusEnum:
      type: string
      enum:
        - in_progress
        - completed
        - incomplete
      title: FunctionCallOutputStatusEnum
    Content5:
      anyOf:
        - $ref: '#/components/schemas/InputTextContent'
        - $ref: '#/components/schemas/OutputTextContent'
        - $ref: '#/components/schemas/TextContent-Output'
        - $ref: '#/components/schemas/SummaryTextContent'
        - $ref: '#/components/schemas/ReasoningTextContent'
        - $ref: '#/components/schemas/RefusalContent'
        - $ref: '#/components/schemas/InputImageContent'
        - $ref: '#/components/schemas/InputFileContent'
      title: Content5
    Summary:
      anyOf:
        - $ref: '#/components/schemas/InputTextContent'
        - $ref: '#/components/schemas/OutputTextContent'
        - $ref: '#/components/schemas/TextContent-Output'
        - $ref: '#/components/schemas/SummaryTextContent'
        - $ref: '#/components/schemas/ReasoningTextContent'
        - $ref: '#/components/schemas/RefusalContent'
        - $ref: '#/components/schemas/InputImageContent'
        - $ref: '#/components/schemas/InputFileContent'
      title: Summary
    Type38:
      type: string
      enum:
        - text
      title: Type38
    Type39:
      type: string
      enum:
        - json_object
      title: Type39
    Type40:
      type: string
      enum:
        - json_schema
      title: Type40
    Type1:
      type: string
      enum:
        - summary_text
      title: Type1
    InputTextContentParam:
      properties:
        type:
          type: string
          const: input_text
          title: Type
          description: The type of the input item. Always `input_text`.
        text:
          type: string
          maxLength: 10485760
          title: Text
          description: The text input to the model.
      type: object
      required:
        - type
        - text
      title: InputTextContentParam
    InputImageContentParamAutoParam:
      properties:
        type:
          type: string
          const: input_image
          title: Type
          description: The type of the input item. Always `input_image`.
        image_url:
          anyOf:
            - type: string
              maxLength: 20971520
            - type: 'null'
          title: Image Url
        detail:
          anyOf:
            - $ref: '#/components/schemas/ImageDetail'
            - type: 'null'
      type: object
      required:
        - type
      title: InputImageContentParamAutoParam
    InputFileContentParam:
      properties:
        type:
          type: string
          const: input_file
          title: Type
          description: The type of the input item. Always `input_file`.
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        file_data:
          anyOf:
            - type: string
              maxLength: 33554432
            - type: 'null'
          title: File Data
        file_url:
          anyOf:
            - type: string
            - type: 'null'
          title: File Url
      type: object
      required:
        - type
      title: InputFileContentParam
    OutputTextContentParam:
      properties:
        type:
          type: string
          const: output_text
          title: Type
          description: The content type. Always `output_text`.
        text:
          type: string
          maxLength: 10485760
          title: Text
          description: The text content.
        annotations:
          anyOf:
            - items:
                $ref: '#/components/schemas/UrlCitationParam'
              type: array
            - type: 'null'
          title: Annotations
          description: Citations associated with the text content.
      type: object
      required:
        - type
        - text
      title: OutputTextContentParam
    RefusalContentParam:
      properties:
        type:
          type: string
          const: refusal
          title: Type
          description: The content type. Always `refusal`.
        refusal:
          type: string
          maxLength: 10485760
          title: Refusal
          description: The refusal text.
      type: object
      required:
        - type
        - refusal
      title: RefusalContentParam
    InputVideoContent:
      properties:
        type:
          type: string
          const: input_video
          title: Type
          description: The type of the input content. Always `input_video`.
        video_url:
          type: string
          title: Video Url
          description: A base64 or remote url that resolves to a video file.
      type: object
      required:
        - type
        - video_url
      title: InputVideoContent
    SpecificFunctionParam:
      properties:
        type:
          $ref: '#/components/schemas/Type16'
          description: The tool to call. Always `function`.
        name:
          type: string
          title: Name
          description: The name of the function tool to call.
      type: object
      required:
        - type
        - name
      title: SpecificFunctionParam
    Type66:
      type: string
      enum:
        - json_schema
      title: Type66
    InputTextContent:
      properties:
        type:
          type: string
          const: input_text
          title: Type
          description: The type of the input item. Always `input_text`.
        text:
          type: string
          title: Text
          description: The text input to the model.
      type: object
      required:
        - type
        - text
      title: InputTextContent
    OutputTextContent:
      properties:
        type:
          type: string
          const: output_text
          title: Type
          description: The type of the output text. Always `output_text`.
        text:
          type: string
          title: Text
          description: The text output from the model.
        annotations:
          items:
            $ref: '#/components/schemas/Annotation'
          type: array
          title: Annotations
          description: The annotations of the text output.
        logprobs:
          anyOf:
            - items:
                $ref: '#/components/schemas/LogProb'
              type: array
            - type: 'null'
          title: Logprobs
      type: object
      required:
        - type
        - text
        - annotations
      title: OutputTextContent
    TextContent-Output:
      properties:
        type:
          type: string
          const: text
          title: Type
        text:
          type: string
          title: Text
      type: object
      required:
        - type
        - text
      title: TextContent
    SummaryTextContent:
      properties:
        type:
          type: string
          const: summary_text
          title: Type
          description: The type of the object. Always `summary_text`.
        text:
          type: string
          title: Text
          description: A summary of the reasoning output from the model so far.
      type: object
      required:
        - type
        - text
      title: SummaryTextContent
    ReasoningTextContent:
      properties:
        type:
          type: string
          const: reasoning_text
          title: Type
          description: The type of the reasoning text. Always `reasoning_text`.
        text:
          type: string
          title: Text
          description: The reasoning text from the model.
      type: object
      required:
        - type
        - text
      title: ReasoningTextContent
    RefusalContent:
      properties:
        type:
          type: string
          const: refusal
          title: Type
          description: The type of the refusal. Always `refusal`.
        refusal:
          type: string
          title: Refusal
          description: The refusal explanation from the model.
      type: object
      required:
        - type
        - refusal
      title: RefusalContent
    InputImageContent:
      properties:
        type:
          type: string
          const: input_image
          title: Type
          description: The type of the input item. Always `input_image`.
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        detail:
          $ref: '#/components/schemas/ImageDetail'
      type: object
      required:
        - type
        - image_url
        - detail
      title: InputImageContent
    InputFileContent:
      properties:
        type:
          type: string
          const: input_file
          title: Type
          description: The type of the input item. Always `input_file`.
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
          description: The name of the file to be sent to the model.
        file_url:
          anyOf:
            - type: string
            - type: 'null'
          title: File Url
          description: The URL of the file to be sent to the model.
      type: object
      required:
        - type
      title: InputFileContent
    ImageDetail:
      type: string
      enum:
        - low
        - high
        - auto
      title: ImageDetail
    UrlCitationParam:
      properties:
        type:
          $ref: '#/components/schemas/Type10'
          description: The citation type. Always `url_citation`.
        start_index:
          type: integer
          minimum: 0
          title: Start Index
          description: The index of the first character of the citation in the message.
        end_index:
          type: integer
          minimum: 0
          title: End Index
          description: The index of the last character of the citation in the message.
        url:
          type: string
          title: Url
          description: The URL of the cited resource.
        title:
          type: string
          title: Title
          description: The title of the cited resource.
      type: object
      required:
        - type
        - start_index
        - end_index
        - url
        - title
      title: UrlCitationParam
    Annotation:
      $ref: '#/components/schemas/UrlCitationBody'
      title: Annotation
    LogProb:
      properties:
        token:
          type: string
          title: Token
        logprob:
          type: number
          title: Logprob
        bytes:
          items:
            type: integer
          type: array
          title: Bytes
        top_logprobs:
          items:
            $ref: '#/components/schemas/TopLogProb'
          type: array
          title: Top Logprobs
      type: object
      required:
        - token
        - logprob
        - bytes
        - top_logprobs
      title: LogProb
    Type10:
      type: string
      enum:
        - url_citation
      title: Type10
    UrlCitationBody:
      properties:
        type:
          $ref: '#/components/schemas/Type22'
          description: The type of the URL citation. Always `url_citation`.
        url:
          type: string
          title: Url
          description: The URL of the web resource.
        start_index:
          type: integer
          title: Start Index
          description: The index of the first character of the URL citation in the message.
        end_index:
          type: integer
          title: End Index
          description: The index of the last character of the URL citation in the message.
        title:
          type: string
          title: Title
          description: The title of the web resource.
      type: object
      required:
        - type
        - url
        - start_index
        - end_index
        - title
      title: UrlCitationBody
    TopLogProb:
      properties:
        token:
          type: string
          title: Token
        logprob:
          type: number
          title: Logprob
        bytes:
          items:
            type: integer
          type: array
          title: Bytes
      type: object
      required:
        - token
        - logprob
        - bytes
      title: TopLogProb
    Type22:
      type: string
      enum:
        - url_citation
      title: Type22
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````