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

# Responses 对话

> Omniall AI 转发的 OpenAI Responses 接口。适合新版模型、内置工具与多轮 previous_response_id。



## OpenAPI

````yaml zh-CN/openapi/xgapi-public.yaml POST /v1/responses
openapi: 3.0.3
info:
  title: Omniall AI 公开 API
  description: >-
    Omniall AI 公开 API。网站：https://omniall.ai — API 主机：https://api.omniall.ai —
    模型广场：https://omniall.ai/pricing
  version: 1.1.0
servers:
  - url: https://api.omniall.ai
    description: 生产环境
security:
  - bearerAuth: []
tags:
  - name: Models
    description: 列出当前 API Key 可用的模型。
  - name: ChatGPT Chat Completions
    x-group: ChatGPT
    description: OpenAI Chat Completions 对话接口（`POST /v1/chat/completions`）。
  - name: Responses
    description: OpenAI Responses 接口（`POST /v1/responses`）。
  - name: Claude
    description: Anthropic Messages 消息接口（`POST /v1/messages`）。
  - name: Gemini
    description: Google Gemini 原生 generateContent / streamGenerateContent。
  - name: Images
    description: 图像生成（OpenAI Images）、各厂商说明与 Midjourney 代理接口。
  - name: Video
    description: 异步视频任务。
  - name: Audio
    description: 语音合成及相关音频接口。
  - name: Rerank
    description: 文档重排序。
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Responses 对话
      description: |
        Omniall AI 转发的 OpenAI Responses API。

        **路径：** `POST https://api.omniall.ai/v1/responses`

        更适合新版 OpenAI 模型、内置工具（联网搜索），以及多轮 `previous_response_id` 流程。

        ### 常见场景
        - **视觉 / 文件**：`input` 中的 `input_image` / `input_file`
        - **联网搜索**：内置工具 `{ "type": "web_search_preview" }`
        - **Agent**：在 `tools` 中配置函数工具
        - **推理**：`reasoning.effort`

        官方参考：https://platform.openai.com/docs/api-reference/responses
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              基础对话:
                summary: 基础对话
                value:
                  model: gpt-5
                  input: 用一段话解释 Kubernetes
              图像输入:
                summary: 图像输入
                value:
                  model: gpt-5
                  input:
                    - role: user
                      content:
                        - type: input_text
                          text: 描述这张图片
                        - type: input_image
                          image_url: https://example.com/photo.jpg
              文件分析:
                summary: 文件分析
                value:
                  model: gpt-5
                  input:
                    - role: user
                      content:
                        - type: input_text
                          text: 提取这份文档的关键风险
                        - type: input_file
                          file_url: https://example.com/report.pdf
              内置联网搜索工具:
                summary: 内置联网搜索工具
                value:
                  model: gpt-5
                  tools:
                    - type: web_search_preview
                  input: OpenAI Responses API 的最新发布说明
              带函数工具的 Agent:
                summary: 带函数工具的 Agent
                value:
                  model: gpt-5
                  tools:
                    - type: function
                      name: lookup_order
                      description: 按订单号查询
                      parameters:
                        type: object
                        properties:
                          order_id:
                            type: string
                        required:
                          - order_id
                  input: 订单 A100 现在在哪？
              推理强度:
                summary: 推理强度
                value:
                  model: gpt-5
                  reasoning:
                    effort: medium
                    summary: auto
                  input: 证明素数有无穷多个
      responses:
        '200':
          description: Response 对象（流式时为 SSE 事件）。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
        '400':
          description: 请求体无效，或该模型不支持的参数。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '401':
          description: 缺少或无效的 API Key。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
              example:
                error:
                  message: '无效的令牌 (request id: ...)'
                  type: new_api_error
                  code: ''
        '403':
          description: 无权限（用户封禁、IP 白名单或分组访问限制）。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '429':
          description: 触发速率限制。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '500':
          description: 上游或网关内部错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
