AppDirect Responses API v2 API

OpenAI Responses-compatible API (v2). Supports streaming (SSE) and non-streaming runs, threaded and stateless execution, and lifecycle control (cancel / pause / resume). The shape mirrors the [official OpenAI Responses API](https://platform.openai.com/docs/api-reference/responses) for inputs, outputs, tools, and streaming events. Items below labelled **[devs.ai extension]** have no equivalent in OpenAI's spec; everything else is intended to be 1:1 compatible. ### Vendor extensions used to flag devs.ai additions Every devs.ai-specific element in this spec is also tagged with a machine-readable [OpenAPI specification extension](https://swagger.io/docs/specification/openapi-extensions/) so tooling can detect them programmatically without parsing description text: - **`x-devs-ai-extension: true`** — applied to schemas, schema properties, parameters, response headers, and operations that have no OpenAI counterpart. - **`x-devs-ai-extension-values: [string, ...]`** — applied to enum schemas/properties whose enum is OpenAI-aligned but where devs.ai accepts/emits additional values. Lists only the extra values (e.g. `["cancelled"]` on `ResponseStatus`). - **`x-devs-ai-extension-behavior: ""`** — applied where the field name itself is OpenAI-standard but devs.ai's handling differs (e.g. `optional-on-request` on `MessageInputItem.type` because devs.ai accepts the field being omitted while OpenAI requires it). ### devs.ai Extensions A single reference list of every devs.ai-specific addition exposed by this API. Each entry below is also marked `**[devs.ai extension]**` at its source and carries one of the `x-devs-ai-extension*` vendor extensions described above. **Request fields (`CreateResponseRequest`)** - `chat_mode` — `execute` / `chat` / `plan` execution mode. - `user_secrets` — short-lived per-request API keys / secrets for tools. - `thread_mode` — concurrent-request handling on an existing thread (`collect` / `steer` / `interrupt` / `force`). - `options` — internal devs.ai chat options (provider routing, tracing, etc.). - `reasoning.effort` extra values `none` and `xhigh` (in addition to OpenAI's `minimal` / `low` / `medium` / `high`). **Input content-part flags** - `input_text.invisible` / `input_image.invisible` / `input_file.invisible` — content sent to the model but hidden from end-user transcripts. - `input_text.metadata` — arbitrary metadata attached to a content part (not forwarded to the model). - `output_text.logprobs` (when `output_text` appears inside an `OutputMessageInputItem`). **Input item enum** - `FunctionCallOutputInputItem.status` uses `["success", "error", "cancelled"]` instead of OpenAI's `["in_progress", "completed", "incomplete"]` (incompatible enum). **Tools (`ToolDefinition`)** — only `function` and `web_search` mirror OpenAI; everything below is devs.ai-specific. - `python` — emits `server_tool_call` items (not OpenAI's `code_interpreter_call`). - `image_generation` — shares the type name with OpenAI but uses devs.ai's input shape and emits `server_tool_call` items. - `mcp_server` — references a configured devs.ai MCP integration; does not emit OpenAI's `mcp_list_tools` discovery events or `mcp_approval_request` / `mcp_approval_response` items. - `spreadsheet`, `memory`, `sandbox`, `deep_research` — no OpenAI counterpart. - `web_search.includeXSearch` — extra X (Twitter) search inclusion flag. **Output items (`OutputItem`)** - `server_tool_call` and `server_tool_call_output` — emitted instead of OpenAI's `code_interpreter_call` / `image_generation_call` items for devs.ai's server-side tools. **Response fields (`Response`)** - `selection_metadata` — model routing / selection metadata (chosen provider, fallback chain, latency hints). - `status` extra value `cancelled` (in addition to OpenAI's `in_progress` / `completed` / `failed` / `incomplete`). - `incomplete_details.reason` extra value `paused` (in addition to OpenAI's `max_output_tokens` / `content_filter`). **Streaming events** (full list and payloads in the `x-streaming-events` reference under `components`) - `response.server_tool_call.in_progress` / `.completed` / `.failed`. - `response.server_tool_call_arguments.delta` / `.done`. - `response.subagent.started` / `.progress` / `.completed`. - `response.output_item.added.status_hints` (optional field on `response.output_item.added`). - Every event payload includes a monotonically increasing `sequence_number` field. - Terminal sentinel `event: done` / `data: [DONE]` after the last lifecycle event. **Endpoints / headers** - `POST /api/v2/responses/{responseId}/pause` — pause an active threaded response run. - `POST /api/v2/responses/{responseId}/resume` — resume a paused threaded response run, optionally supplying tool outputs. - `GET /api/v2/responses/{responseId}/stream` — reconnect to an in-flight SSE stream after a network drop, resuming from `lastSequence`. - `POST /api/v2/responses/{responseId}/deep-research/resume` — approve / deny / clarify a paused deep research subagent. - `x-stream-chat-id` response header on streaming `POST /api/v2/responses` and on the `/stream` reconnect endpoint.

OpenAPI Specification

appdirect-responses-api-v2-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  description: The Companies API allows developers to manage marketplace companies and their user memberships.
  title: Companies AI Embed Responses API v2 API
  license:
    name: Apache License, Version 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0
  version: v296.0-SNAPSHOT
servers:
- url: https://marketplace.appdirect.com/api
- url: https://virtserver.swaggerhub.com
tags:
- name: Responses API v2
  description: 'OpenAI Responses-compatible API (v2). Supports streaming (SSE) and non-streaming runs, threaded and stateless execution, and lifecycle control (cancel / pause / resume).


    The shape mirrors the [official OpenAI Responses API](https://platform.openai.com/docs/api-reference/responses) for inputs, outputs, tools, and streaming events. Items below labelled **[devs.ai extension]** have no equivalent in OpenAI''s spec; everything else is intended to be 1:1 compatible.


    ### Vendor extensions used to flag devs.ai additions


    Every devs.ai-specific element in this spec is also tagged with a machine-readable [OpenAPI specification extension](https://swagger.io/docs/specification/openapi-extensions/) so tooling can detect them programmatically without parsing description text:


    - **`x-devs-ai-extension: true`** — applied to schemas, schema properties, parameters, response headers, and operations that have no OpenAI counterpart.

    - **`x-devs-ai-extension-values: [string, ...]`** — applied to enum schemas/properties whose enum is OpenAI-aligned but where devs.ai accepts/emits additional values. Lists only the extra values (e.g. `["cancelled"]` on `ResponseStatus`).

    - **`x-devs-ai-extension-behavior: "<id>"`** — applied where the field name itself is OpenAI-standard but devs.ai''s handling differs (e.g. `optional-on-request` on `MessageInputItem.type` because devs.ai accepts the field being omitted while OpenAI requires it).


    ### devs.ai Extensions


    A single reference list of every devs.ai-specific addition exposed by this API. Each entry below is also marked `**[devs.ai extension]**` at its source and carries one of the `x-devs-ai-extension*` vendor extensions described above.


    **Request fields (`CreateResponseRequest`)**

    - `chat_mode` — `execute` / `chat` / `plan` execution mode.

    - `user_secrets` — short-lived per-request API keys / secrets for tools.

    - `thread_mode` — concurrent-request handling on an existing thread (`collect` / `steer` / `interrupt` / `force`).

    - `options` — internal devs.ai chat options (provider routing, tracing, etc.).

    - `reasoning.effort` extra values `none` and `xhigh` (in addition to OpenAI''s `minimal` / `low` / `medium` / `high`).


    **Input content-part flags**

    - `input_text.invisible` / `input_image.invisible` / `input_file.invisible` — content sent to the model but hidden from end-user transcripts.

    - `input_text.metadata` — arbitrary metadata attached to a content part (not forwarded to the model).

    - `output_text.logprobs` (when `output_text` appears inside an `OutputMessageInputItem`).


    **Input item enum**

    - `FunctionCallOutputInputItem.status` uses `["success", "error", "cancelled"]` instead of OpenAI''s `["in_progress", "completed", "incomplete"]` (incompatible enum).


    **Tools (`ToolDefinition`)** — only `function` and `web_search` mirror OpenAI; everything below is devs.ai-specific.

    - `python` — emits `server_tool_call` items (not OpenAI''s `code_interpreter_call`).

    - `image_generation` — shares the type name with OpenAI but uses devs.ai''s input shape and emits `server_tool_call` items.

    - `mcp_server` — references a configured devs.ai MCP integration; does not emit OpenAI''s `mcp_list_tools` discovery events or `mcp_approval_request` / `mcp_approval_response` items.

    - `spreadsheet`, `memory`, `sandbox`, `deep_research` — no OpenAI counterpart.

    - `web_search.includeXSearch` — extra X (Twitter) search inclusion flag.


    **Output items (`OutputItem`)**

    - `server_tool_call` and `server_tool_call_output` — emitted instead of OpenAI''s `code_interpreter_call` / `image_generation_call` items for devs.ai''s server-side tools.


    **Response fields (`Response`)**

    - `selection_metadata` — model routing / selection metadata (chosen provider, fallback chain, latency hints).

    - `status` extra value `cancelled` (in addition to OpenAI''s `in_progress` / `completed` / `failed` / `incomplete`).

    - `incomplete_details.reason` extra value `paused` (in addition to OpenAI''s `max_output_tokens` / `content_filter`).


    **Streaming events** (full list and payloads in the `x-streaming-events` reference under `components`)

    - `response.server_tool_call.in_progress` / `.completed` / `.failed`.

    - `response.server_tool_call_arguments.delta` / `.done`.

    - `response.subagent.started` / `.progress` / `.completed`.

    - `response.output_item.added.status_hints` (optional field on `response.output_item.added`).

    - Every event payload includes a monotonically increasing `sequence_number` field.

    - Terminal sentinel `event: done` / `data: [DONE]` after the last lifecycle event.


    **Endpoints / headers**

    - `POST /api/v2/responses/{responseId}/pause` — pause an active threaded response run.

    - `POST /api/v2/responses/{responseId}/resume` — resume a paused threaded response run, optionally supplying tool outputs.

    - `GET /api/v2/responses/{responseId}/stream` — reconnect to an in-flight SSE stream after a network drop, resuming from `lastSequence`.

    - `POST /api/v2/responses/{responseId}/deep-research/resume` — approve / deny / clarify a paused deep research subagent.

    - `x-stream-chat-id` response header on streaming `POST /api/v2/responses` and on the `/stream` reconnect endpoint.'
paths:
  /api/v2/responses:
    post:
      operationId: createResponse
      summary: Create a response
      description: "Submit a prompt and receive a model response. When `stream=true` (default),\nreturns an SSE event stream following the OpenAI Responses streaming format.\nWhen `stream=false`, returns the completed response as JSON.\n\n**Execution modes:**\n- **Threaded**: when `previous_response_id` or `conversation` is provided.\n  Signals a long-lived Temporal `ThreadWorkflow` that processes requests sequentially.\n- **Stateless**: when neither `previous_response_id` nor `conversation` is set.\n  Starts a one-shot `SingleResponseWorkflow`.\n\nResponse headers include `x-response-id`, `x-response-status`, and, for streaming responses, `x-stream-epoch`.\n"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateResponseRequest'
      responses:
        '200':
          description: 'When `stream=true`: SSE event stream. When `stream=false`: completed Response object.

            '
          headers:
            x-response-id:
              schema:
                type: string
              description: Unique response run identifier.
            x-response-status:
              schema:
                type: string
              description: Initial response status.
            x-stream-chat-id:
              schema:
                type: string
              description: '**[devs.ai extension]** Set on streaming responses (`stream=true`). Equals the underlying chat-stream identifier and can be passed as `streamChatId` to `GET /api/v2/responses/{responseId}/stream` to reconnect after a network drop. Equal to `x-response-id`.'
              x-devs-ai-extension: true
            x-stream-epoch:
              schema:
                type: string
              description: '**[devs.ai extension]** Redis stream epoch for reconnect handshakes. Persist this with `lastSequence` and pass it as `streamEpoch` to `GET /api/v2/responses/{responseId}/stream`.'
              x-devs-ai-extension: true
          content:
            text/event-stream:
              schema:
                description: SSE event stream. See Streaming Events section.
                type: string
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
        '400':
          description: Invalid request (missing model, invalid file references, schema validation failure)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Responses API v2
      security:
      - ApiKeyAuth: []
  /api/v2/responses/{responseId}:
    get:
      operationId: getResponse
      summary: Get a response
      description: 'Retrieve a response run by ID. Returns the full response object including

        output items, usage, and status.

        '
      parameters:
      - $ref: '#/components/parameters/responseId'
      responses:
        '200':
          description: Response object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
        '404':
          description: Response not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Responses API v2
      security:
      - ApiKeyAuth: []
  /api/v2/responses/{responseId}/stream:
    get:
      operationId: streamResponse
      summary: Reconnect to an in-flight response stream
      description: '**[devs.ai extension]** Re-attach to a still-running response''s SSE event stream after a network drop. The path parameter `responseId` and the required query parameter `streamChatId` MUST be equal — `streamChatId` exists for explicit client-side intent and to align with the underlying chat-stream backend.


        When `lastSequence` is supplied, events with `sequence_number <= lastSequence` are suppressed so the client receives only events it has not yet seen. The first event delivered is therefore typically `response.in_progress` (or whatever event follows `lastSequence`), NOT `response.created`.


        This endpoint has no equivalent in OpenAI''s Responses API.


        Returns `404` when the run cannot be found, `streamChatId` does not equal `responseId`, or the underlying stream has already completed and can no longer be reattached.

        '
      x-devs-ai-extension: true
      parameters:
      - $ref: '#/components/parameters/responseId'
      - name: streamChatId
        in: query
        required: true
        description: '**[devs.ai extension]** Must equal the path `responseId`. Identifies the underlying chat-stream to attach to.'
        schema:
          type: string
          minLength: 1
        x-devs-ai-extension: true
      - name: lastSequence
        in: query
        required: false
        description: '**[devs.ai extension]** Last `sequence_number` the client has already processed. Events with `sequence_number <= lastSequence` are suppressed. Default `-1` (no events suppressed).'
        schema:
          type: integer
          minimum: -1
          default: -1
        x-devs-ai-extension: true
      responses:
        '200':
          description: SSE event stream identical in shape to the create-response stream (see Streaming Events section).
          headers:
            x-response-id:
              schema:
                type: string
              description: Echoed response run identifier.
            x-stream-chat-id:
              schema:
                type: string
              description: '**[devs.ai extension]** Echoed `streamChatId` query parameter.'
              x-devs-ai-extension: true
          content:
            text/event-stream:
              schema:
                description: SSE event stream. See Streaming Events section.
                type: string
        '404':
          description: Response not found, `streamChatId` does not match `responseId`, or the underlying stream has already completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Responses API v2
      security:
      - ApiKeyAuth: []
  /api/v2/responses/{responseId}/cancel:
    post:
      operationId: cancelResponse
      summary: Cancel a response
      description: 'Cancel an active response run. Only works for threaded execution mode.

        Idempotent — returns success if the response is already in a terminal state.

        Sends a `CANCEL_ACTIVE_REQUEST` signal to the Temporal workflow.

        '
      parameters:
      - $ref: '#/components/parameters/responseId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelResponseRequest'
      responses:
        '200':
          description: Cancel requested (or already terminal)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ControlResponse'
        '404':
          description: Response not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Not a threaded response (stateless responses cannot be cancelled via this endpoint)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Responses API v2
      security:
      - ApiKeyAuth: []
  /api/v2/responses/{responseId}/pause:
    post:
      operationId: pauseResponse
      summary: Pause a response
      description: '**[devs.ai extension]** Pause an active response run. Execution halts at the next safe checkpoint;

        in-flight activities complete but no new turns are scheduled.

        Only works for threaded execution mode. No equivalent in OpenAI''s Responses API.

        '
      x-devs-ai-extension: true
      parameters:
      - $ref: '#/components/parameters/responseId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PauseResponseRequest'
      responses:
        '200':
          description: Pause requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ControlResponse'
        '404':
          description: Response not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Not a threaded response or already terminal
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Responses API v2
      security:
      - ApiKeyAuth: []
  /api/v2/responses/{responseId}/resume:
    post:
      operationId: resumeResponse
      summary: Resume a response
      description: '**[devs.ai extension]** Resume a paused response run. Optionally provide tool outputs for

        human-in-the-loop tool calling (function tools that require client execution).

        Only works for threaded execution mode. No equivalent in OpenAI''s Responses API.

        '
      x-devs-ai-extension: true
      parameters:
      - $ref: '#/components/parameters/responseId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResumeResponseRequest'
      responses:
        '200':
          description: Resume requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ControlResponse'
        '404':
          description: Response not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Not a threaded response or already terminal
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Responses API v2
      security:
      - ApiKeyAuth: []
  /api/v2/responses/{responseId}/deep-research/resume:
    post:
      operationId: resumeDeepResearch
      summary: Resume a deep research subagent
      description: '**[devs.ai extension]** Resume a paused deep research child workflow. Used to approve, deny,

        or provide clarification for a deep research run that is awaiting

        human input. Signals the deep research subagent workflow directly. No equivalent in OpenAI''s Responses API.

        '
      x-devs-ai-extension: true
      parameters:
      - $ref: '#/components/parameters/responseId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResumeDeepResearchRequest'
      responses:
        '200':
          description: Resume requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeepResearchControlResponse'
        '404':
          description: Response not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Response is already terminal
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Responses API v2
      security:
      - ApiKeyAuth: []
components:
  schemas:
    PythonToolDefinition:
      type: object
      required:
      - type
      description: '**[devs.ai extension]** Server-side Python execution tool. Conceptually similar to OpenAI''s `code_interpreter` tool, but devs.ai emits `server_tool_call` / `server_tool_call_output` items and `response.server_tool_call.*` events instead of OpenAI''s `code_interpreter_call` items and `response.code_interpreter_call.*` events.'
      x-devs-ai-extension: true
      properties:
        type:
          type: string
          enum:
          - python
    ServerToolCallResultOutputItem:
      type: object
      description: '**[devs.ai extension]** Server-executed tool call result. Emitted in pair with `ServerToolCallOutputItem` instead of OpenAI''s `code_interpreter_call_output` / `image_generation_call_output` items.'
      x-devs-ai-extension: true
      required:
      - type
      - call_id
      - output
      properties:
        type:
          type: string
          enum:
          - server_tool_call_output
        call_id:
          type: string
        output:
          type: string
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
    ToolOutput:
      type: object
      required:
      - toolCallId
      - output
      additionalProperties: false
      properties:
        toolCallId:
          type: string
          minLength: 1
        status:
          type: string
          enum:
          - success
          - error
          default: success
        output:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
    ResumeResponseRequest:
      type: object
      additionalProperties: false
      properties:
        reason:
          type: string
        toolOutputs:
          type: array
          items:
            $ref: '#/components/schemas/ToolOutput'
    Response:
      type: object
      required:
      - id
      - object
      - status
      - output
      - created_at
      description: A model response. Mirrors OpenAI's Responses API `Response` shape with the devs.ai extensions noted below.
      properties:
        id:
          type: string
        object:
          type: string
          enum:
          - response
        status:
          $ref: '#/components/schemas/ResponseStatus'
        model:
          type: string
          nullable: true
        output:
          type: array
          items:
            $ref: '#/components/schemas/OutputItem'
        usage:
          $ref: '#/components/schemas/Usage'
        error:
          $ref: '#/components/schemas/ResponseError'
        created_at:
          type: integer
          description: Unix timestamp (seconds since epoch) when the response was created.
        instructions:
          type: string
          nullable: true
          description: Echoed instructions from the request.
        temperature:
          type: number
          nullable: true
        top_p:
          type: number
          nullable: true
        max_output_tokens:
          type: integer
          nullable: true
        metadata:
          type: object
          nullable: true
          additionalProperties:
            type: string
        previous_response_id:
          type: string
          nullable: true
        parallel_tool_calls:
          type: boolean
          description: Whether the model was allowed to call tools in parallel for this response. Echoed from the request; defaults to `true` when not set on the request.
        incomplete_details:
          type: object
          nullable: true
          description: 'Details about why the response is incomplete (only populated when `status: "incomplete"`).'
          properties:
            reason:
              type: string
              enum:
              - max_output_tokens
              - content_filter
              - paused
              description: OpenAI's enum is `["max_output_tokens", "content_filter"]`. The value `paused` is a **[devs.ai extension]** emitted when an in-flight run is paused via `POST /api/v2/responses/{responseId}/pause`.
              x-devs-ai-extension-values:
              - paused
        tool_choice:
          oneOf:
          - type: string
            nullable: true
          - type: object
            additionalProperties: true
            nullable: true
          description: Echoed tool choice strategy from the request.
        tools:
          type: array
          nullable: true
          items: {}
          description: Echoed tools from the request.
        text:
          type: object
          additionalProperties: true
          nullable: true
          description: Echoed text format configuration from the request.
        reasoning:
          type: object
          additionalProperties: true
          nullable: true
          description: Echoed reasoning configuration from the request.
        selection_metadata:
          type: object
          description: '**[devs.ai extension]** Model routing / selection metadata captured during the run (chosen provider, fallback chain, latency hints, etc.).'
          nullable: true
          additionalProperties: true
          x-devs-ai-extension: true
    InputContentPart:
      description: 'Content part for an `InputMessageInputItem` (`role: user|system|developer`). Mirrors OpenAI''s `InputContent` union: `input_text`, `input_image`, or `input_file` only.'
      oneOf:
      - $ref: '#/components/schemas/InputTextContent'
      - $ref: '#/components/schemas/InputImageContent'
      - $ref: '#/components/schemas/InputFileContent'
      discriminator:
        propertyName: type
        mapping:
          input_text: '#/components/schemas/InputTextContent'
          input_image: '#/components/schemas/InputImageContent'
          input_file: '#/components/schemas/InputFileContent'
    CreateResponseRequest:
      type: object
      required:
      - input
      additionalProperties: true
      description: Request body for `POST /api/v2/responses`. Mirrors OpenAI's Responses API `CreateResponse` shape with a small set of devs.ai extensions (each marked `**[devs.ai extension]**` below).
      properties:
        input:
          description: User prompt — plain text or an array of input items (`message`, `function_call`, `function_call_output`). See the `InputItem` schema for the full grammar.
          oneOf:
          - type: string
          - type: array
            items:
              $ref: '#/components/schemas/InputItem'
        model:
          type: string
          description: Model ID to use, like `gpt-4o` or `o3`. Required for stateless requests; optional when continuing a thread via `previous_response_id` / `conversation`.
        previous_response_id:
          type: string
          nullable: true
          description: ID of a previous response to continue the conversation. Establishes multi-turn context.
        conversation:
          description: Conversation/thread ID (string) or object with `id` field. Items from this conversation are prepended to `input` and items from this response are appended to it.
          oneOf:
          - type: string
          - type: object
            properties:
              id:
                type: string
            required:
            - id
        instructions:
          type: string
          nullable: true
          description: System/developer instructions inserted as the first item in the model's context. When used with `previous_response_id`, instructions from the previous response are not carried over.
        stream:
          type: boolean
          default: true
          description: If `true` (default), the response data is streamed to the client as Server-Sent Events. If `false`, the completed response is returned as JSON.
        tools:
          type: array
          default: []
          items:
            $ref: '#/components/schemas/ToolDefinition'
          description: Tools the model may call while generating a response. See `ToolDefinition` for available tools (most built-ins are devs.ai extensions).
        temperature:
          type: number
          minimum: 0
          maximum: 2
          description: Sampling temperature between 0 and 2. Higher values produce more random output.
        top_p:
          type: number
          minimum: 0
          maximum: 1
          description: Nucleus sampling parameter. We generally recommend altering this OR `temperature`, not both.
        max_output_tokens:
          type: integer
          minimum: 1
          description: Upper bound for the number of tokens that can be generated for a response, including reasoning tokens.
        reasoning:
          type: object
          description: Reasoning configuration for reasoning-capable models (e.g. o-series).
          properties:
            effort:
              type: string
              description: Reasoning effort. OpenAI's standard enum is `["minimal", "low", "medium", "high"]`. devs.ai also accepts the `**[devs.ai extension]**` values `none` and `xhigh`.
              enum:
              - none
              - minimal
              - low
              - medium
              - high
              - xhigh
              x-devs-ai-extension-values:
              - none
              - xhigh
            summary:
              type: string
              nullable: true
              enum:
              - auto
              - concise
              - detailed
              description: Reasoning summary verbosity.
            generate_summary:
              type: string
              nullable: true
              enum:
              - auto
              - concise
              - detailed
              description: Deprecated alias of `summary` (kept for backward compatibility with older OpenAI SDKs).
        metadata:
          type: object
          nullable: true
          additionalProperties:
            type: string
          description: Metadata key-value pairs for tagging.
        parallel_tool_calls:
          type: boolean
          description: Whether to allow the model to run tool calls in parallel. Default `true`. Echoed back on the Response object.
        tool_choice:
          description: How the model should select which tool(s) to use. Accepts the OpenAI `tool_choice` shapes (e.g. `"auto"`, `"none"`, `"required"`, or a typed object referring to a specific tool).
        store:
          type: boolean
          description: Whether to store the generated response for later retrieval via the API. Default `true`.
        truncation:
          description: Truncation strategy for the model response. OpenAI accepts `"auto"` or `"disabled"`.
        text:
          description: 'Configuration options for a text response from the model. Can be plain text or structured JSON (e.g. `{ format: { type: "json_schema", ... } }`).'
        service_tier:
          type: string
          description: Service tier to use for this request (e.g. `"auto"`, `"default"`, `"flex"`).
        user:
          type: string
          description: Stable identifier for the end-user. Used to boost cache hit rates and to help OpenAI detect abuse. Deprecated by OpenAI in favor of `safety_identifier` / `prompt_cache_key`.
        include:
          type: array
          items:
            type: string
          description: Specify additional output data to include in the model response (e.g. `file_search_call.results`, `message.input_image.image_url`, `message.output_text.logprobs`, `reasoning.encrypted_content`).
        background:
          type: boolean
          description: If `true`, the model runs in the background and the response can be polled / streamed via the dedicated endpoints.
        options:
          allOf:
          - $ref: '#/components/schemas/ChatOptions'
          - description: '**[devs.ai extension]** Internal devs.ai chat options (provider-specific routing, sub-flow tracing, etc.). Not part of the OpenAI Responses API.'
          x-devs-ai-extension: true
        chat_mode:
          type: string
          enum:
          - execute
          - chat
          - plan
          default: execute
          description: '**[devs.ai extension]** Chat execution mode: `execute` runs tools, `chat` returns text only, `plan` returns the planned steps without running them.'
          x-devs-ai-extension: true
        user_secrets:
          type: object
          additionalProperties:
            type: string
          description: '**[devs.ai extension]** User-provided API keys / secrets that tools may reference at execution time. Keys are short-lived and never persisted server-side.'
          x-devs-ai-extension: true
        thread_mode:
          allOf:
          - $ref: '#/components/schemas/ThreadMode'
          - description: '**[devs.ai extension]** How to handle a new request when an existing thread is mid-run: `collect` (queue), `steer` (signal current run), `interrupt` (cancel + start), `force` (start fresh stateless run).'
          x-devs-ai-extension: true
    OutputMessage:
      type: object
      required:
      - id
      - type
      - role
      - status
      - content
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - message
        role:
          type: string
          enum:
          - assistant
        status:
          type: string
          enum:
          - in_progress
          - completed
          - incomplete
        content:
          type: array
          items:
            $ref: '#/components/schemas/OutputTextPart'
    ResponseError:
      type: object
      nullable: true
      required:
      - code
      - message
      properties:
        code:
          type: string
        message:
          type: string
    InputImageContent:
      type: object
      required:
      - type
      properties:
        type:
          type: string
          enum:
          - input_image
        image_url:
          type: string
        file_id:
          type: string
        detail:
          type: string
          enum:
          - auto
          - low
          - high
        invisible:
          type: boolean
          description: '**[devs.ai extension]** When `true`, this image is sent to the model but hidden from end-user-facing transcripts.'
          x-devs-ai-extension: true
    WebSearchToolDefinition:
      type: object
      required:
      - type
      description: 'Web search tool. The output items (`web_search_call`) and streaming events (`response.web_search_call.in_progress|searching|completed`) emitted by devs.ai match OpenAI''s standard shapes. NOTE: OpenAI''s `web_search` / `web_search_preview` tool also accepts `user_location` and `search_context_size`; devs.ai currently ignores those input fields (they are silently dropped).'
      properties:
        type:
          type: string
          enum:
          - web_search
        includeXSearch:
          typ

# --- truncated at 32 KB (56 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/appdirect/refs/heads/main/openapi/appdirect-responses-api-v2-api-openapi.yml