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

# Invoke an agent

> Creates a model response for the given input. Returns a response object or a stream of server-sent events.

Invoke an **Agent** with the [Responses API](/reference/responses/create-response) by setting `model` to `agent/<key>`. The agent's configured model, tools, knowledge bases, and memory apply automatically, so the request only needs to provide the input.

This endpoint implements the [OpenResponses](https://www.openresponses.org/) specification, a multi-provider, interoperable LLM interface. **Orq.ai** extends the spec with platform features like variables, memory, identity, and **Orq.ai** tools.

For a comprehensive guide with examples, see the [Run Agents documentation](/docs/ai-studio/ai-engineering/run-agents) and the [Responses API documentation](/docs/agents/responses-api).

<RequestExample>
  ```bash Simple text theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST https://api.orq.ai/v3/router/responses \
    -H "Authorization: Bearer $ORQ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "agent/my-agent",
      "input": "Help me plan a microservices architecture for our e-commerce platform."
    }'
  ```

  ```bash Image input theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST https://api.orq.ai/v3/router/responses \
    -H "Authorization: Bearer $ORQ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "agent/image-classifier",
      "input": [
        {
          "type": "message",
          "role": "user",
          "content": [
            { "type": "input_text", "text": "What can you see in this image?" },
            {
              "type": "input_image",
              "image_url": "https://example.com/image.jpg",
              "detail": "auto"
            }
          ]
        }
      ]
    }'
  ```

  ```bash Variables theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST https://api.orq.ai/v3/router/responses \
    -H "Authorization: Bearer $ORQ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "agent/my-agent",
      "input": "I need help with my account.",
      "variables": {
        "user_name": "John Smith",
        "user_role": "admin",
        "api_token": { "secret": true, "value": "sk-secret-123" }
      }
    }'
  ```

  ```bash Memory theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST https://api.orq.ai/v3/router/responses \
    -H "Authorization: Bearer $ORQ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "agent/agent-memories",
      "input": "Do you remember what my name is?",
      "memory": {
        "entity_id": "customer_456"
      }
    }'
  ```

  ```bash Streaming theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST https://api.orq.ai/v3/router/responses \
    -H "Authorization: Bearer $ORQ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "agent/my-agent",
      "input": "Help me plan a microservices architecture for our e-commerce platform.",
      "stream": true
    }'
  ```

  ```bash Multi-turn theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST https://api.orq.ai/v3/router/responses \
    -H "Authorization: Bearer $ORQ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "agent/my-agent",
      "previous_response_id": "resp_01KP6DFC5FB7K7K10TVP60PF81",
      "input": "Can you expand on the challenges section?"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Simple text theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "resp_01KP6DFC5FB7K7K10TVP60PF81",
    "object": "response",
    "created_at": 1776184439,
    "completed_at": 1776184439,
    "status": "completed",
    "model": "agent/my-agent",
    "output": [
      {
        "type": "message",
        "id": "msg_01KP6DFCG3RF80BEBXP06XX258",
        "role": "assistant",
        "status": "completed",
        "content": [
          {
            "type": "output_text",
            "text": "Here's a microservices architecture for your e-commerce platform: start with a catalog service, a cart service, an order service, and a payment service, each owning its own database.",
            "annotations": []
          }
        ]
      }
    ],
    "usage": {
      "input_tokens": 120,
      "output_tokens": 340,
      "total_tokens": 460,
      "input_tokens_details": {
        "cached_tokens": 0,
        "cache_creation_tokens": 0
      },
      "output_tokens_details": {
        "reasoning_tokens": 0
      },
      "input_cost": 0.0003,
      "output_cost": 0.00204,
      "total_cost": 0.00234
    }
  }
  ```

  ```json Image input theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "resp_01KP6EJD020945A3WCBMD581RH",
    "object": "response",
    "created_at": 1776185587,
    "completed_at": 1776185591,
    "status": "completed",
    "model": "agent/image-classifier",
    "input": [
      {
        "type": "message",
        "role": "user",
        "content": [
          { "type": "input_text", "text": "What can you see in this image?" },
          { "type": "input_image", "image_url": "https://example.com/image.jpg", "detail": "auto" }
        ]
      }
    ],
    "output": [
      {
        "type": "message",
        "id": "msg_01KP6EJJ7FKC0SDWVBEC626TCM",
        "role": "assistant",
        "status": "completed",
        "content": [
          {
            "type": "output_text",
            "text": "The image shows a city skyline at dusk, with several high-rise buildings and a river in the foreground.",
            "annotations": []
          }
        ]
      }
    ],
    "usage": {
      "input_tokens": 8514,
      "output_tokens": 24,
      "total_tokens": 8538
    }
  }
  ```

  ```json Variables theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "resp_01KP6GDRS1FY0VW4V77GTK9P7G",
    "object": "response",
    "created_at": 1776185700,
    "completed_at": 1776185701,
    "status": "completed",
    "model": "agent/my-agent",
    "output": [
      {
        "type": "message",
        "id": "msg_01KP6GDS6TK09C7RM7GKAFPQ1Z",
        "role": "assistant",
        "status": "completed",
        "content": [
          {
            "type": "output_text",
            "text": "Hi John, I can see you have an admin account. What would you like help with?",
            "annotations": []
          }
        ]
      }
    ],
    "variables": {
      "user_name": "John Smith",
      "user_role": "admin"
    },
    "usage": {
      "input_tokens": 95,
      "output_tokens": 24,
      "total_tokens": 119
    }
  }
  ```

  ```json Memory theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "resp_01KP6H2N8QF4Z0RB7M9KCV3PXA",
    "object": "response",
    "created_at": 1776186000,
    "completed_at": 1776186001,
    "status": "completed",
    "model": "agent/agent-memories",
    "output": [
      {
        "type": "message",
        "id": "msg_01KP6H2NJ7KC0SDWVBEC992RTM",
        "role": "assistant",
        "status": "completed",
        "content": [
          {
            "type": "output_text",
            "text": "Yes, your name is John. How can I help you today?",
            "annotations": []
          }
        ]
      }
    ],
    "usage": {
      "input_tokens": 142,
      "output_tokens": 18,
      "total_tokens": 160
    }
  }
  ```

  ```text Streaming (SSE) theme={"theme":{"light":"github-light","dark":"github-dark"}}
  event: response.created
  data: {"type":"response.created","sequence_number":1,
    "response":{"id":"resp_01KP6E957P5VF...","status":"in_progress",...}}

  event: response.in_progress
  data: {"type":"response.in_progress","sequence_number":2,...}

  event: response.output_item.added
  data: {"type":"response.output_item.added","sequence_number":3,
    "output_index":0,
    "item":{"id":"msg_01kp6e95fs...","type":"message","role":"assistant","content":[]}}

  event: response.content_part.added
  data: {"type":"response.content_part.added","sequence_number":4,
    "item_id":"msg_01kp6e95fs...","output_index":0,"content_index":0,
    "part":{"type":"output_text","text":""}}

  event: response.output_text.delta
  data: {"type":"response.output_text.delta","sequence_number":5,
    "item_id":"msg_01kp6e95fs...","output_index":0,"content_index":0,
    "delta":"Here's a microservices architecture"}

  event: response.output_text.delta
  data: {"type":"response.output_text.delta","sequence_number":6,
    "item_id":"msg_01kp6e95fs...","output_index":0,"content_index":0,
    "delta":" for your e-commerce platform."}

  event: response.output_text.done
  data: {"type":"response.output_text.done","sequence_number":7,
    "item_id":"msg_01kp6e95fs...","output_index":0,"content_index":0,
    "text":"Here's a microservices architecture for your e-commerce platform."}

  event: response.output_item.done
  data: {"type":"response.output_item.done","sequence_number":8,
    "output_index":0,
    "item":{"type":"message","role":"assistant","status":"completed",
      "content":[{"type":"output_text","text":"Here's a microservices architecture for your e-commerce platform.","annotations":[]}]}}

  event: response.completed
  data: {"type":"response.completed","sequence_number":9,
    "response":{"id":"resp_01KP6E957P5VF...","status":"completed",
      "usage":{"input_tokens":120,"output_tokens":340,"total_tokens":460}}}

  event: done
  data: [DONE]
  ```

  ```json Multi-turn theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "id": "resp_01KP6ENF391202692JCGD6YBM5",
    "object": "response",
    "created_at": 1776185687,
    "completed_at": 1776185687,
    "status": "completed",
    "model": "agent/my-agent",
    "previous_response_id": "resp_01KP6DFC5FB7K7K10TVP60PF81",
    "input": [
      {
        "type": "message",
        "id": "msg_01KP6DFXWPKZ12AS254YKHRA8R",
        "role": "user",
        "content": [{ "type": "input_text", "text": "Can you expand on the challenges section?" }]
      }
    ],
    "output": [
      {
        "type": "message",
        "id": "msg_01KP6ENFR9G5G69TTE5AD9W65W",
        "role": "assistant",
        "status": "completed",
        "content": [
          {
            "type": "output_text",
            "text": "The main challenges are distributed transactions across services, eventual consistency between the order and payment services, and the operational overhead of running and monitoring each service independently.",
            "annotations": []
          }
        ]
      }
    ],
    "usage": {
      "input_tokens": 460,
      "output_tokens": 88,
      "total_tokens": 548
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml post /v3/router/responses
openapi: 3.1.0
info:
  title: orq.ai API
  version: '2.0'
  description: orq.ai API documentation
servers:
  - url: https://api.orq.ai
security:
  - ApiKey: []
tags:
  - description: List models available through the AI Router.
    name: Models
  - name: Guardrail Rules
  - name: Policies
  - name: Routing Rules
  - name: API keys
    description: >-
      API keys authenticate programmatic access to the workspace. The unified
      key model exposes opaque tokens, per-domain access grants, and budget /
      rate-limit constraints (see ADR 0001 and ADR 0002).
  - name: Budgets
    description: >-
      Budgets govern spend, token usage, and request rate across six scopes:
      workspace, project, identity, api-key, provider, and model. A budget is
      hierarchical and defense-in-depth — every applicable budget is a hard
      gate, and the most restrictive one wins per dimension (see ADR 0007).
  - name: Documentation
    description: >-
      Search the orq.ai documentation. Proxies the workspace's query to the
      hosted docs search index.
  - name: Files
    description: File upload and retrieval operations.
  - name: Identities
    description: >-
      Identities represent end users from your system for usage and engagement
      tracking.
  - name: Projects
    description: Projects organize resources within a workspace
  - name: Skills
    description: >-
      Skills are modular instructions you can use to codify processes and
      conventions
  - name: Responses
  - description: >-
      Run agents on a cadence — cron, interval, or one-off. Minimum firing
      interval is 1 hour.
    name: Agent Schedules
  - name: Embeddings
  - name: Reporting
    description: >-
      GenAI reporting API over canonical analytics rollups. Accepts a metric
      name, time range, grain, group-by, and filters; returns a typed time
      series and optional totals.
externalDocs:
  url: https://docs.orq.ai
  description: orq.ai Documentation
paths:
  /v3/router/responses:
    post:
      tags:
        - Responses
      summary: Create response
      description: >-
        Creates a model response for the given input. Returns a response object
        or a stream of server-sent events.
      operationId: create-router-response
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                cache_control:
                  description: >-
                    Top-level cache control automatically applies a
                    cache_control marker to the last cacheable block in the
                    request.
                  properties:
                    ttl:
                      default: 5m
                      description: >-
                        The time-to-live for the cache control breakpoint. This
                        may be one of the following values:


                        - `5m`: 5 minutes

                        - `1h`: 1 hour


                        Defaults to `5m`. Only supported by Anthropic Claude
                        models.
                      enum:
                        - 5m
                        - 1h
                      type: string
                    type:
                      description: >-
                        Create a cache control breakpoint. Accepts only the
                        value "ephemeral".
                      enum:
                        - ephemeral
                      type: string
                  required:
                    - type
                  title: Cache control
                  type: object
                conversation:
                  $ref: '#/components/schemas/ConversationParam'
                  description: Conversation context for multi-turn interactions.
                fallbacks:
                  description: >-
                    Fallback models to try if the primary model fails. Each
                    entry specifies a model in provider/model format.
                  items:
                    $ref: '#/components/schemas/FallbackConfig'
                  type:
                    - array
                    - 'null'
                frequency_penalty:
                  description: >-
                    Penalize new tokens based on their frequency in the text so
                    far. Between -2.0 and 2.0.
                  format: double
                  type: number
                guardrails:
                  description: Guardrails to evaluate the request against.
                  items:
                    $ref: '#/components/schemas/EvaluatorRef'
                  type: array
                identity:
                  $ref: '#/components/schemas/ResponseIdentity'
                  description: Identity/contact information for the end-user.
                input:
                  anyOf:
                    - description: A simple text string as input.
                      title: Text
                      type: string
                    - description: An array of input items.
                      items:
                        description: >-
                          An input item. The "type" field determines the item
                          kind: "message", "function_call_output",
                          "item_reference", etc.
                        properties:
                          call_id:
                            description: >-
                              The ID of the function call being responded to
                              (for function_call_output type).
                            type: string
                          content:
                            anyOf:
                              - title: Text
                                type: string
                              - items:
                                  anyOf:
                                    - description: A text content part.
                                      properties:
                                        cache_control:
                                          properties:
                                            ttl:
                                              default: 5m
                                              description: >-
                                                The time-to-live for the cache control
                                                breakpoint. This may be one of the
                                                following values:


                                                - `5m`: 5 minutes

                                                - `1h`: 1 hour


                                                Defaults to `5m`. Only supported by
                                                Anthropic Claude models.
                                              enum:
                                                - 5m
                                                - 1h
                                              type: string
                                            type:
                                              type: string
                                              enum:
                                                - ephemeral
                                              description: >-
                                                Create a cache control breakpoint at
                                                this content block. Accepts only the
                                                value "ephemeral".
                                          required:
                                            - type
                                          title: Cache control
                                          type: object
                                        text:
                                          type: string
                                          description: The text content.
                                        type:
                                          enum:
                                            - input_text
                                          type: string
                                      required:
                                        - type
                                        - text
                                      title: Text
                                      type: object
                                    - description: An image content part.
                                      properties:
                                        cache_control:
                                          properties:
                                            ttl:
                                              default: 5m
                                              description: >-
                                                The time-to-live for the cache control
                                                breakpoint. This may be one of the
                                                following values:


                                                - `5m`: 5 minutes

                                                - `1h`: 1 hour


                                                Defaults to `5m`. Only supported by
                                                Anthropic Claude models.
                                              enum:
                                                - 5m
                                                - 1h
                                              type: string
                                            type:
                                              type: string
                                              enum:
                                                - ephemeral
                                              description: >-
                                                Create a cache control breakpoint at
                                                this content block. Accepts only the
                                                value "ephemeral".
                                          required:
                                            - type
                                          title: Cache control
                                          type: object
                                        detail:
                                          description: >-
                                            The detail level for image
                                            understanding.
                                          enum:
                                            - auto
                                            - low
                                            - high
                                          type: string
                                        file_id:
                                          description: The ID of a previously uploaded file.
                                          type: string
                                        image_url:
                                          description: The URL of the image.
                                          type: string
                                        type:
                                          enum:
                                            - input_image
                                          type: string
                                      required:
                                        - type
                                      title: Image
                                      type: object
                                    - description: >-
                                        A file content part. Provide file_id,
                                        file_data (base64), or file_url.
                                      properties:
                                        cache_control:
                                          properties:
                                            ttl:
                                              default: 5m
                                              description: >-
                                                The time-to-live for the cache control
                                                breakpoint. This may be one of the
                                                following values:


                                                - `5m`: 5 minutes

                                                - `1h`: 1 hour


                                                Defaults to `5m`. Only supported by
                                                Anthropic Claude models.
                                              enum:
                                                - 5m
                                                - 1h
                                              type: string
                                            type:
                                              type: string
                                              enum:
                                                - ephemeral
                                              description: >-
                                                Create a cache control breakpoint at
                                                this content block. Accepts only the
                                                value "ephemeral".
                                          required:
                                            - type
                                          title: Cache control
                                          type: object
                                        file_data:
                                          description: Base64-encoded file content.
                                          type: string
                                        file_id:
                                          description: The ID of a previously uploaded file.
                                          type: string
                                        file_url:
                                          description: A URL to fetch the file from.
                                          type: string
                                        filename:
                                          description: The name of the file.
                                          type: string
                                        mime_type:
                                          description: >-
                                            The MIME type of the file (e.g.,
                                            application/pdf).
                                          type: string
                                        type:
                                          enum:
                                            - input_file
                                          type: string
                                      required:
                                        - type
                                      title: File
                                      type: object
                                  description: A content part within a message.
                                title: Content parts
                                type: array
                            description: >-
                              The content of the item: a string or an array of
                              content parts.
                          id:
                            description: The ID of the item (for item_reference type).
                            type: string
                          output:
                            description: >-
                              The output of the function call (for
                              function_call_output type).
                            type: string
                          role:
                            description: >-
                              The role of the message sender (for message
                              items).
                            enum:
                              - user
                              - assistant
                              - system
                              - developer
                            type: string
                          type:
                            description: The type of item.
                            enum:
                              - message
                              - function_call_output
                              - item_reference
                            type: string
                        type: object
                      title: Items
                      type: array
                  description: >-
                    Input to the model: a string or an array of input items
                    (messages, files, etc.).
                instructions:
                  description: System prompt / instructions for the model.
                  type: string
                limits:
                  $ref: '#/components/schemas/ResponseExecutionLimits'
                  description: >-
                    Bound agent-loop execution. Fields: max_iterations (LLM
                    turns), max_execution_time (seconds), max_cost (USD; send 0
                    to disable a manifest-configured cap), max_depth (sub-agent
                    nesting), tool_timeout (seconds). Body values override
                    agent-manifest defaults.
                max_output_tokens:
                  description: Maximum number of tokens in the response output.
                  format: int64
                  type: integer
                max_tool_calls:
                  description: Maximum number of tool call rounds in the agentic loop.
                  format: int64
                  type: integer
                memory:
                  $ref: '#/components/schemas/MemoryParam'
                  description: >-
                    Attach a memory store entity to enable persistent memory
                    across requests. See Memory Stores documentation for setup.
                metadata:
                  additionalProperties:
                    type: string
                  description: >-
                    Developer-defined key-value pairs attached to the response
                    (OpenAI spec: Map<string, string>). Non-string values are
                    rejected with a 400.
                  type: object
                model:
                  description: >-
                    The model to use in provider/model format (e.g.
                    openai/gpt-4o). Use agent/<key> to invoke a pre-configured
                    agent from the orq.ai platform.
                  type: string
                parallel_tool_calls:
                  description: Whether to allow parallel tool calls.
                  type: boolean
                presence_penalty:
                  description: >-
                    Penalize new tokens based on their presence in the text so
                    far. Between -2.0 and 2.0.
                  format: double
                  type: number
                previous_response_id:
                  description: >-
                    The ID of a previous response to continue from. Requires
                    store to be true (default) on the original response.
                  type: string
                prompt_cache_key:
                  description: Key for prompt caching across requests.
                  type: string
                reasoning:
                  $ref: '#/components/schemas/ReasoningParam'
                  description: >-
                    Configure reasoning behavior. Set effort (none, minimal,
                    low, medium, high, xhigh) to control how much the model
                    thinks before answering. Higher effort means more reasoning
                    tokens and better answers for complex tasks, at higher cost.
                retry:
                  $ref: '#/components/schemas/ResponseRetryConfig'
                  description: >-
                    Retry configuration. Specify the number of retries and which
                    HTTP status codes should trigger a retry.
                safety_identifier:
                  description: Safety identifier for content filtering.
                  type: string
                store:
                  description: >-
                    Whether to persist the response (default: true). When false,
                    the response cannot be retrieved later and
                    previous_response_id will not work for follow-up requests.
                  type: boolean
                stream:
                  description: If true, returns a stream of server-sent events.
                  type: boolean
                stream_options:
                  $ref: '#/components/schemas/StreamOptions'
                temperature:
                  description: Sampling temperature between 0 and 2.
                  format: double
                  type: number
                template_engine:
                  description: >-
                    Template engine for variable substitution in instructions.
                    Defaults to the agent manifest's engine when invoking an
                    agent, otherwise text.
                  enum:
                    - text
                    - jinja
                    - mustache
                  type: string
                text:
                  description: Configuration for text output.
                  properties:
                    format:
                      anyOf:
                        - properties:
                            type:
                              type: string
                              enum:
                                - text
                          required:
                            - type
                          title: Plain text
                          type: object
                        - properties:
                            description:
                              type: string
                            name:
                              type: string
                            schema:
                              description: The JSON Schema the output must conform to.
                              type: object
                            strict:
                              type: boolean
                            type:
                              enum:
                                - json_schema
                              type: string
                          required:
                            - type
                          title: JSON Schema
                          type: object
                      description: 'The output format: plain text or structured JSON schema.'
                    verbosity:
                      description: Controls the verbosity of the model output.
                      enum:
                        - low
                        - medium
                        - high
                      type: string
                  type: object
                thread:
                  $ref: '#/components/schemas/ResponseThread'
                  description: Thread for grouping related requests.
                tool_choice:
                  anyOf:
                    - description: >-
                        Shorthand: "auto" lets the model decide, "none" disables
                        tools, "required" forces tool use.
                      enum:
                        - auto
                        - none
                        - required
                      title: Shorthand
                      type: string
                    - description: Select a specific function tool by name.
                      properties:
                        name:
                          type: string
                          description: The name of the function to call.
                        type:
                          type: string
                          enum:
                            - function
                      required:
                        - type
                        - name
                      title: Specific function
                      type: object
                  description: >-
                    How the model should use the provided tools. Can be a string
                    shorthand or a specific function selector.
                tools:
                  description: Tools available to the model.
                  items:
                    anyOf:
                      - description: A function tool the model can call.
                        properties:
                          cache_control:
                            properties:
                              ttl:
                                default: 5m
                                description: >-
                                  The time-to-live for the cache control
                                  breakpoint. This may be one of the following
                                  values:


                                  - `5m`: 5 minutes

                                  - `1h`: 1 hour


                                  Defaults to `5m`. Only supported by Anthropic
                                  Claude models.
                                enum:
                                  - 5m
                                  - 1h
                                type: string
                              type:
                                type: string
                                enum:
                                  - ephemeral
                                description: >-
                                  Create a cache control breakpoint at this
                                  content block. Accepts only the value
                                  "ephemeral".
                            required:
                              - type
                            title: Cache control
                            type: object
                          description:
                            description: A description of what the function does.
                            type: string
                          name:
                            description: The name of the function.
                            type: string
                          parameters:
                            additionalProperties: true
                            description: >-
                              The parameters the function accepts, as a JSON
                              Schema object.
                            type: object
                          strict:
                            description: Whether to enforce strict parameter validation.
                            type: boolean
                          type:
                            type: string
                            enum:
                              - function
                        required:
                          - type
                          - name
                        title: Function
                        type: object
                      - description: >-
                          An orq.ai platform tool reference. For MCP tools,
                          prefer type 'mcp' with 'key' instead of 'orq:mcp' with
                          'tool_id'.
                        properties:
                          tool_id:
                            description: The tool ID (for orq:mcp, orq:http, orq:function).
                            type: string
                          type:
                            description: The orq.ai tool type.
                            enum:
                              - orq:current_date
                              - orq:google_search
                              - orq:web_scraper
                              - orq:mcp
                              - orq:http
                              - orq:function
                            type: string
                        required:
                          - type
                        title: orq.ai Tool
                        type: object
                      - description: >-
                          An MCP (Model Context Protocol) server tool. Provide
                          server_url for inline mode, or key to reference a
                          pre-configured MCP server.
                        properties:
                          allowed_tools:
                            description: >-
                              Filter which tools from the MCP server are
                              exposed.
                            properties:
                              read_only:
                                description: >-
                                  Only expose tools with readOnlyHint
                                  annotation.
                                type: boolean
                              tool_names:
                                description: List of allowed tool names.
                                items:
                                  type: string
                                type: array
                            type: object
                          headers:
                            additionalProperties:
                              type: string
                            description: >-
                              Custom headers to send with MCP requests. Values
                              support {{variable}} templates.
                            type: object
                          key:
                            description: >-
                              Unique identifier. Required for pre-configured MCP
                              servers (lookup key). For inline servers, used as
                              a trace/display label.
                            type: string
                          server_description:
                            description: Human-readable description of the server.
                            type: string
                          server_url:
                            description: The MCP server endpoint URL (inline mode).
                            type: string
                          type:
                            enum:
                              - mcp
                            type: string
                        required:
                          - type
                        title: MCP Tool
                        type: object
                    description: >-
                      A tool definition. The "type" field determines the tool
                      kind.
                  type: array
                top_logprobs:
                  description: Number of most likely tokens to return at each position.
                  format: int64
                  type: integer
                top_p:
                  description: Nucleus sampling parameter.
                  format: double
                  type: number
                variables:
                  additionalProperties: {}
                  description: >-
                    Template variables for prompt substitution. Plain values
                    fill {{variable}} placeholders in instructions. For secrets,
                    use {"secret": true, "value": "sensitive-data"} — secrets
                    are automatically passed to platform tools (Python, HTTP,
                    MCP) and redacted from traces.
                  type: object
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  background:
                    type: boolean
                  completed_at:
                    format: int64
                    type:
                      - integer
                      - 'null'
                  conversation:
                    $ref: '#/components/schemas/ConversationParam'
                  created_at:
                    format: int64
                    type: integer
                  error:
                    $ref: '#/components/schemas/ResponseError'
                  frequency_penalty:
                    type: number
                    format: double
                  id:
                    type: string
                  incomplete_details:
                    $ref: '#/components/schemas/IncompleteDetails'
                  input:
                    description: >-
                      Array of input items (messages, function call outputs,
                      etc.)
                    items: {}
                    type:
                      - array
                      - 'null'
                  instructions:
                    type:
                      - string
                      - 'null'
                  max_output_tokens:
                    format: int64
                    type:
                      - integer
                      - 'null'
                  max_tool_calls:
                    format: int64
                    type:
                      - integer
                      - 'null'
                  memory:
                    $ref: '#/components/schemas/MemoryParam'
                  metadata:
                    additionalProperties:
                      type: string
                    description: >-
                      Developer-defined key-value pairs attached to the response
                      (OpenAI spec: Map<string, string>).
                    type: object
                  model:
                    type: string
                  object:
                    description: Always "response"
                    type: string
                  output:
                    description: >-
                      Array of output items (messages, function calls,
                      reasoning, etc.)
                    items: {}
                    type:
                      - array
                      - 'null'
                  parallel_tool_calls:
                    type: boolean
                  presence_penalty:
                    type: number
                    format: double
                  previous_response_id:
                    type:
                      - string
                      - 'null'
                  prompt_cache_key:
                    type:
                      - string
                      - 'null'
                  prompt_cache_retention:
                    type:
                      - string
                      - 'null'
                  reasoning:
                    $ref: '#/components/schemas/Reasoning'
                  safety_identifier:
                    type:
                      - string
                      - 'null'
                  service_tier:
                    enum:
                      - auto
                      - default
                      - flex
                      - priority
                    type: string
                  status:
                    enum:
                      - queued
                      - in_progress
                      - completed
                      - failed
                      - incomplete
                      - requires_action
                    type: string
                  store:
                    type: boolean
                  temperature:
                    type: number
                    format: double
                  text:
                    description: Text output configuration including format and verbosity
                  tool_choice:
                    description: >-
                      Tool choice setting: "auto", "none", "required", or a
                      specific function
                  tools:
                    description: Array of tool configurations used in this response
                    items: {}
                    type:
                      - array
                      - 'null'
                  top_logprobs:
                    format: int64
                    type: integer
                  top_p:
                    type: number
                    format: double
                  truncation:
                    enum:
                      - disabled
                      - auto
                    type: string
                  usage:
                    $ref: '#/components/schemas/PublicUsage'
                  user:
                    type:
                      - string
                      - 'null'
                  variables:
                    type: object
                    additionalProperties: {}
                required:
                  - id
                  - object
                  - created_at
                  - completed_at
                  - status
                  - incomplete_details
                  - model
                  - previous_response_id
                  - instructions
                  - input
                  - output
                  - error
                  - tools
                  - tool_choice
                  - temperature
                  - top_p
                  - presence_penalty
                  - frequency_penalty
                  - top_logprobs
                  - max_output_tokens
                  - max_tool_calls
                  - reasoning
                  - text
                  - user
                  - usage
                  - truncation
                  - parallel_tool_calls
                  - store
                  - background
                  - metadata
                  - service_tier
                  - safety_identifier
                  - prompt_cache_key
                  - prompt_cache_retention
                type: object
            text/event-stream:
              schema:
                description: >-
                  A server-sent event in the response stream. The frame's
                  `event` field selects the payload shape carried in `data`.
                discriminator:
                  mapping:
                    error:
                      $ref: '#/components/schemas/ResponseErrorStreamEvent'
                    response.code_interpreter_call.completed:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.code_interpreter_call.in_progress:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.code_interpreter_call.interpreting:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.code_interpreter_call_code.delta:
                      $ref: >-
                        #/components/schemas/ResponseCodeInterpreterCodeDeltaStreamEvent
                    response.code_interpreter_call_code.done:
                      $ref: >-
                        #/components/schemas/ResponseCodeInterpreterCodeDoneStreamEvent
                    response.completed:
                      $ref: '#/components/schemas/ResponseLifecycleStreamEvent'
                    response.content_part.added:
                      $ref: '#/components/schemas/ResponseContentPartStreamEvent'
                    response.content_part.done:
                      $ref: '#/components/schemas/ResponseContentPartStreamEvent'
                    response.created:
                      $ref: '#/components/schemas/ResponseLifecycleStreamEvent'
                    response.failed:
                      $ref: '#/components/schemas/ResponseLifecycleStreamEvent'
                    response.file_search_call.completed:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.file_search_call.in_progress:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.file_search_call.searching:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.function_call_arguments.delta:
                      $ref: >-
                        #/components/schemas/ResponseFunctionCallArgumentsDeltaStreamEvent
                    response.function_call_arguments.done:
                      $ref: >-
                        #/components/schemas/ResponseFunctionCallArgumentsDoneStreamEvent
                    response.image_generation_call.completed:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.image_generation_call.generating:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.image_generation_call.in_progress:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.image_generation_call.partial_image:
                      $ref: >-
                        #/components/schemas/ResponseImageGenerationPartialImageStreamEvent
                    response.in_progress:
                      $ref: '#/components/schemas/ResponseLifecycleStreamEvent'
                    response.incomplete:
                      $ref: '#/components/schemas/ResponseLifecycleStreamEvent'
                    response.mcp_call.completed:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.mcp_call.failed:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.mcp_call.in_progress:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.mcp_call_arguments.delta:
                      $ref: >-
                        #/components/schemas/ResponseMcpCallArgumentsDeltaStreamEvent
                    response.mcp_call_arguments.done:
                      $ref: >-
                        #/components/schemas/ResponseMcpCallArgumentsDoneStreamEvent
                    response.output_item.added:
                      $ref: '#/components/schemas/ResponseOutputItemStreamEvent'
                    response.output_item.done:
                      $ref: '#/components/schemas/ResponseOutputItemStreamEvent'
                    response.output_text.annotation.added:
                      $ref: >-
                        #/components/schemas/ResponseOutputTextAnnotationAddedStreamEvent
                    response.output_text.delta:
                      $ref: '#/components/schemas/ResponseOutputTextDeltaStreamEvent'
                    response.output_text.done:
                      $ref: '#/components/schemas/ResponseOutputTextDoneStreamEvent'
                    response.queued:
                      $ref: '#/components/schemas/ResponseLifecycleStreamEvent'
                    response.reasoning.delta:
                      $ref: '#/components/schemas/ResponseReasoningDeltaStreamEvent'
                    response.reasoning.done:
                      $ref: '#/components/schemas/ResponseReasoningDoneStreamEvent'
                    response.reasoning_summary_part.added:
                      $ref: >-
                        #/components/schemas/ResponseReasoningSummaryPartStreamEvent
                    response.reasoning_summary_part.done:
                      $ref: >-
                        #/components/schemas/ResponseReasoningSummaryPartStreamEvent
                    response.reasoning_summary_text.delta:
                      $ref: >-
                        #/components/schemas/ResponseReasoningSummaryTextDeltaStreamEvent
                    response.reasoning_summary_text.done:
                      $ref: >-
                        #/components/schemas/ResponseReasoningSummaryTextDoneStreamEvent
                    response.reasoning_text.delta:
                      $ref: '#/components/schemas/ResponseReasoningDeltaStreamEvent'
                    response.reasoning_text.done:
                      $ref: '#/components/schemas/ResponseReasoningDoneStreamEvent'
                    response.refusal.delta:
                      $ref: '#/components/schemas/ResponseRefusalDeltaStreamEvent'
                    response.refusal.done:
                      $ref: '#/components/schemas/ResponseRefusalDoneStreamEvent'
                    response.web_search_call.completed:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.web_search_call.in_progress:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                    response.web_search_call.searching:
                      $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                  propertyName: event
                oneOf:
                  - $ref: '#/components/schemas/ResponseLifecycleStreamEvent'
                  - $ref: '#/components/schemas/ResponseOutputItemStreamEvent'
                  - $ref: '#/components/schemas/ResponseContentPartStreamEvent'
                  - $ref: '#/components/schemas/ResponseOutputTextDeltaStreamEvent'
                  - $ref: '#/components/schemas/ResponseOutputTextDoneStreamEvent'
                  - $ref: >-
                      #/components/schemas/ResponseOutputTextAnnotationAddedStreamEvent
                  - $ref: '#/components/schemas/ResponseRefusalDeltaStreamEvent'
                  - $ref: '#/components/schemas/ResponseRefusalDoneStreamEvent'
                  - $ref: >-
                      #/components/schemas/ResponseFunctionCallArgumentsDeltaStreamEvent
                  - $ref: >-
                      #/components/schemas/ResponseFunctionCallArgumentsDoneStreamEvent
                  - $ref: '#/components/schemas/ResponseReasoningDeltaStreamEvent'
                  - $ref: '#/components/schemas/ResponseReasoningDoneStreamEvent'
                  - $ref: >-
                      #/components/schemas/ResponseReasoningSummaryTextDeltaStreamEvent
                  - $ref: >-
                      #/components/schemas/ResponseReasoningSummaryTextDoneStreamEvent
                  - $ref: >-
                      #/components/schemas/ResponseReasoningSummaryPartStreamEvent
                  - $ref: '#/components/schemas/ResponseHostedToolCallStreamEvent'
                  - $ref: >-
                      #/components/schemas/ResponseCodeInterpreterCodeDeltaStreamEvent
                  - $ref: >-
                      #/components/schemas/ResponseCodeInterpreterCodeDoneStreamEvent
                  - $ref: >-
                      #/components/schemas/ResponseMcpCallArgumentsDeltaStreamEvent
                  - $ref: >-
                      #/components/schemas/ResponseMcpCallArgumentsDoneStreamEvent
                  - $ref: >-
                      #/components/schemas/ResponseImageGenerationPartialImageStreamEvent
                  - $ref: '#/components/schemas/ResponseErrorStreamEvent'
              x-speakeasy-sse-sentinel: '[DONE]'
          description: Returns a response object or a stream of events.
components:
  schemas:
    ConversationParam:
      additionalProperties: false
      properties:
        id:
          type: string
      required:
        - id
      type: object
    FallbackConfig:
      additionalProperties: false
      properties:
        model:
          type: string
      required:
        - model
      type: object
    EvaluatorRef:
      additionalProperties: false
      properties:
        execute_on:
          enum:
            - input
            - output
            - both
          type: string
        id:
          type: string
          minLength: 1
        is_guardrail:
          type: boolean
        options:
          type: object
          additionalProperties: {}
        sample_rate:
          format: double
          maximum: 1
          minimum: 0
          type: number
      required:
        - id
        - execute_on
      type: object
    ResponseIdentity:
      additionalProperties: false
      properties:
        display_name:
          type: string
        email:
          type: string
        id:
          type: string
        metadata:
          items:
            type: object
            additionalProperties: {}
          type:
            - array
            - 'null'
        tags:
          items:
            type: string
          type:
            - array
            - 'null'
      required:
        - id
      type: object
    ResponseExecutionLimits:
      additionalProperties: false
      properties:
        max_cost:
          type: number
          format: double
        max_depth:
          format: int64
          type: integer
        max_execution_time:
          format: int64
          type: integer
        max_iterations:
          format: int64
          type: integer
        tool_timeout:
          format: int64
          type: integer
      type: object
    MemoryParam:
      additionalProperties: false
      properties:
        entity_id:
          type: string
      required:
        - entity_id
      type: object
    ReasoningParam:
      additionalProperties: false
      properties:
        effort:
          description: >-
            Constrains effort on reasoning for reasoning models. Reducing
            reasoning effort can result in faster responses and fewer tokens
            used on reasoning in a response.
          enum:
            - none
            - minimal
            - low
            - medium
            - high
            - xhigh
          type: string
        summary:
          description: The format of the reasoning summary returned by the model.
          enum:
            - concise
            - detailed
            - auto
          type: string
      type: object
    ResponseRetryConfig:
      additionalProperties: false
      properties:
        count:
          description: Number of retries (1-5).
          format: int64
          type: integer
        on_codes:
          description: HTTP status codes that trigger a retry (e.g. [429, 500, 502, 503]).
          items:
            format: int64
            type: integer
          type:
            - array
            - 'null'
      required:
        - count
        - on_codes
      type: object
    StreamOptions:
      additionalProperties: false
      properties:
        include_obfuscation:
          type: boolean
      required:
        - include_obfuscation
      type: object
    ResponseThread:
      additionalProperties: false
      properties:
        id:
          type: string
        tags:
          items:
            type: string
          type:
            - array
            - 'null'
      required:
        - id
      type: object
    ResponseError:
      additionalProperties: false
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    IncompleteDetails:
      additionalProperties: false
      properties:
        reason:
          type: string
      required:
        - reason
      type: object
    Reasoning:
      additionalProperties: false
      properties:
        effort:
          description: >-
            Constrains effort on reasoning for reasoning models. Reducing
            reasoning effort can result in faster responses and fewer tokens
            used on reasoning in a response.
          enum:
            - none
            - minimal
            - low
            - medium
            - high
            - xhigh
          type: string
        summary:
          description: The format of the reasoning summary returned by the model.
          enum:
            - concise
            - detailed
            - auto
          type: string
      type: object
    PublicUsage:
      additionalProperties: false
      properties:
        input_cost:
          description: >-
            Cost (USD) of input tokens. Present when billing was computed for
            this response.
          format: double
          type: number
        input_tokens:
          format: int64
          type: integer
        input_tokens_details:
          $ref: '#/components/schemas/InputTokensDetails'
        output_cost:
          description: >-
            Cost (USD) of output tokens. Present when billing was computed for
            this response.
          format: double
          type: number
        output_tokens:
          format: int64
          type: integer
        output_tokens_details:
          $ref: '#/components/schemas/OutputTokensDetails'
        total_cost:
          description: >-
            Total cost (USD) of the response. Present when billing was computed
            for this response.
          format: double
          type: number
        total_tokens:
          format: int64
          type: integer
        web_search_requests:
          format: int64
          type: integer
      required:
        - input_tokens
        - output_tokens
        - total_tokens
        - input_tokens_details
        - output_tokens_details
      type: object
    ResponseErrorStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            error:
              $ref: '#/components/schemas/ResponseError'
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - error
              type: string
          required:
            - type
            - sequence_number
            - error
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - error
          type: string
      required:
        - event
        - data
      title: Error
      type: object
    ResponseHostedToolCallStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.web_search_call.in_progress
                - response.web_search_call.searching
                - response.web_search_call.completed
                - response.file_search_call.in_progress
                - response.file_search_call.searching
                - response.file_search_call.completed
                - response.code_interpreter_call.in_progress
                - response.code_interpreter_call.interpreting
                - response.code_interpreter_call.completed
                - response.image_generation_call.in_progress
                - response.image_generation_call.generating
                - response.image_generation_call.completed
                - response.mcp_call.in_progress
                - response.mcp_call.completed
                - response.mcp_call.failed
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.web_search_call.in_progress
            - response.web_search_call.searching
            - response.web_search_call.completed
            - response.file_search_call.in_progress
            - response.file_search_call.searching
            - response.file_search_call.completed
            - response.code_interpreter_call.in_progress
            - response.code_interpreter_call.interpreting
            - response.code_interpreter_call.completed
            - response.image_generation_call.in_progress
            - response.image_generation_call.generating
            - response.image_generation_call.completed
            - response.mcp_call.in_progress
            - response.mcp_call.completed
            - response.mcp_call.failed
          type: string
      required:
        - event
        - data
      title: Hosted Tool Call
      type: object
    ResponseCodeInterpreterCodeDeltaStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            delta:
              description: Incremental text or argument chunk.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.code_interpreter_call_code.delta
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - delta
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.code_interpreter_call_code.delta
          type: string
      required:
        - event
        - data
      title: Code Interpreter Code Delta
      type: object
    ResponseCodeInterpreterCodeDoneStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            code:
              description: The completed code interpreter code.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.code_interpreter_call_code.done
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - code
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.code_interpreter_call_code.done
          type: string
      required:
        - event
        - data
      title: Code Interpreter Code Done
      type: object
    ResponseLifecycleStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            response:
              $ref: '#/components/schemas/PublicResponseResource'
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.created
                - response.queued
                - response.in_progress
                - response.completed
                - response.failed
                - response.incomplete
              type: string
          required:
            - type
            - sequence_number
            - response
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.created
            - response.queued
            - response.in_progress
            - response.completed
            - response.failed
            - response.incomplete
          type: string
      required:
        - event
        - data
      title: Lifecycle
      type: object
    ResponseContentPartStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            content_index:
              description: Index of the content part within the output item.
              type: integer
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            part:
              additionalProperties: true
              description: The content part.
              type: object
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.content_part.added
                - response.content_part.done
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - content_index
            - part
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.content_part.added
            - response.content_part.done
          type: string
      required:
        - event
        - data
      title: Content Part
      type: object
    ResponseFunctionCallArgumentsDeltaStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            delta:
              description: Incremental text or argument chunk.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            obfuscation:
              description: Obfuscation padding accompanying the delta, when present.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.function_call_arguments.delta
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - delta
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.function_call_arguments.delta
          type: string
      required:
        - event
        - data
      title: Function Call Arguments Delta
      type: object
    ResponseFunctionCallArgumentsDoneStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            arguments:
              description: The completed function-call arguments JSON.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.function_call_arguments.done
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - arguments
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.function_call_arguments.done
          type: string
      required:
        - event
        - data
      title: Function Call Arguments Done
      type: object
    ResponseImageGenerationPartialImageStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            partial_image_b64:
              description: Base64-encoded partial image.
              type: string
            partial_image_index:
              description: Index of the partial image.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.image_generation_call.partial_image
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - partial_image_b64
            - partial_image_index
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.image_generation_call.partial_image
          type: string
      required:
        - event
        - data
      title: Image Generation Partial Image
      type: object
    ResponseMcpCallArgumentsDeltaStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            delta:
              description: Incremental text or argument chunk.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.mcp_call_arguments.delta
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - delta
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.mcp_call_arguments.delta
          type: string
      required:
        - event
        - data
      title: MCP Call Arguments Delta
      type: object
    ResponseMcpCallArgumentsDoneStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            arguments:
              description: The completed MCP-call arguments JSON.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.mcp_call_arguments.done
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - arguments
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.mcp_call_arguments.done
          type: string
      required:
        - event
        - data
      title: MCP Call Arguments Done
      type: object
    ResponseOutputItemStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            item:
              additionalProperties: true
              description: The output item (message, function call, reasoning, etc.).
              type: object
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.output_item.added
                - response.output_item.done
              type: string
          required:
            - type
            - sequence_number
            - output_index
            - item
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.output_item.added
            - response.output_item.done
          type: string
      required:
        - event
        - data
      title: Output Item
      type: object
    ResponseOutputTextAnnotationAddedStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            annotation:
              additionalProperties: true
              description: The annotation added to the output text.
              type: object
            annotation_index:
              description: Index of the annotation within the content part.
              type: integer
            content_index:
              description: Index of the content part within the output item.
              type: integer
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.output_text.annotation.added
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - content_index
            - annotation_index
            - annotation
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.output_text.annotation.added
          type: string
      required:
        - event
        - data
      title: Output Text Annotation Added
      type: object
    ResponseOutputTextDeltaStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            content_index:
              description: Index of the content part within the output item.
              type: integer
            delta:
              description: Incremental text or argument chunk.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            logprobs:
              description: Log probability information for the emitted tokens.
              items:
                additionalProperties: true
                type: object
              type: array
            obfuscation:
              description: Obfuscation padding accompanying the delta, when present.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.output_text.delta
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - content_index
            - delta
            - logprobs
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.output_text.delta
          type: string
      required:
        - event
        - data
      title: Output Text Delta
      type: object
    ResponseOutputTextDoneStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            content_index:
              description: Index of the content part within the output item.
              type: integer
            item_id:
              description: ID of the output item this event refers to.
              type: string
            logprobs:
              description: Log probability information for the emitted tokens.
              items:
                additionalProperties: true
                type: object
              type: array
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            text:
              description: The completed output text.
              type: string
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.output_text.done
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - content_index
            - text
            - logprobs
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.output_text.done
          type: string
      required:
        - event
        - data
      title: Output Text Done
      type: object
    ResponseReasoningDeltaStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            content_index:
              description: Index of the content part within the output item.
              type: integer
            delta:
              description: Incremental text or argument chunk.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            obfuscation:
              description: Obfuscation padding accompanying the delta, when present.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.reasoning.delta
                - response.reasoning_text.delta
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - content_index
            - delta
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.reasoning.delta
            - response.reasoning_text.delta
          type: string
      required:
        - event
        - data
      title: Reasoning Delta
      type: object
    ResponseReasoningDoneStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            content_index:
              description: Index of the content part within the output item.
              type: integer
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            text:
              description: The completed reasoning text.
              type: string
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.reasoning.done
                - response.reasoning_text.done
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - content_index
            - text
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.reasoning.done
            - response.reasoning_text.done
          type: string
      required:
        - event
        - data
      title: Reasoning Done
      type: object
    ResponseReasoningSummaryPartStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            part:
              additionalProperties: true
              description: The reasoning summary part.
              type: object
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            summary_index:
              description: Index of the reasoning summary part.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.reasoning_summary_part.added
                - response.reasoning_summary_part.done
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - summary_index
            - part
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.reasoning_summary_part.added
            - response.reasoning_summary_part.done
          type: string
      required:
        - event
        - data
      title: Reasoning Summary Part
      type: object
    ResponseReasoningSummaryTextDeltaStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            delta:
              description: Incremental text or argument chunk.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            obfuscation:
              description: Obfuscation padding accompanying the delta, when present.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            summary_index:
              description: Index of the reasoning summary part.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.reasoning_summary_text.delta
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - summary_index
            - delta
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.reasoning_summary_text.delta
          type: string
      required:
        - event
        - data
      title: Reasoning Summary Text Delta
      type: object
    ResponseReasoningSummaryTextDoneStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            summary_index:
              description: Index of the reasoning summary part.
              type: integer
            text:
              description: The completed reasoning summary text.
              type: string
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.reasoning_summary_text.done
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - summary_index
            - text
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.reasoning_summary_text.done
          type: string
      required:
        - event
        - data
      title: Reasoning Summary Text Done
      type: object
    ResponseRefusalDeltaStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            content_index:
              description: Index of the content part within the output item.
              type: integer
            delta:
              description: Incremental text or argument chunk.
              type: string
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.refusal.delta
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - content_index
            - delta
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.refusal.delta
          type: string
      required:
        - event
        - data
      title: Refusal Delta
      type: object
    ResponseRefusalDoneStreamEvent:
      properties:
        data:
          additionalProperties: true
          description: The event payload.
          properties:
            content_index:
              description: Index of the content part within the output item.
              type: integer
            item_id:
              description: ID of the output item this event refers to.
              type: string
            output_index:
              description: Index of the output item in the response output array.
              type: integer
            refusal:
              description: The completed refusal text.
              type: string
            sequence_number:
              description: Monotonically increasing sequence number for ordering events.
              type: integer
            type:
              description: The event type. Matches the SSE `event` field.
              enum:
                - response.refusal.done
              type: string
          required:
            - type
            - sequence_number
            - item_id
            - output_index
            - content_index
            - refusal
          type: object
        event:
          description: The SSE event name, equal to the payload's `type`.
          enum:
            - response.refusal.done
          type: string
      required:
        - event
        - data
      title: Refusal Done
      type: object
    InputTokensDetails:
      additionalProperties: false
      properties:
        cache_creation_1h_tokens:
          format: int64
          type: integer
        cache_creation_5m_tokens:
          format: int64
          type: integer
        cache_creation_tokens:
          format: int64
          type: integer
        cached_tokens:
          format: int64
          type: integer
      required:
        - cached_tokens
        - cache_creation_tokens
      type: object
    OutputTokensDetails:
      additionalProperties: false
      properties:
        reasoning_tokens:
          format: int64
          type: integer
      required:
        - reasoning_tokens
      type: object
    PublicResponseResource:
      additionalProperties: false
      properties:
        background:
          type: boolean
        completed_at:
          format: int64
          type:
            - integer
            - 'null'
        conversation:
          $ref: '#/components/schemas/ConversationParam'
        created_at:
          format: int64
          type: integer
        error:
          $ref: '#/components/schemas/ResponseError'
        frequency_penalty:
          type: number
          format: double
        id:
          type: string
        incomplete_details:
          $ref: '#/components/schemas/IncompleteDetails'
        input:
          description: Array of input items (messages, function call outputs, etc.)
          items: {}
          type:
            - array
            - 'null'
        instructions:
          type:
            - string
            - 'null'
        max_output_tokens:
          format: int64
          type:
            - integer
            - 'null'
        max_tool_calls:
          format: int64
          type:
            - integer
            - 'null'
        memory:
          $ref: '#/components/schemas/MemoryParam'
        metadata:
          additionalProperties:
            type: string
          description: >-
            Developer-defined key-value pairs attached to the response (OpenAI
            spec: Map<string, string>).
          type: object
        model:
          type: string
        object:
          description: Always "response"
          type: string
        output:
          description: Array of output items (messages, function calls, reasoning, etc.)
          items: {}
          type:
            - array
            - 'null'
        parallel_tool_calls:
          type: boolean
        presence_penalty:
          type: number
          format: double
        previous_response_id:
          type:
            - string
            - 'null'
        prompt_cache_key:
          type:
            - string
            - 'null'
        prompt_cache_retention:
          type:
            - string
            - 'null'
        reasoning:
          $ref: '#/components/schemas/Reasoning'
        safety_identifier:
          type:
            - string
            - 'null'
        service_tier:
          enum:
            - auto
            - default
            - flex
            - priority
          type: string
        status:
          enum:
            - queued
            - in_progress
            - completed
            - failed
            - incomplete
            - requires_action
          type: string
        store:
          type: boolean
        temperature:
          type: number
          format: double
        text:
          description: Text output configuration including format and verbosity
        tool_choice:
          description: >-
            Tool choice setting: "auto", "none", "required", or a specific
            function
        tools:
          description: Array of tool configurations used in this response
          items: {}
          type:
            - array
            - 'null'
        top_logprobs:
          format: int64
          type: integer
        top_p:
          type: number
          format: double
        truncation:
          enum:
            - disabled
            - auto
          type: string
        usage:
          $ref: '#/components/schemas/PublicUsage'
        user:
          type:
            - string
            - 'null'
        variables:
          type: object
          additionalProperties: {}
      required:
        - id
        - object
        - created_at
        - completed_at
        - status
        - incomplete_details
        - model
        - previous_response_id
        - instructions
        - input
        - output
        - error
        - tools
        - tool_choice
        - temperature
        - top_p
        - presence_penalty
        - frequency_penalty
        - top_logprobs
        - max_output_tokens
        - max_tool_calls
        - reasoning
        - text
        - user
        - usage
        - truncation
        - parallel_tool_calls
        - store
        - background
        - metadata
        - service_tier
        - safety_identifier
        - prompt_cache_key
        - prompt_cache_retention
      type: object
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````