components:
  schemas:
    ResponsesRequest:
      type: object
      required:
        - model
      description: OpenAI Responses API 请求体（POST /v1/responses）。新版 OpenAI 模型与内置工具推荐使用。
      properties:
        model:
          type: string
          example: gpt-5
          description: 模型广场中的模型 ID。
        input:
          description: 用户输入：纯字符串，或由 input_text / input_image / input_file 等组成的数组。
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: true
        instructions:
          type: string
          description: 本次响应的系统级指令（类似 system prompt）。
        max_output_tokens:
          type: integer
          description: 模型最多可生成的 token 数。
        temperature:
          type: number
          description: 采样温度。
        top_p:
          type: number
          description: 核采样参数。
        stream:
          type: boolean
          description: 为 true 时通过 SSE 流式返回事件。
        stream_options:
          type: object
          additionalProperties: true
          description: 流式输出
        tools:
          type: array
          description: '内置工具（如 `{ "type": "web_search_preview" }`）和/或用于 Agent 的函数工具。'
          items:
            type: object
            additionalProperties: true
        tool_choice:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: 工具选择方式（`auto`、必选或指定工具）。
        parallel_tool_calls:
          oneOf:
            - type: boolean
            - type: object
          description: 支持时允许一轮内多次工具调用。
        max_tool_calls:
          type: integer
          description: 本次响应的工具调用上限。
        previous_response_id:
          type: string
          description: 从先前 response id 继续（多轮无需重发完整历史）。
        conversation:
          type: object
          additionalProperties: true
          description: 使用 Responses 会话状态时的 conversation 对象/id。
        reasoning:
          type: object
          properties:
            effort:
              type: string
              enum:
                - low
                - medium
                - high
              description: 推理强度：low / medium / high。
            summary:
              type: string
              description: 是否/如何返回推理摘要。
          description: 推理模型的推理控制。
        text:
          type: object
          additionalProperties: true
          description: 文本格式配置（支持时包含结构化输出 / json_schema）。
        include:
          type: array
          items:
            type: string
          description: 响应载荷中需要额外包含的字段。
        truncation:
          type: string
          enum:
            - auto
            - disabled
          description: 上下文溢出处理：auto 或 disabled。
        metadata:
          type: object
          additionalProperties: true
          description: 附加到响应的任意元数据。
        store:
          description: 上游是否可存储交互（视渠道设置而定）。
          oneOf:
            - type: boolean
            - type: object
        user:
          type: string
          description: 终端用户标识，用于滥用监控。
    ResponsesResponse:
      type: object
      properties:
        id:
          type: string
          description: 响应 id（配合 previous_response_id 使用）。
        object:
          type: string
          example: response
          description: 通常为 response。
        created_at:
          type: integer
          description: Unix 时间戳。
        status:
          type: string
          enum:
            - completed
            - failed
            - in_progress
            - incomplete
          description: 生命周期状态：completed、failed、in_progress、incomplete。
        model:
          type: string
          description: 所用模型。
        output:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              id:
                type: string
              status:
                type: string
              role:
                type: string
              content:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                    text:
                      type: string
          description: 输出项（消息、工具调用等）。从消息内容块读取回答文本。
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
              description: 输入 token。
            output_tokens:
              type: integer
              description: 输出 token。
            total_tokens:
              type: integer
              description: 总 token。
          description: Token 用量。
      description: Responses 接口
    OpenAIErrorResponse:
      type: object
      description: 鉴权或请求失败时返回的 OpenAI 风格错误包络。
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              description: 人类可读错误信息。网关可能附加 request id 便于排查。
            type:
              type: string
              description: 错误类型，常见为 `new_api_error`。
              example: new_api_error
            code:
              type: string
              description: 可选机器可读错误码（如 `access_denied`），可能为空字符串。
          description: 错误对象。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: '使用来自 https://omniall.ai/dashboard 的 Authorization: Bearer sk-...'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.