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

# 创建响应

Response API 是 OpenAI 最先进的模型响应生成接口，支持文本和图像输入，输出文本内容。


## OpenAPI

````yaml openapi.yaml POST /responses
openapi: 3.1.0
info:
  title: 极客智坊 API文档
  description: 极客智坊 API 消息接口规范文档
  version: 1.0.0
servers:
  - url: https://geekai.co/api/v1
    description: 国内代理入口
  - url: https://geekai.dev/api/v1
    description: 海外代理入口
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /responses:
    post:
      tags:
        - Response
      summary: 创建响应接口
      description: 用于创建响应的接口，目前仅 OpenAI 支持，可配置各种参数来控制响应的生成结果。
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateResponse'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ResponseStreamEvent'
components:
  schemas:
    CreateResponse:
      allOf:
        - $ref: '#/components/schemas/CreateModelResponseProperties'
        - $ref: '#/components/schemas/ResponseProperties'
        - type: object
          properties:
            input:
              description: |
                用于生成响应的文本、图片或文件输入

                更多细节:
                - [文本输入输出](/docs/response/create)
                - [图片输入](/docs/response/image)
                - [联网搜索](/docs/response/web_search)
                - [函数调用](/docs/response/tool_calls)
              oneOf:
                - type: string
                  title: 文本输入
                  description: |
                    模型输入文本字符串
                - type: array
                  title: 对象列表
                  description: |
                    多模态对象输入列表
                  items:
                    $ref: '#/components/schemas/InputItem'
            include:
              type: array
              description: >
                指定模型响应中需额外包含的数据。目前支持以下值：


                - `file_search_call.results`: 包含文件搜索工具调用所产生的搜索结果。

                - `message.input_image.image_url`: 包含输入消息中的图片链接。

                - `computer_call_output.output.image_url`: 包含计算机调用（computer
                call）输出的图片链接。

                - `reasoning.encrypted_content`: 在推理项（reasoning
                item）的输出中，包含对推理过程令牌（reasoning tokens）的加密版本。如此一来，当以无状态方式使用
                Responses API 时（例如，当 store 参数设置为
                false，或当组织加入了“零数据保留”计划时），推理项便可在多轮对话中继续使用。

                - `code_interpreter_call.outputs`: 包含代码解释器工具调用项中，Python 代码的执行输出。
              items:
                $ref: '#/components/schemas/Includable'
              nullable: true
            parallel_tool_calls:
              type: boolean
              description: |
                是否允许模型并行执行工具调用
              default: true
              nullable: true
            store:
              type: boolean
              description: |
                是否存储生成的模型响应，以供后续通过 API 检索
              default: true
              nullable: true
            instructions:
              type: string
              nullable: true
              description: >
                插入到模型上下文中的系统（或开发者）消息。


                当与 `previous_response_id`
                一同使用时，先前响应中的指令将不会被沿用至新的响应中。这使得在新响应中可以轻松地替换系统（或开发者）消息。
            stream:
              description: >
                若设为 true，模型响应数据将在生成时，通过 [Server-Sent
                Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
                流式传输至客户端。

                [代码示例](/docs/response/streaming)
              type: boolean
              nullable: true
              default: false
    Response:
      title: The response object
      allOf:
        - $ref: '#/components/schemas/ModelResponseProperties'
        - $ref: '#/components/schemas/ResponseProperties'
        - type: object
          properties:
            id:
              type: string
              description: |
                此响应的唯一标识符
            object:
              type: string
              description: |
                该资源的对象类型 - 始终设置为 `response`。
              enum:
                - response
              x-stainless-const: true
            status:
              type: string
              description: |
                响应生成的状态。可能的值有 `completed`、`failed`、
                `in_progress`、`cancelled`、`queued` 或 `incomplete`。
              enum:
                - completed
                - failed
                - in_progress
                - cancelled
                - queued
                - incomplete
            created_at:
              type: number
              description: |
                此响应创建时的 Unix 时间戳（以秒为单位）。
            error:
              $ref: '#/components/schemas/ResponseError'
            incomplete_details:
              type: object
              nullable: true
              description: |
                响应不完整的详细信息。
              properties:
                reason:
                  type: string
                  description: 响应不完整的原因。
                  enum:
                    - max_output_tokens
                    - content_filter
            output:
              type: array
              description: >
                由模型生成的内容项数组。


                - `output` 数组中项目的长度和顺序取决于模型的响应。

                - 与其访问 `output` 数组中的第一个项目并假设它是包含模型生成内容的 `assistant` 消息，不如考虑在 SDK
                中使用 `output_text` 属性（如果支持）。
              items:
                $ref: '#/components/schemas/OutputItem'
            instructions:
              nullable: true
              description: >
                插入到模型上下文中的系统（或开发者）消息。


                当与 `previous_response_id`
                一起使用时，前一个响应中的指令不会延续到下一个响应。这使得在新的响应中轻松替换系统（或开发者）消息变得容易。
              oneOf:
                - type: string
                  description: |
                    发送给模型的文本输入，相当于具有 `developer` 角色的文本输入。
                - type: array
                  title: 输入项列表
                  description: |
                    发送给模型的一个或多个输入项的列表，包含不同的内容类型。
                  items:
                    $ref: '#/components/schemas/InputItem'
            output_text:
              type: string
              nullable: true
              description: |
                仅限 SDK 的便利属性，包含 `output` 数组中所有 `output_text` 项的聚合文本输出（如果存在）。
                在 Python 和 JavaScript SDK 中支持。
              x-oaiSupportedSDKs:
                - python
                - javascript
            usage:
              $ref: '#/components/schemas/ResponseUsage'
            parallel_tool_calls:
              type: boolean
              description: |
                是否允许模型并行运行工具调用。
              default: true
          required:
            - id
            - object
            - created_at
            - error
            - incomplete_details
            - instructions
            - model
            - tools
            - output
            - parallel_tool_calls
            - metadata
            - tool_choice
            - temperature
            - top_p
      example:
        id: resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41
        object: response
        created_at: 1741476777
        status: completed
        error: null
        incomplete_details: null
        instructions: null
        max_output_tokens: null
        model: gpt-4o-2024-08-06
        output:
          - type: message
            id: msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41
            status: completed
            role: assistant
            content:
              - type: output_text
                text: >-
                  The image depicts a scenic landscape with a wooden boardwalk
                  or pathway leading through lush, green grass under a blue sky
                  with some clouds. The setting suggests a peaceful natural
                  area, possibly a park or nature reserve. There are trees and
                  shrubs in the background.
                annotations: []
        parallel_tool_calls: true
        previous_response_id: null
        reasoning:
          effort: null
          summary: null
        store: true
        temperature: 1
        text:
          format:
            type: text
        tool_choice: auto
        tools: []
        top_p: 1
        truncation: disabled
        usage:
          input_tokens: 328
          input_tokens_details:
            cached_tokens: 0
          output_tokens: 52
          output_tokens_details:
            reasoning_tokens: 0
          total_tokens: 380
        user: null
        metadata: {}
    ResponseStreamEvent:
      anyOf:
        - $ref: '#/components/schemas/ResponseAudioDeltaEvent'
        - $ref: '#/components/schemas/ResponseAudioDoneEvent'
        - $ref: '#/components/schemas/ResponseAudioTranscriptDeltaEvent'
        - $ref: '#/components/schemas/ResponseAudioTranscriptDoneEvent'
        - $ref: '#/components/schemas/ResponseCodeInterpreterCallCodeDeltaEvent'
        - $ref: '#/components/schemas/ResponseCodeInterpreterCallCodeDoneEvent'
        - $ref: '#/components/schemas/ResponseCodeInterpreterCallCompletedEvent'
        - $ref: '#/components/schemas/ResponseCodeInterpreterCallInProgressEvent'
        - $ref: '#/components/schemas/ResponseCodeInterpreterCallInterpretingEvent'
        - $ref: '#/components/schemas/ResponseCompletedEvent'
        - $ref: '#/components/schemas/ResponseContentPartAddedEvent'
        - $ref: '#/components/schemas/ResponseContentPartDoneEvent'
        - $ref: '#/components/schemas/ResponseCreatedEvent'
        - $ref: '#/components/schemas/ResponseErrorEvent'
        - $ref: '#/components/schemas/ResponseFileSearchCallCompletedEvent'
        - $ref: '#/components/schemas/ResponseFileSearchCallInProgressEvent'
        - $ref: '#/components/schemas/ResponseFileSearchCallSearchingEvent'
        - $ref: '#/components/schemas/ResponseFunctionCallArgumentsDeltaEvent'
        - $ref: '#/components/schemas/ResponseFunctionCallArgumentsDoneEvent'
        - $ref: '#/components/schemas/ResponseInProgressEvent'
        - $ref: '#/components/schemas/ResponseFailedEvent'
        - $ref: '#/components/schemas/ResponseIncompleteEvent'
        - $ref: '#/components/schemas/ResponseOutputItemAddedEvent'
        - $ref: '#/components/schemas/ResponseOutputItemDoneEvent'
        - $ref: '#/components/schemas/ResponseReasoningSummaryPartAddedEvent'
        - $ref: '#/components/schemas/ResponseReasoningSummaryPartDoneEvent'
        - $ref: '#/components/schemas/ResponseReasoningSummaryTextDeltaEvent'
        - $ref: '#/components/schemas/ResponseReasoningSummaryTextDoneEvent'
        - $ref: '#/components/schemas/ResponseRefusalDeltaEvent'
        - $ref: '#/components/schemas/ResponseRefusalDoneEvent'
        - $ref: '#/components/schemas/ResponseTextDeltaEvent'
        - $ref: '#/components/schemas/ResponseTextDoneEvent'
        - $ref: '#/components/schemas/ResponseWebSearchCallCompletedEvent'
        - $ref: '#/components/schemas/ResponseWebSearchCallInProgressEvent'
        - $ref: '#/components/schemas/ResponseWebSearchCallSearchingEvent'
        - $ref: '#/components/schemas/ResponseImageGenCallCompletedEvent'
        - $ref: '#/components/schemas/ResponseImageGenCallGeneratingEvent'
        - $ref: '#/components/schemas/ResponseImageGenCallInProgressEvent'
        - $ref: '#/components/schemas/ResponseImageGenCallPartialImageEvent'
        - $ref: '#/components/schemas/ResponseMCPCallArgumentsDeltaEvent'
        - $ref: '#/components/schemas/ResponseMCPCallArgumentsDoneEvent'
        - $ref: '#/components/schemas/ResponseMCPCallCompletedEvent'
        - $ref: '#/components/schemas/ResponseMCPCallFailedEvent'
        - $ref: '#/components/schemas/ResponseMCPCallInProgressEvent'
        - $ref: '#/components/schemas/ResponseMCPListToolsCompletedEvent'
        - $ref: '#/components/schemas/ResponseMCPListToolsFailedEvent'
        - $ref: '#/components/schemas/ResponseMCPListToolsInProgressEvent'
        - $ref: '#/components/schemas/ResponseOutputTextAnnotationAddedEvent'
        - $ref: '#/components/schemas/ResponseQueuedEvent'
        - $ref: '#/components/schemas/ResponseReasoningDeltaEvent'
        - $ref: '#/components/schemas/ResponseReasoningDoneEvent'
        - $ref: '#/components/schemas/ResponseReasoningSummaryDeltaEvent'
        - $ref: '#/components/schemas/ResponseReasoningSummaryDoneEvent'
      discriminator:
        propertyName: type
    CreateModelResponseProperties:
      allOf:
        - $ref: '#/components/schemas/ModelResponseProperties'
    ResponseProperties:
      type: object
      properties:
        previous_response_id:
          type: string
          description: >
            模型上一个响应的唯一 ID。使用此 ID
            来创建多轮对话。了解有关[对话状态](/docs/guides/conversation-state)的更多信息。
          nullable: true
        model:
          $ref: '#/components/schemas/ModelIdsResponses'
          description: >
            用于生成响应的模型 ID，例如 `gpt-4o` 或 `o3`。OpenAI
            提供各种具有不同功能、性能特征和价格的模型。请参阅[模型指南](/docs/models)来浏览和比较可用模型。
        reasoning:
          $ref: '#/components/schemas/Reasoning'
          nullable: true
        background:
          type: boolean
          description: |
            是否在后台运行模型响应。
            [了解更多](/docs/guides/background).
          default: false
          nullable: true
        max_output_tokens:
          description: >
            可以为响应生成的 token 的上限，包括可见的输出 token 和[推理
            token](/docs/guides/reasoning)。
          type: integer
          nullable: true
        text:
          type: object
          description: |
            模型文本响应的配置选项。可以是纯文本或结构化 JSON 数据。了解更多：
            - [文本输入和输出](/docs/guides/text)
            - [结构化输出](/docs/guides/structured-outputs)
          properties:
            format:
              $ref: '#/components/schemas/TextResponseFormatConfiguration'
        tools:
          type: array
          description: >
            模型在生成响应时可以调用的工具数组。您可以通过设置 `tool_choice` 参数来指定要使用的工具。


            您可以为模型提供的两类工具是：


            - **内置工具**：由 OpenAI
            提供、扩展模型功能的工具，例如[网页搜索](/docs/guides/tools-web-search)或[文件搜索](/docs/guides/tools-file-search)。了解更多有关[内置工具](/docs/guides/tools)的信息。

            -
            **函数调用（自定义工具）**：由您定义的函数，使模型能够调用您自己的代码。了解更多有关[函数调用](/docs/guides/function-calling)的信息。
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          description: |
            模型在生成响应时应如何选择使用哪个工具（或多个工具）。请参阅 `tools` 参数以了解如何指定模型可以调用的工具。
          oneOf:
            - $ref: '#/components/schemas/ToolChoiceOptions'
            - $ref: '#/components/schemas/ToolChoiceTypes'
            - $ref: '#/components/schemas/ToolChoiceFunction'
        prompt:
          $ref: '#/components/schemas/Prompt'
        truncation:
          type: string
          description: |
            用于模型响应的截断策略。
            - `auto`：如果此响应及之前的响应的上下文超出了模型的上下文窗口大小，模型将通过删除对话中间的输入项来截断响应以适应上下文窗口。
            - `disabled`（默认）：如果模型响应将超出模型的上下文窗口大小，请求将失败并返回 400 错误。
          enum:
            - auto
            - disabled
          nullable: true
          default: disabled
    InputItem:
      oneOf:
        - $ref: '#/components/schemas/EasyInputMessage'
        - $ref: '#/components/schemas/Item'
          type: object
          title: Item
          description: |
            代表模型将要生成的响应的上下文一部分的项。可以包含文本、图像和音频输入，以及之前的助手响应和工具调用输出。
        - $ref: '#/components/schemas/ItemReferenceParam'
      discriminator:
        propertyName: type
    Includable:
      type: string
      description: >
        指定要在模型响应中包含的附加输出数据。当前支持的值包括：


        * `file_search_call.results`: 包含文件搜索工具调用的搜索结果。

        * `message.input_image.image_url`: 包含输入消息中的图像 URL。

        * `computer_call_output.output.image_url`: 包含计算机调用输出中的图像 URL。

        * `reasoning.encrypted_content`: 在推理项输出中包含加密版本的推理 token。这使得在无状态使用响应
        API（例如 `store` 参数设置为 `false`，或组织已加入零数据保留计划时）的多轮对话中使用推理项成为可能。

        * `code_interpreter_call.outputs`: 包含代码解释器工具调用项中 Python 代码执行的输出。
      enum:
        - file_search_call.results
        - message.input_image.image_url
        - computer_call_output.output.image_url
        - reasoning.encrypted_content
        - code_interpreter_call.outputs
    ModelResponseProperties:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/Metadata'
        temperature:
          type: number
          minimum: 0
          maximum: 2
          default: 1
          example: 1
          nullable: true
          description: |
            要使用的采样温度，介于 0 和 2 之间。较高的值（如 0.8）将使输出更随机，而较低的值（如 0.2）将使其更聚焦和确定。
            我们通常建议修改此项或 `top_p`，但不要同时修改两者。
        top_p:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          example: 1
          nullable: true
          description: >
            采样温度的另一种方法，称为核采样，模型会考虑具有 top_p 概率质量的 token 的结果。因此，0.1 意味着只考虑包含前 10%
            概率质量的 token。


            我们通常建议修改此项或 `temperature`，但不要同时修改两者。
        user:
          type: string
          example: user-1234
          description: >
            最终用户的稳定标识符。

            用于通过更好地对类似请求进行分桶来提高缓存命中率，并帮助 OpenAI
            检测和防止滥用。[了解更多](/docs/guides/safety-best-practices#end-user-ids)。
        service_tier:
          $ref: '#/components/schemas/ServiceTier'
    ResponseError:
      type: object
      description: |
        当模型未能生成响应时返回的错误对象。
      nullable: true
      properties:
        code:
          $ref: '#/components/schemas/ResponseErrorCode'
        message:
          type: string
          description: |
            错误的易读描述。
      required:
        - code
        - message
    OutputItem:
      anyOf:
        - $ref: '#/components/schemas/OutputMessage'
        - 6a929570-a0b4-4ba2-a822-897a857d2bd6
        - $ref: '#/components/schemas/FunctionToolCall'
        - $ref: '#/components/schemas/WebSearchToolCall'
        - 5a786be9-cd37-4fa1-91da-e65c6a5b8f1b
        - $ref: '#/components/schemas/ReasoningItem'
        - $ref: '#/components/schemas/ImageGenToolCall'
        - 8b45fafe-cff5-4d70-b4c9-9e47da40f3e4
        - $ref: '#/components/schemas/LocalShellToolCall'
        - $ref: '#/components/schemas/MCPToolCall'
        - $ref: '#/components/schemas/MCPListTools'
        - $ref: '#/components/schemas/MCPApprovalRequest'
      discriminator:
        propertyName: type
    ResponseUsage:
      type: object
      description: |
        表示令牌使用详情，包括输入令牌、输出令牌、输出令牌的明细以及使用的总令牌。
      properties:
        input_tokens:
          type: integer
          description: 输入令牌的数量。
        input_tokens_details:
          type: object
          description: 输入令牌的详细明细。
          properties:
            cached_tokens:
              type: integer
              description: |
                从缓存中检索的令牌数量。
                [有关提示缓存的更多信息](/docs/chat/prompt_caching)。
          required:
            - cached_tokens
        output_tokens:
          type: integer
          description: 输出令牌的数量。
        output_tokens_details:
          type: object
          description: 输出令牌的详细明细。
          properties:
            reasoning_tokens:
              type: integer
              description: 推理令牌的数量。
          required:
            - reasoning_tokens
        total_tokens:
          type: integer
          description: 使用的总令牌数量。
      required:
        - input_tokens
        - input_tokens_details
        - output_tokens
        - output_tokens_details
        - total_tokens
    ResponseAudioDeltaEvent:
      type: object
      description: 当有部分音频响应时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.audio.delta`。
          enum:
            - response.audio.delta
          x-stainless-const: true
        sequence_number:
          type: integer
          description: |
            此流响应块的序列号。
        delta:
          type: string
          description: |
            一块 Base64 编码的响应音频字节。
      required:
        - type
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.audio.delta
        group: responses
        example: |
          {
            "type": "response.audio.delta",
            "response_id": "resp_123",
            "delta": "base64encoded...",
            "sequence_number": 1
          }
    ResponseAudioDoneEvent:
      type: object
      description: 当音频响应完成时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.audio.done`。
          enum:
            - response.audio.done
          x-stainless-const: true
        sequence_number:
          type: integer
          description: |
            delta 的序列号。
      required:
        - type
        - sequence_number
        - response_id
      x-oaiMeta:
        name: response.audio.done
        group: responses
        example: |
          {
            "type": "response.audio.done",
            "response_id": "resp-123",
            "sequence_number": 1
          }
    ResponseAudioTranscriptDeltaEvent:
      type: object
      description: 当有部分音频转录时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.audio.transcript.delta`。
          enum:
            - response.audio.transcript.delta
          x-stainless-const: true
        delta:
          type: string
          description: |
            音频响应的部分转录文本。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response_id
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.audio.transcript.delta
        group: responses
        example: |
          {
            "type": "response.audio.transcript.delta",
            "response_id": "resp_123",
            "delta": " ... partial transcript ... ",
            "sequence_number": 1
          }
    ResponseAudioTranscriptDoneEvent:
      type: object
      description: 当完整音频转录完成时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.audio.transcript.done`。
          enum:
            - response.audio.transcript.done
          x-stainless-const: true
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response_id
        - sequence_number
      x-oaiMeta:
        name: response.audio.transcript.done
        group: responses
        example: |
          {
            "type": "response.audio.transcript.done",
            "response_id": "resp_123",
            "sequence_number": 1
          }
    ResponseCodeInterpreterCallCodeDeltaEvent:
      type: object
      description: 当代码解释器流式传输部分代码片段时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.code_interpreter_call_code.delta`。
          enum:
            - response.code_interpreter_call_code.delta
          x-stainless-const: true
        output_index:
          type: integer
          description: 此代码流式传输的响应中输出项的索引。
        item_id:
          type: string
          description: 代码解释器工具调用项的唯一标识符。
        delta:
          type: string
          description: 代码解释器流式传输的部分代码片段。
        sequence_number:
          type: integer
          description: 此事件的序列号，用于对流式事件进行排序。
      required:
        - type
        - output_index
        - item_id
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.code_interpreter_call_code.delta
        group: responses
        example: |
          {
            "type": "response.code_interpreter_call_code.delta",
            "output_index": 0,
            "item_id": "ci_12345",
            "delta": "print('Hello, world')",
            "sequence_number": 1
          }
    ResponseCodeInterpreterCallCodeDoneEvent:
      type: object
      description: 当代码片段被代码解释器最终确定时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.code_interpreter_call_code.done`。
          enum:
            - response.code_interpreter_call_code.done
          x-stainless-const: true
        output_index:
          type: integer
          description: 此代码最终确定的响应中输出项的索引。
        item_id:
          type: string
          description: 代码解释器工具调用项的唯一标识符。
        code:
          type: string
          description: 代码解释器输出的最终代码片段。
        sequence_number:
          type: integer
          description: 此事件的序列号，用于对流式事件进行排序。
      required:
        - type
        - output_index
        - item_id
        - code
        - sequence_number
      x-oaiMeta:
        name: response.code_interpreter_call_code.done
        group: responses
        example: |
          {
            "type": "response.code_interpreter_call_code.done",
            "output_index": 3,
            "item_id": "ci_12345",
            "code": "print('done')",
            "sequence_number": 1
          }
    ResponseCodeInterpreterCallCompletedEvent:
      type: object
      description: 当代码解释器调用完成时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.code_interpreter_call.completed`。
          enum:
            - response.code_interpreter_call.completed
          x-stainless-const: true
        output_index:
          type: integer
          description: 此代码解释器调用完成的响应中输出项的索引。
        item_id:
          type: string
          description: 代码解释器工具调用项的唯一标识符。
        sequence_number:
          type: integer
          description: 此事件的序列号，用于对流式事件进行排序。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.code_interpreter_call.completed
        group: responses
        example: |
          {
            "type": "response.code_interpreter_call.completed",
            "output_index": 5,
            "item_id": "ci_12345",
            "sequence_number": 1
          }
    ResponseCodeInterpreterCallInProgressEvent:
      type: object
      description: 当代码解释器调用正在进行时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.code_interpreter_call.in_progress`。
          enum:
            - response.code_interpreter_call.in_progress
          x-stainless-const: true
        output_index:
          type: integer
          description: 此代码解释器调用正在进行的响应中输出项的索引。
        item_id:
          type: string
          description: 代码解释器工具调用项的唯一标识符。
        sequence_number:
          type: integer
          description: 此事件的序列号，用于对流式事件进行排序。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.code_interpreter_call.in_progress
        group: responses
        example: |
          {
            "type": "response.code_interpreter_call.in_progress",
            "output_index": 0,
            "item_id": "ci_12345",
            "sequence_number": 1
          }
    ResponseCodeInterpreterCallInterpretingEvent:
      type: object
      description: 当代码解释器正在主动解释代码片段时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.code_interpreter_call.interpreting`。
          enum:
            - response.code_interpreter_call.interpreting
          x-stainless-const: true
        output_index:
          type: integer
          description: 此代码解释器正在解释的响应中输出项的索引。
        item_id:
          type: string
          description: 代码解释器工具调用项的唯一标识符。
        sequence_number:
          type: integer
          description: 此事件的序列号，用于对流式事件进行排序。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.code_interpreter_call.interpreting
        group: responses
        example: |
          {
            "type": "response.code_interpreter_call.interpreting",
            "output_index": 4,
            "item_id": "ci_12345",
            "sequence_number": 1
          }
    ResponseCompletedEvent:
      type: object
      description: 当模型响应完成时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.completed`。
          enum:
            - response.completed
          x-stainless-const: true
        response:
          $ref: '#/components/schemas/Response'
          description: |
            完成的响应的属性。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response
        - sequence_number
      x-oaiMeta:
        name: response.completed
        group: responses
        example: |
          {
            "type": "response.completed",
            "response": {
              "id": "resp_123",
              "object": "response",
              "created_at": 1740855869,
              "status": "completed",
              "error": null,
              "incomplete_details": null,
              "input": [],
              "instructions": null,
              "max_output_tokens": null,
              "model": "gpt-4o-mini-2024-07-18",
              "output": [
                {
                  "id": "msg_123",
                  "type": "message",
                  "role": "assistant",
                  "content": [
                    {
                      "type": "output_text",
                      "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
                      "annotations": []
                    }
                  ]
                }
              ],
              "previous_response_id": null,
              "reasoning_effort": null,
              "store": false,
              "temperature": 1,
              "text": {
                "format": {
                  "type": "text"
                }
              },
              "tool_choice": "auto",
              "tools": [],
              "top_p": 1,
              "truncation": "disabled",
              "usage": {
                "input_tokens": 0,
                "output_tokens": 0,
                "output_tokens_details": {
                  "reasoning_tokens": 0
                },
                "total_tokens": 0
              },
              "user": null,
              "metadata": {}
            },
            "sequence_number": 1
          }
    ResponseContentPartAddedEvent:
      type: object
      description: 当添加新的内容部分时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.content_part.added`。
          enum:
            - response.content_part.added
          x-stainless-const: true
        item_id:
          type: string
          description: |
            添加内容部分的输出项的 ID。
        output_index:
          type: integer
          description: |
            添加内容部分的输出项的索引。
        content_index:
          type: integer
          description: |
            添加的内容部分的索引。
        part:
          $ref: '#/components/schemas/OutputContent'
          description: |
            添加的内容部分。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - content_index
        - part
        - sequence_number
      x-oaiMeta:
        name: response.content_part.added
        group: responses
        example: |
          {
            "type": "response.content_part.added",
            "item_id": "msg_123",
            "output_index": 0,
            "content_index": 0,
            "part": {
              "type": "output_text",
              "text": "",
              "annotations": []
            },
            "sequence_number": 1
          }
    ResponseContentPartDoneEvent:
      type: object
      description: 当内容部分完成时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.content_part.done`.
          enum:
            - response.content_part.done
          x-stainless-const: true
        item_id:
          type: string
          description: |
            添加内容部分的输出项的 ID.
        output_index:
          type: integer
          description: |
            添加内容部分的输出项的索引.
        content_index:
          type: integer
          description: |
            完成的内容部分的索引.
        sequence_number:
          type: integer
          description: 此事件的序列号。
        part:
          $ref: '#/components/schemas/OutputContent'
          description: |
            完成的内容部分。
      required:
        - type
        - item_id
        - output_index
        - content_index
        - part
        - sequence_number
      x-oaiMeta:
        name: response.content_part.done
        group: responses
        example: |
          {
            "type": "response.content_part.done",
            "item_id": "msg_123",
            "output_index": 0,
            "content_index": 0,
            "sequence_number": 1,
            "part": {
              "type": "output_text",
              "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
              "annotations": []
            }
          }
    ResponseCreatedEvent:
      type: object
      description: |
        创建响应时发出的事件。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.created`.
          enum:
            - response.created
          x-stainless-const: true
        response:
          $ref: '#/components/schemas/Response'
          description: |
            创建的响应。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response
        - sequence_number
      x-oaiMeta:
        name: response.created
        group: responses
        example: |
          {
            "type": "response.created",
            "response": {
              "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
              "object": "response",
              "created_at": 1741487325,
              "status": "in_progress",
              "error": null,
              "incomplete_details": null,
              "instructions": null,
              "max_output_tokens": null,
              "model": "gpt-4o-2024-08-06",
              "output": [],
              "parallel_tool_calls": true,
              "previous_response_id": null,
              "reasoning": {
                "effort": null,
                "summary": null
              },
              "store": true,
              "temperature": 1,
              "text": {
                "format": {
                  "type": "text"
                }
              },
              "tool_choice": "auto",
              "tools": [],
              "top_p": 1,
              "truncation": "disabled",
              "usage": null,
              "user": null,
              "metadata": {}
            },
            "sequence_number": 1
          }
    ResponseErrorEvent:
      type: object
      description: Emitted when an error occurs.
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `error`。
          enum:
            - error
          x-stainless-const: true
        code:
          type: string
          description: |
            错误代码。
          nullable: true
        message:
          type: string
          description: |
            错误消息。
        param:
          type: string
          description: |
            错误参数。
          nullable: true
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - code
        - message
        - param
        - sequence_number
      x-oaiMeta:
        name: error
        group: responses
        example: |
          {
            "type": "error",
            "code": "ERR_SOMETHING",
            "message": "Something went wrong",
            "param": null,
            "sequence_number": 1
          }
    ResponseFileSearchCallCompletedEvent:
      type: object
      description: Emitted when a file search call is completed (results found).
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.file_search_call.completed`.
          enum:
            - response.file_search_call.completed
          x-stainless-const: true
        output_index:
          type: integer
          description: |
            发起文件搜索调用的输出项的索引。
        item_id:
          type: string
          description: |
            发起文件搜索调用的输出项的 ID。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.file_search_call.completed
        group: responses
        example: |
          {
            "type": "response.file_search_call.completed",
            "output_index": 0,
            "item_id": "fs_123",
            "sequence_number": 1
          }
    ResponseFileSearchCallInProgressEvent:
      type: object
      description: Emitted when a file search call is initiated.
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.file_search_call.in_progress`.
          enum:
            - response.file_search_call.in_progress
          x-stainless-const: true
        output_index:
          type: integer
          description: |
            发起文件搜索调用的输出项的索引。
        item_id:
          type: string
          description: |
            发起文件搜索调用的输出项的 ID。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.file_search_call.in_progress
        group: responses
        example: |
          {
            "type": "response.file_search_call.in_progress",
            "output_index": 0,
            "item_id": "fs_123",
            "sequence_number": 1
          }
    ResponseFileSearchCallSearchingEvent:
      type: object
      description: 当文件搜索正在进行时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.file_search_call.searching`.
          enum:
            - response.file_search_call.searching
          x-stainless-const: true
        output_index:
          type: integer
          description: |
            文件搜索调用正在搜索的输出项的索引。
        item_id:
          type: string
          description: |
            发起文件搜索调用的输出项的 ID。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.file_search_call.searching
        group: responses
        example: |
          {
            "type": "response.file_search_call.searching",
            "output_index": 0,
            "item_id": "fs_123",
            "sequence_number": 1
          }
    ResponseFunctionCallArgumentsDeltaEvent:
      type: object
      description: 当存在部分函数调用参数增量时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.function_call_arguments.delta`。
          enum:
            - response.function_call_arguments.delta
          x-stainless-const: true
        item_id:
          type: string
          description: |
            函数调用参数增量添加到的输出项的 ID。
        output_index:
          type: integer
          description: |
            函数调用参数增量添加到的输出项的索引。
        sequence_number:
          type: integer
          description: 此事件的序列号。
        delta:
          type: string
          description: |
            函数调用参数增量添加到的输出项的 ID。
      required:
        - type
        - item_id
        - output_index
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.function_call_arguments.delta
        group: responses
        example: |
          {
            "type": "response.function_call_arguments.delta",
            "item_id": "item-abc",
            "output_index": 0,
            "delta": "{ \"arg\":"
            "sequence_number": 1
          }
    ResponseFunctionCallArgumentsDoneEvent:
      type: object
      description: 当函数调用参数最终确定时发出。
      properties:
        type:
          type: string
          enum:
            - response.function_call_arguments.done
          x-stainless-const: true
        item_id:
          type: string
          description: The ID of the item.
        output_index:
          type: integer
          description: 输出项的索引。
        sequence_number:
          type: integer
          description: 此事件的序列号。
        arguments:
          type: string
          description: 函数调用参数。
      required:
        - type
        - item_id
        - output_index
        - arguments
        - sequence_number
      x-oaiMeta:
        name: response.function_call_arguments.done
        group: responses
        example: |
          {
            "type": "response.function_call_arguments.done",
            "item_id": "item-abc",
            "output_index": 1,
            "arguments": "{ \"arg\": 123 }",
            "sequence_number": 1
          }
    ResponseInProgressEvent:
      type: object
      description: 当响应处于进行中状态时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.in_progress`。
          enum:
            - response.in_progress
          x-stainless-const: true
        response:
          $ref: '#/components/schemas/Response'
          description: |
            正在进行的响应。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response
        - sequence_number
      x-oaiMeta:
        name: response.in_progress
        group: responses
        example: |
          {
            "type": "response.in_progress",
            "response": {
              "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c",
              "object": "response",
              "created_at": 1741487325,
              "status": "in_progress",
              "error": null,
              "incomplete_details": null,
              "instructions": null,
              "max_output_tokens": null,
              "model": "gpt-4o-2024-08-06",
              "output": [],
              "parallel_tool_calls": true,
              "previous_response_id": null,
              "reasoning": {
                "effort": null,
                "summary": null
              },
              "store": true,
              "temperature": 1,
              "text": {
                "format": {
                  "type": "text"
                }
              },
              "tool_choice": "auto",
              "tools": [],
              "top_p": 1,
              "truncation": "disabled",
              "usage": null,
              "user": null,
              "metadata": {}
            },
            "sequence_number": 1
          }
    ResponseFailedEvent:
      type: object
      description: |
        响应失败时发出的事件。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.failed`.
          enum:
            - response.failed
          x-stainless-const: true
        sequence_number:
          type: integer
          description: 此事件的序列号。
        response:
          $ref: '#/components/schemas/Response'
          description: |
            失败的响应。
      required:
        - type
        - response
        - sequence_number
      x-oaiMeta:
        name: response.failed
        group: responses
        example: |
          {
            "type": "response.failed",
            "response": {
              "id": "resp_123",
              "object": "response",
              "created_at": 1740855869,
              "status": "failed",
              "error": {
                "code": "server_error",
                "message": "The model failed to generate a response."
              },
              "incomplete_details": null,
              "instructions": null,
              "max_output_tokens": null,
              "model": "gpt-4o-mini-2024-07-18",
              "output": [],
              "previous_response_id": null,
              "reasoning_effort": null,
              "store": false,
              "temperature": 1,
              "text": {
                "format": {
                  "type": "text"
                }
              },
              "tool_choice": "auto",
              "tools": [],
              "top_p": 1,
              "truncation": "disabled",
              "usage": null,
              "user": null,
              "metadata": {}
            }
          }
    ResponseIncompleteEvent:
      type: object
      description: |
        一个事件，当响应以不完整状态完成时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.incomplete`。
          enum:
            - response.incomplete
          x-stainless-const: true
        response:
          $ref: '#/components/schemas/Response'
          description: |
            不完整的响应。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response
        - sequence_number
      x-oaiMeta:
        name: response.incomplete
        group: responses
        example: |
          {
            "type": "response.incomplete",
            "response": {
              "id": "resp_123",
              "object": "response",
              "created_at": 1740855869,
              "status": "incomplete",
              "error": null, 
              "incomplete_details": {
                "reason": "max_tokens"
              },
              "instructions": null,
              "max_output_tokens": null,
              "model": "gpt-4o-mini-2024-07-18",
              "output": [],
              "previous_response_id": null,
              "reasoning_effort": null,
              "store": false,
              "temperature": 1,
              "text": {
                "format": {
                  "type": "text"
                }
              },
              "tool_choice": "auto",
              "tools": [],
              "top_p": 1,
              "truncation": "disabled",
              "usage": null,
              "user": null,
              "metadata": {}
            },
            "sequence_number": 1
          }
    ResponseOutputItemAddedEvent:
      type: object
      description: 添加新输出项时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.output_item.added`。
          enum:
            - response.output_item.added
          x-stainless-const: true
        output_index:
          type: integer
          description: |
            添加的输出项的索引。
        sequence_number:
          type: integer
          description: |
            此事件的序列号。
        item:
          $ref: '#/components/schemas/OutputItem'
          description: |
            添加的输出项。
      required:
        - type
        - output_index
        - item
        - sequence_number
      x-oaiMeta:
        name: response.output_item.added
        group: responses
        example: |
          {
            "type": "response.output_item.added",
            "output_index": 0,
            "item": {
              "id": "msg_123",
              "status": "in_progress",
              "type": "message",
              "role": "assistant",
              "content": []
            },
            "sequence_number": 1
          }
    ResponseOutputItemDoneEvent:
      type: object
      description: 输出项被标记为完成时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.output_item.done`。
          enum:
            - response.output_item.done
          x-stainless-const: true
        output_index:
          type: integer
          description: |
            被标记为完成的输出项的索引。
        sequence_number:
          type: integer
          description: |
            此事件的序列号。
        item:
          $ref: '#/components/schemas/OutputItem'
          description: |
            被标记为完成的输出项。
      required:
        - type
        - output_index
        - item
        - sequence_number
      x-oaiMeta:
        name: response.output_item.done
        group: responses
        example: |
          {
            "type": "response.output_item.done",
            "output_index": 0,
            "item": {
              "id": "msg_123",
              "status": "completed",
              "type": "message",
              "role": "assistant",
              "content": [
                {
                  "type": "output_text",
                  "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
                  "annotations": []
                }
              ]
            },
            "sequence_number": 1
          }
    ResponseReasoningSummaryPartAddedEvent:
      type: object
      description: 添加新的推理摘要部分时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.reasoning_summary_part.added`。
          enum:
            - response.reasoning_summary_part.added
          x-stainless-const: true
        item_id:
          type: string
          description: |
            此摘要部分关联的项目的唯一标识符。
        output_index:
          type: integer
          description: |
            此摘要部分关联的输出项的索引。
        summary_index:
          type: integer
          description: |
            此摘要部分在推理摘要中的索引。
        sequence_number:
          type: integer
          description: |
            此事件的序列号。
        part:
          type: object
          description: |
            添加的摘要部分。
          properties:
            type:
              type: string
              description: 摘要部分的类型。始终为 `summary_text`。
              enum:
                - summary_text
              x-stainless-const: true
            text:
              type: string
              description: 摘要部分的文本。
          required:
            - type
            - text
      required:
        - type
        - item_id
        - output_index
        - summary_index
        - part
        - sequence_number
      x-oaiMeta:
        name: response.reasoning_summary_part.added
        group: responses
        example: |
          {
            "type": "response.reasoning_summary_part.added",
            "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
            "output_index": 0,
            "summary_index": 0,
            "part": {
              "type": "summary_text",
              "text": ""
            },
            "sequence_number": 1
          }
    ResponseReasoningSummaryPartDoneEvent:
      type: object
      description: 当推理摘要部分完成时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.reasoning_summary_part.done`。
          enum:
            - response.reasoning_summary_part.done
          x-stainless-const: true
        item_id:
          type: string
          description: |
            此摘要部分关联的项目的唯一标识符。
        output_index:
          type: integer
          description: |
            此摘要部分关联的输出项的索引。
        summary_index:
          type: integer
          description: |
            此摘要部分在推理摘要中的索引。
        sequence_number:
          type: integer
          description: |
            此事件的序列号。
        part:
          type: object
          description: |
            完成的摘要部分。
          properties:
            type:
              type: string
              description: 摘要部分的类型。始终为 `summary_text`。
              enum:
                - summary_text
              x-stainless-const: true
            text:
              type: string
              description: 摘要部分的文本。
          required:
            - type
            - text
      required:
        - type
        - item_id
        - output_index
        - summary_index
        - part
        - sequence_number
      x-oaiMeta:
        name: response.reasoning_summary_part.done
        group: responses
        example: |
          {
            "type": "response.reasoning_summary_part.done",
            "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
            "output_index": 0,
            "summary_index": 0,
            "part": {
              "type": "summary_text",
              "text": "**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!"
            },
            "sequence_number": 1
          }
    ResponseReasoningSummaryTextDeltaEvent:
      type: object
      description: 添加推理摘要文本的增量时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.reasoning_summary_text.delta`。
          enum:
            - response.reasoning_summary_text.delta
          x-stainless-const: true
        item_id:
          type: string
          description: |
            此摘要文本增量关联的项目的唯一标识符。
        output_index:
          type: integer
          description: |
            此摘要文本增量关联的输出项的索引。
        summary_index:
          type: integer
          description: |
            此摘要部分在推理摘要中的索引。
        delta:
          type: string
          description: |
            添加到摘要的文本增量。
        sequence_number:
          type: integer
          description: |
            此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - summary_index
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.reasoning_summary_text.delta
        group: responses
        example: |
          {
            "type": "response.reasoning_summary_text.delta",
            "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
            "output_index": 0,
            "summary_index": 0,
            "delta": "**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
            "sequence_number": 1
          }
    ResponseReasoningSummaryTextDoneEvent:
      type: object
      description: 推理摘要文本完成时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.reasoning_summary_text.done`。
          enum:
            - response.reasoning_summary_text.done
          x-stainless-const: true
        item_id:
          type: string
          description: |
            此摘要文本关联的项目的唯一标识符。
        output_index:
          type: integer
          description: |
            此摘要文本关联的输出项的索引。
        summary_index:
          type: integer
          description: |
            此摘要部分在推理摘要中的索引。
        text:
          type: string
          description: |
            完整的推理摘要文本。
        sequence_number:
          type: integer
          description: |
            此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - summary_index
        - text
        - sequence_number
      x-oaiMeta:
        name: response.reasoning_summary_text.done
        group: responses
        example: |
          {
            "type": "response.reasoning_summary_text.done",
            "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476",
            "output_index": 0,
            "summary_index": 0,
            "text": "**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!",
            "sequence_number": 1
          }
    ResponseRefusalDeltaEvent:
      type: object
      description: 当有部分拒绝文本时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.refusal.delta`。
          enum:
            - response.refusal.delta
          x-stainless-const: true
        item_id:
          type: string
          description: |
            此拒绝文本关联的输出项的唯一标识符。
        output_index:
          type: integer
          description: |
            此拒绝文本关联的输出项的索引。
        content_index:
          type: integer
          description: |
            此拒绝文本关联的内容部分的索引。
        delta:
          type: string
          description: |
            添加的拒绝文本。
        sequence_number:
          type: integer
          description: |
            此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - content_index
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.refusal.delta
        group: responses
        example: |
          {
            "type": "response.refusal.delta",
            "item_id": "msg_123",
            "output_index": 0,
            "content_index": 0,
            "delta": "refusal text so far",
            "sequence_number": 1
          }
    ResponseRefusalDoneEvent:
      type: object
      description: 当拒绝文本最终确定时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.refusal.done`。
          enum:
            - response.refusal.done
          x-stainless-const: true
        item_id:
          type: string
          description: |
            此拒绝文本关联的输出项的唯一标识符。
        output_index:
          type: integer
          description: |
            此拒绝文本关联的输出项的索引。
        content_index:
          type: integer
          description: |
            此拒绝文本关联的内容部分的索引。
        refusal:
          type: string
          description: |
            最终确定的拒绝文本。
        sequence_number:
          type: integer
          description: |
            此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - content_index
        - refusal
        - sequence_number
      x-oaiMeta:
        name: response.refusal.done
        group: responses
        example: |
          {
            "type": "response.refusal.done",
            "item_id": "item-abc",
            "output_index": 1,
            "content_index": 2,
            "refusal": "final refusal text",
            "sequence_number": 1
          }
    ResponseTextDeltaEvent:
      type: object
      description: 有附加文本增量时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.output_text.delta`。
          enum:
            - response.output_text.delta
          x-stainless-const: true
        item_id:
          type: string
          description: |
            此输出项的唯一标识符，文本增量被添加到该输出项。
        output_index:
          type: integer
          description: |
            此输出项的索引，文本增量被添加到该输出项。
        content_index:
          type: integer
          description: |
            此内容部分的索引，文本增量被添加到该内容部分。
        delta:
          type: string
          description: |
            添加的文本增量。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - content_index
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.output_text.delta
        group: responses
        example: |
          {
            "type": "response.output_text.delta",
            "item_id": "msg_123",
            "output_index": 0,
            "content_index": 0,
            "delta": "In",
            "sequence_number": 1
          }
    ResponseTextDoneEvent:
      type: object
      description: 文本内容最终确定时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.output_text.done`。
          enum:
            - response.output_text.done
          x-stainless-const: true
        item_id:
          type: string
          description: |
            此输出项的唯一标识符，文本内容被最终确定到该输出项。
        output_index:
          type: integer
          description: |
            此输出项的索引，文本内容被最终确定到该输出项。
        content_index:
          type: integer
          description: |
            此内容部分的索引，文本内容被最终确定到该内容部分。
        text:
          type: string
          description: |
            最终确定的文本内容。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - content_index
        - text
        - sequence_number
      x-oaiMeta:
        name: response.output_text.done
        group: responses
        example: |
          {
            "type": "response.output_text.done",
            "item_id": "msg_123",
            "output_index": 0,
            "content_index": 0,
            "text": "In a shimmering forest under a sky full of stars, a lonely unicorn named Lila discovered a hidden pond that glowed with moonlight. Every night, she would leave sparkling, magical flowers by the water's edge, hoping to share her beauty with others. One enchanting evening, she woke to find a group of friendly animals gathered around, eager to be friends and share in her magic.",
            "sequence_number": 1
          }
    ResponseWebSearchCallCompletedEvent:
      type: object
      description: 网页搜索调用完成时发出。.
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.web_search_call.completed`。
          enum:
            - response.web_search_call.completed
          x-stainless-const: true
        output_index:
          type: integer
          description: |
            此网页搜索调用关联的输出项的索引。
        item_id:
          type: string
          description: |
            此网页搜索调用关联的输出项的唯一标识符。
        sequence_number:
          type: integer
          description: 此网页搜索调用的序列号。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.web_search_call.completed
        group: responses
        example: |
          {
            "type": "response.web_search_call.completed",
            "output_index": 0,
            "item_id": "ws_123",
            "sequence_number": 0
          }
    ResponseWebSearchCallInProgressEvent:
      type: object
      description: 发起网页搜索调用时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.web_search_call.in_progress`。
          enum:
            - response.web_search_call.in_progress
          x-stainless-const: true
        output_index:
          type: integer
          description: |
            此网页搜索调用关联的输出项的索引。
        item_id:
          type: string
          description: |
            此网页搜索调用关联的输出项的唯一标识符。
        sequence_number:
          type: integer
          description: 此网页搜索调用的序列号。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.web_search_call.in_progress
        group: responses
        example: |
          {
            "type": "response.web_search_call.in_progress",
            "output_index": 0,
            "item_id": "ws_123",
            "sequence_number": 0
          }
    ResponseWebSearchCallSearchingEvent:
      type: object
      description: 网页搜索调用正在执行时发出。
      properties:
        type:
          type: string
          description: |
            事件的类型。始终为 `response.web_search_call.searching`。
          enum:
            - response.web_search_call.searching
          x-stainless-const: true
        output_index:
          type: integer
          description: |
            此网页搜索调用关联的输出项的索引。
        item_id:
          type: string
          description: |
            此网页搜索调用关联的输出项的唯一标识符。
        sequence_number:
          type: integer
          description: 此网页搜索调用的序列号。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.web_search_call.searching
        group: responses
        example: |
          {
            "type": "response.web_search_call.searching",
            "output_index": 0,
            "item_id": "ws_123",
            "sequence_number": 0
          }
    ResponseImageGenCallCompletedEvent:
      type: object
      title: ResponseImageGenCallCompletedEvent
      description: |
        当图像生成工具调用完成并且最终图像可用时发出。
      properties:
        type:
          type: string
          enum:
            - response.image_generation_call.completed
          description: 事件的类型。始终为 'response.image_generation_call.completed'。
          x-stainless-const: true
        output_index:
          type: integer
          description: 输出项在响应的输出数组中的索引。
        sequence_number:
          type: integer
          description: 此事件的序列号。
        item_id:
          type: string
          description: 正在处理的图像生成项的唯一标识符。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.image_generation_call.completed
        group: responses
        example: |
          {
            "type": "response.image_generation_call.completed",
            "output_index": 0,
            "item_id": "item-123",
            "sequence_number": 1
          }
    ResponseImageGenCallGeneratingEvent:
      type: object
      title: ResponseImageGenCallGeneratingEvent
      description: |
        当图像生成工具调用正在主动生成图像（中间状态）时发出。
      properties:
        type:
          type: string
          enum:
            - response.image_generation_call.generating
          description: 事件的类型。始终为 'response.image_generation_call.generating'。
          x-stainless-const: true
        output_index:
          type: integer
          description: 输出项在响应的输出数组中的索引。
        item_id:
          type: string
          description: 正在处理的图像生成项的唯一标识符。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.image_generation_call.generating
        group: responses
        example: |
          {
            "type": "response.image_generation_call.generating",
            "output_index": 0,
            "item_id": "item-123",
            "sequence_number": 0
          }
    ResponseImageGenCallInProgressEvent:
      type: object
      title: ResponseImageGenCallInProgressEvent
      description: |
        当图像生成工具调用处于进行中状态时发出。
      properties:
        type:
          type: string
          enum:
            - response.image_generation_call.in_progress
          description: 事件的类型。始终为 'response.image_generation_call.in_progress'。
          x-stainless-const: true
        output_index:
          type: integer
          description: 输出项在响应的输出数组中的索引。
        item_id:
          type: string
          description: 正在处理的图像生成项的唯一标识符。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.image_generation_call.in_progress
        group: responses
        example: |
          {
            "type": "response.image_generation_call.in_progress",
            "output_index": 0,
            "item_id": "item-123",
            "sequence_number": 0
          }
    ResponseImageGenCallPartialImageEvent:
      type: object
      title: ResponseImageGenCallPartialImageEvent
      description: |
        当图像生成流式传输期间可用部分图像时发出。
      properties:
        type:
          type: string
          enum:
            - response.image_generation_call.partial_image
          description: 事件的类型。始终为 'response.image_generation_call.partial_image'。
          x-stainless-const: true
        output_index:
          type: integer
          description: 输出项在响应的输出数组中的索引。
        item_id:
          type: string
          description: 正在处理的图像生成项的唯一标识符。
        sequence_number:
          type: integer
          description: 此事件的序列号。
        partial_image_index:
          type: integer
          description: 部分图像的 0 基索引（后端为 1 基，但用户为 0 基）。
        partial_image_b64:
          type: string
          description: Base64 编码的部分图像数据，适合渲染为图像。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
        - partial_image_index
        - partial_image_b64
      x-oaiMeta:
        name: response.image_generation_call.partial_image
        group: responses
        example: |
          {
            "type": "response.image_generation_call.partial_image",
            "output_index": 0,
            "item_id": "item-123",
            "sequence_number": 0,
            "partial_image_index": 0,
            "partial_image_b64": "..."
          }
    ResponseMCPCallArgumentsDeltaEvent:
      type: object
      title: ResponseMCPCallArgumentsDeltaEvent
      description: |
        当 MCP 工具调用的参数发生更改（部分更新）时发出。
      properties:
        type:
          type: string
          enum:
            - response.mcp_call.arguments_delta
          description: 事件的类型。始终为 'response.mcp_call.arguments_delta'。
          x-stainless-const: true
        output_index:
          type: integer
          description: 输出项在响应的输出数组中的索引。
        item_id:
          type: string
          description: 正在处理的 MCP 工具调用项的唯一标识符。
        delta:
          type: object
          description: 对 MCP 工具调用的参数的部分更新。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - output_index
        - item_id
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.mcp_call.arguments.delta
        group: responses
        example: |
          {
            "type": "response.mcp_call.arguments.delta",
            "output_index": 0,
            "item_id": "item-abc",
            "delta": {
              "arg1": "new_value1",
              "arg2": "new_value2"
            },
            "sequence_number": 1
          }
    ResponseMCPCallArgumentsDoneEvent:
      type: object
      title: ResponseMCPCallArgumentsDoneEvent
      description: |
        当 MCP 工具调用的参数最终确定时发出。
      properties:
        type:
          type: string
          enum:
            - response.mcp_call.arguments_done
          description: 事件的类型。始终为 'response.mcp_call.arguments_done'。
          x-stainless-const: true
        output_index:
          type: integer
          description: 输出项在响应的输出数组中的索引。
        item_id:
          type: string
          description: 正在处理的 MCP 工具调用项的唯一标识符。
        arguments:
          type: object
          description: 对 MCP 工具调用的最终参数。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - output_index
        - item_id
        - arguments
        - sequence_number
      x-oaiMeta:
        name: response.mcp_call.arguments.done
        group: responses
        example: |
          {
            "type": "response.mcp_call.arguments.done",
            "output_index": 0,
            "item_id": "item-abc",
            "arguments": {
              "arg1": "value1",
              "arg2": "value2"
            },
            "sequence_number": 1
          }
    ResponseMCPCallCompletedEvent:
      type: object
      title: ResponseMCPCallCompletedEvent
      description: |
        当 MCP 工具调用成功完成时发出。
      properties:
        type:
          type: string
          enum:
            - response.mcp_call.completed
          description: 事件的类型。始终为 'response.mcp_call.completed'。
          x-stainless-const: true
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - sequence_number
      x-oaiMeta:
        name: response.mcp_call.completed
        group: responses
        example: |
          {
            "type": "response.mcp_call.completed",
            "sequence_number": 1
          }
    ResponseMCPCallFailedEvent:
      type: object
      title: ResponseMCPCallFailedEvent
      description: |
        当 MCP 工具调用失败时发出。
      properties:
        type:
          type: string
          enum:
            - response.mcp_call.failed
          description: 事件的类型。始终为 'response.mcp_call.failed'。
          x-stainless-const: true
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - sequence_number
      x-oaiMeta:
        name: response.mcp_call.failed
        group: responses
        example: |
          {
            "type": "response.mcp_call.failed",
            "sequence_number": 1
          }
    ResponseMCPCallInProgressEvent:
      type: object
      title: ResponseMCPCallInProgressEvent
      description: |
        当 MCP 工具调用处于进行中状态时发出。
      properties:
        type:
          type: string
          enum:
            - response.mcp_call.in_progress
          description: 事件的类型。始终为 'response.mcp_call.in_progress'。
          x-stainless-const: true
        sequence_number:
          type: integer
          description: 此事件的序列号。
        output_index:
          type: integer
          description: 输出项在响应的输出数组中的索引。
        item_id:
          type: string
          description: 正在处理的 MCP 工具调用项的唯一标识符。
      required:
        - type
        - output_index
        - item_id
        - sequence_number
      x-oaiMeta:
        name: response.mcp_call.in_progress
        group: responses
        example: |
          {
            "type": "response.mcp_call.in_progress",
            "output_index": 0,
            "item_id": "item-abc",
            "sequence_number": 1
          }
    ResponseMCPListToolsCompletedEvent:
      type: object
      title: ResponseMCPListToolsCompletedEvent
      description: |
        当可用 MCP 工具列表已成功检索时发出。
      properties:
        type:
          type: string
          enum:
            - response.mcp_list_tools.completed
          description: 事件的类型。始终为 'response.mcp_list_tools.completed'。
          x-stainless-const: true
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - sequence_number
      x-oaiMeta:
        name: response.mcp_list_tools.completed
        group: responses
        example: |
          {
            "type": "response.mcp_list_tools.completed",
            "sequence_number": 1
          }
    ResponseMCPListToolsFailedEvent:
      type: object
      title: ResponseMCPListToolsFailedEvent
      description: |
        当尝试列出可用的 MCP 工具失败时发出。
      properties:
        type:
          type: string
          enum:
            - response.mcp_list_tools.failed
          description: 事件的类型。始终为 'response.mcp_list_tools.failed'。
          x-stainless-const: true
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - sequence_number
      x-oaiMeta:
        name: response.mcp_list_tools.failed
        group: responses
        example: |
          {
            "type": "response.mcp_list_tools.failed",
            "sequence_number": 1
          }
    ResponseMCPListToolsInProgressEvent:
      type: object
      title: ResponseMCPListToolsInProgressEvent
      description: |
        当系统正在检索可用的 MCP 工具列表时发出。
      properties:
        type:
          type: string
          enum:
            - response.mcp_list_tools.in_progress
          description: 事件的类型。始终为 'response.mcp_list_tools.in_progress'。
          x-stainless-const: true
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - sequence_number
      x-oaiMeta:
        name: response.mcp_list_tools.in_progress
        group: responses
        example: |
          {
            "type": "response.mcp_list_tools.in_progress",
            "sequence_number": 1
          }
    ResponseOutputTextAnnotationAddedEvent:
      type: object
      title: ResponseOutputTextAnnotationAddedEvent
      description: |
        当向输出文本内容添加注释时发出。
      properties:
        type:
          type: string
          enum:
            - response.output_text_annotation.added
          description: 事件的类型。始终为 'response.output_text_annotation.added'。
          x-stainless-const: true
        item_id:
          type: string
          description: 注释要添加到的项的唯一标识符。
        output_index:
          type: integer
          description: 输出项在响应的输出数组中的索引。
        content_index:
          type: integer
          description: 输出项内内容部分的索引。
        annotation_index:
          type: integer
          description: 内容部分内注释的索引。
        sequence_number:
          type: integer
          description: 此事件的序列号。
        annotation:
          type: object
          description: 要添加的注释对象。（有关注释架构的详细信息，请参阅注释架构。）
      required:
        - type
        - item_id
        - output_index
        - content_index
        - annotation_index
        - annotation
        - sequence_number
      x-oaiMeta:
        name: response.output_text_annotation.added
        group: responses
        example: |
          {
            "type": "response.output_text_annotation.added",
            "item_id": "item-abc",
            "output_index": 0,
            "content_index": 0,
            "annotation_index": 0,
            "annotation": {
              "type": "text_annotation",
              "text": "This is a test annotation",
              "start": 0,
              "end": 10
            },
            "sequence_number": 1
          }
    ResponseQueuedEvent:
      type: object
      title: ResponseQueuedEvent
      description: |
        当响应被排队并等待处理时触发。
      properties:
        type:
          type: string
          enum:
            - response.queued
          description: 事件的类型。始终为 'response.queued'。
          x-stainless-const: true
        response:
          $ref: '#/components/schemas/Response'
          description: 排队的完整响应对象。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response
        - sequence_number
      x-oaiMeta:
        name: response.queued
        group: responses
        example: |
          {
            "type": "response.queued",
            "response": {
              "id": "res_123",
              "status": "queued",
              "created_at": "2021-01-01T00:00:00Z",
              "updated_at": "2021-01-01T00:00:00Z"
            },
            "sequence_number": 1
          }
    ResponseReasoningDeltaEvent:
      type: object
      title: ResponseReasoningDeltaEvent
      description: |
        当推理内容发生增量（部分更新）时触发。
      properties:
        type:
          type: string
          enum:
            - response.reasoning.delta
          description: 事件的类型。始终为 'response.reasoning.delta'。
          x-stainless-const: true
        item_id:
          type: string
          description: 正在更新推理的项目的唯一标识符。
        output_index:
          type: integer
          description: 响应输出数组中输出项的索引。
        content_index:
          type: integer
          description: 输出项中推理内容部分的索引。
        delta:
          type: object
          description: 对推理内容的部分更新。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - content_index
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.reasoning.delta
        group: responses
        example: |
          {
            "type": "response.reasoning.delta",
            "item_id": "item-abc",
            "output_index": 0,
            "content_index": 0,
            "delta": {
              "text": "This is a test delta"
            },
            "sequence_number": 1
          }
    ResponseReasoningDoneEvent:
      type: object
      title: ResponseReasoningDoneEvent
      description: |
        当某一项的推理内容最终确定时发出。
      properties:
        type:
          type: string
          enum:
            - response.reasoning.done
          description: 事件的类型。始终为 'response.reasoning.done'。
          x-stainless-const: true
        item_id:
          type: string
          description: 正在最终确定推理的项目的唯一标识符。
        output_index:
          type: integer
          description: 响应输出数组中输出项的索引。
        content_index:
          type: integer
          description: 输出项中推理内容部分的索引。
        text:
          type: string
          description: 最终确定的推理文本。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - content_index
        - text
        - sequence_number
      x-oaiMeta:
        name: response.reasoning.done
        group: responses
        example: |
          {
            "type": "response.reasoning.done",
            "item_id": "item-abc",
            "output_index": 0,
            "content_index": 0,
            "text": "This is a test reasoning",
            "sequence_number": 1
          }
    ResponseReasoningSummaryDeltaEvent:
      type: object
      title: ResponseReasoningSummaryDeltaEvent
      description: |
        当推理摘要内容发生增量（部分更新）时触发。
      properties:
        type:
          type: string
          enum:
            - response.reasoning_summary.delta
          description: 事件的类型。始终为 'response.reasoning_summary.delta'。
          x-stainless-const: true
        item_id:
          type: string
          description: 正在更新推理摘要的项目的唯一标识符。
        output_index:
          type: integer
          description: 响应输出数组中输出项的索引。
        summary_index:
          type: integer
          description: 输出项中摘要部分的索引。
        sequence_number:
          type: integer
          description: 此事件的序列号。
        delta:
          type: object
          description: 对推理摘要内容的部分更新。
      required:
        - type
        - item_id
        - output_index
        - summary_index
        - delta
        - sequence_number
      x-oaiMeta:
        name: response.reasoning_summary.delta
        group: responses
        example: |
          {
            "type": "response.reasoning_summary.delta",
            "item_id": "item-abc",
            "output_index": 0,
            "summary_index": 0,
            "delta": {
              "text": "delta text"
            },
            "sequence_number": 1
          }
    ResponseReasoningSummaryDoneEvent:
      type: object
      title: ResponseReasoningSummaryDoneEvent
      description: |
        当某一项的推理摘要内容最终确定时发出。
      properties:
        type:
          type: string
          enum:
            - response.reasoning_summary.done
          description: 事件的类型。始终为 'response.reasoning_summary.done'。
          x-stainless-const: true
        item_id:
          type: string
          description: 正在最终确定推理摘要的项目的唯一标识符。
        output_index:
          type: integer
          description: 响应输出数组中输出项的索引。
        summary_index:
          type: integer
          description: 输出项中摘要部分的索引。
        text:
          type: string
          description: 最终确定的推理摘要文本。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - summary_index
        - text
        - sequence_number
      x-oaiMeta:
        name: response.reasoning_summary.done
        group: responses
        example: |
          {
            "type": "response.reasoning_summary.done",
            "item_id": "item-abc",
            "output_index": 0,
            "summary_index": 0,
            "text": "This is a test reasoning summary",
            "sequence_number": 1
          }
    ModelIdsResponses:
      example: gpt-4o
      anyOf:
        - $ref: '#/components/schemas/ModelIdsShared'
        - type: string
          title: ResponsesOnlyModel
          enum:
            - o1-pro
            - o1-pro-2025-03-19
            - o3-pro
            - o3-pro-2025-06-10
            - computer-use-preview
            - computer-use-preview-2025-03-11
    Reasoning:
      type: object
      description: |
        **仅限 o 系列模型**

        [推理模型](https://platform.openai.com/docs/guides/reasoning)的配置选项。
      title: Reasoning
      properties:
        effort:
          $ref: '#/components/schemas/ReasoningEffort'
        summary:
          type: string
          description: |
            对模型执行的推理的总结。这对于调试和理解模型的推理过程非常有用。
            可能的值有 `auto`、`concise` 或 `detailed`。
          enum:
            - auto
            - concise
            - detailed
          nullable: true
        generate_summary:
          type: string
          deprecated: true
          description: |
            **Deprecated:** use `summary` instead.

            对模型执行的推理的总结。这对于调试和理解模型的推理过程非常有用。
            可能的值有 `auto`、`concise` 或 `detailed`。
          enum:
            - auto
            - concise
            - detailed
          nullable: true
    TextResponseFormatConfiguration:
      description: >
        一个指定模型必须输出格式的对象。


        配置 `{ "type": "json_schema" }` 可启用结构化输出，确保模型符合您提供的 JSON
        架构。在[结构化输出指南](/docs/guides/structured-outputs)中了解更多信息。


        默认格式为 `{ "type": "text" }`，不带任何附加选项。


        **不建议用于 gpt-4o 及更新模型：**


        设置为 `{ "type": "json_object" }` 可启用较旧的 JSON 模式，该模式可确保模型生成的消息是有效的
        JSON。对于支持它的模型，建议使用 `json_schema`。
      oneOf:
        - $ref: '#/components/schemas/ResponseFormatText'
        - $ref: '#/components/schemas/TextResponseFormatJsonSchema'
        - $ref: '#/components/schemas/ResponseFormatJsonObject'
    Tool:
      description: |
        可用于生成响应的工具。
      discriminator:
        propertyName: type
      oneOf:
        - $ref: '#/components/schemas/FunctionTool'
        - $ref: '#/components/schemas/FileSearchTool'
        - $ref: '#/components/schemas/WebSearchPreviewTool'
        - $ref: '#/components/schemas/ComputerUsePreviewTool'
        - $ref: '#/components/schemas/MCPTool'
        - a40e5d18-c3ff-4e77-839e-fd6e39cd2fdb
        - $ref: '#/components/schemas/ImageGenTool'
        - $ref: '#/components/schemas/LocalShellTool'
    ToolChoiceOptions:
      type: string
      title: 工具选择模式
      description: |
        控制模型调用哪个（如果有）工具。

        `none` 表示模型将不调用任何工具，而是生成一条消息。

        `auto` 表示模型可以选择生成消息或调用一个或多个工具。

        `required` 表示模型必须调用一个或多个工具。
      enum:
        - none
        - auto
        - required
    ToolChoiceTypes:
      type: object
      title: 托管工具
      description: |
        表示模型应使用内置工具生成响应。
        [了解有关内置工具的更多信息](/docs/guides/tools)。
      properties:
        type:
          type: string
          description: |
            模型应使用的托管工具的类型。详细了解
            [内置工具](/docs/guides/tools)。

            允许的值为：
            - `file_search`
            - `web_search_preview`
            - `computer_use_preview`
            - `code_interpreter`
            - `mcp`
            - `image_generation`
          enum:
            - file_search
            - web_search_preview
            - computer_use_preview
            - web_search_preview_2025_03_11
            - image_generation
            - code_interpreter
            - mcp
      required:
        - type
    ToolChoiceFunction:
      type: object
      title: 函数工具
      description: |
        使用此选项强制模型调用特定函数。
      properties:
        type:
          type: string
          enum:
            - function
          description: 对于函数调用，类型始终为 `function`。
          x-stainless-const: true
        name:
          type: string
          description: 要调用的函数的名称。
      required:
        - type
        - name
    Prompt:
      type: object
      nullable: true
      description: |
        对提示模板及其变量的引用。
      required:
        - id
      properties:
        id:
          type: string
          description: 提示模板的唯一标识符。
        version:
          type: string
          description: 提示模板的可选版本。
          nullable: true
        variables:
          $ref: '#/components/schemas/ResponsePromptVariables'
    EasyInputMessage:
      type: object
      title: 输入消息
      description: >
        输入至模型的消息，其 `role` 字段用于标示指令的遵循层级。以 `developer` 或 `system` 角色提供的指令，其优先级高于
        `user` 角色的指令。`assistant` 角色的消息则被认为是模型在先前交互中生成的内容。
      properties:
        role:
          type: string
          description: |
            消息输入的角色。可以是 `user`、`assistant`、`system` 或 `developer`。
          enum:
            - user
            - assistant
            - system
            - developer
        content:
          description: |
            输入至模型的文本、图片或音频，用于生成响应。也可以包含先前助手的响应。
          oneOf:
            - type: string
              title: 文本输入
              description: |
                输入至模型的文本
            - $ref: '#/components/schemas/InputMessageContentList'
        type:
          type: string
          description: |
            消息输入的类型，始终为 `message`
          enum:
            - message
          x-stainless-const: true
      required:
        - role
        - content
    Item:
      type: object
      description: |
        用于生成响应的输入项
      oneOf:
        - $ref: '#/components/schemas/InputMessage'
        - $ref: '#/components/schemas/OutputMessage'
        - 23414b44-99b7-4360-b312-61c3ecbdb1a2
        - ab2beb0f-0afa-43e5-974e-033c12a72c1d
        - $ref: '#/components/schemas/ComputerCallOutputItemParam'
        - $ref: '#/components/schemas/WebSearchToolCall'
        - $ref: '#/components/schemas/FunctionToolCall'
        - $ref: '#/components/schemas/FunctionCallOutputItemParam'
        - $ref: '#/components/schemas/ReasoningItem'
        - $ref: '#/components/schemas/ImageGenToolCall'
        - 9a3f0b01-35fa-4d27-9028-e1feba44ee23
        - $ref: '#/components/schemas/LocalShellToolCall'
        - $ref: '#/components/schemas/LocalShellToolCallOutput'
        - $ref: '#/components/schemas/MCPListTools'
        - $ref: '#/components/schemas/MCPApprovalRequest'
        - $ref: '#/components/schemas/MCPApprovalResponse'
        - $ref: '#/components/schemas/MCPToolCall'
      discriminator:
        propertyName: type
    ItemReferenceParam:
      properties:
        type:
          anyOf:
            - type: string
              enum:
                - item_reference
              description: 引用项的类型。始终为 `item_reference`
              default: item_reference
              x-stainless-const: true
            - type: 'null'
        id:
          type: string
          description: 引用项的 ID。
      type: object
      required:
        - id
      title: Item reference
      description: 引用项的内部标识符
    Metadata:
      type: object
      description: |
        一对可以附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息以及通过 API 或仪表板查询对象非常有用。

        键是长度最多为 64 个字符的字符串。值是长度最多为 512 个字符的字符串。
      additionalProperties:
        type: string
      x-oaiTypeLabel: map
      nullable: true
    ServiceTier:
      type: string
      description: >
        指定用于处理请求的延迟等级。此参数适用于订阅了按量计费服务的客户： -
        如果设置为“auto”，并且项目启用了按量计费服务，系统将使用按量计费积分直至用尽。 -
        如果设置为“auto”，但项目未启用按量计费服务，则请求将使用默认服务等级进行处理，该等级的正常运行时间服务水平协议较低，且无延迟保证。 -
        如果设置为“default”，请求将使用默认服务等级进行处理，该等级的正常运行时间服务水平协议较低，且无延迟保证。 -
        如果设置为“flex”，请求将使用弹性处理服务等级进行处理。[了解更多](/docs/guides/flex-processing)。 -
        如果未设置，则默认行为是“auto”。

        设置此参数后，响应体将包含所使用的 `service_tier`。
      enum:
        - auto
        - default
        - flex
        - scale
      nullable: true
      default: auto
    ResponseErrorCode:
      type: string
      description: |
        响应的错误代码。
      enum:
        - server_error
        - rate_limit_exceeded
        - invalid_prompt
        - vector_store_timeout
        - invalid_image
        - invalid_image_format
        - invalid_base64_image
        - invalid_image_url
        - image_too_large
        - image_too_small
        - image_parse_error
        - image_content_policy_violation
        - invalid_image_mode
        - image_file_too_large
        - unsupported_image_media_type
        - empty_image_file
        - failed_to_download_image
        - image_file_not_found
    OutputMessage:
      type: object
      title: 输出消息
      description: |
        来自模型的输出消息。
      properties:
        id:
          type: string
          description: |
            输出消息的唯一 ID。
        type:
          type: string
          description: |
            输出消息的类型。始终为 `message`。
          enum:
            - message
          x-stainless-const: true
        role:
          type: string
          description: |
            输出消息的角色。始终为 `assistant`。
          enum:
            - assistant
          x-stainless-const: true
        content:
          type: array
          description: |
            输出消息的内容。
          items:
            $ref: '#/components/schemas/OutputContent'
        status:
          type: string
          description: >
            输出消息的状态。可能的值有 `in_progress`、`completed` 或 `incomplete`。当通过 API
            返回输入项时填充此字段。
          enum:
            - in_progress
            - completed
            - incomplete
      required:
        - id
        - type
        - role
        - content
        - status
    FunctionToolCall:
      type: object
      title: Function tool call
      description: |
        用于运行函数的工具调用。更多信息请参见[函数调用代码示例](/docs/response/tool_calls)。
      properties:
        id:
          type: string
          description: |
            函数工具调用的唯一 ID。
        type:
          type: string
          enum:
            - function_call
          description: |
            函数工具调用的类型。始终为 `function_call`。
          x-stainless-const: true
        call_id:
          type: string
          description: |
            由模型生成的函数工具调用的唯一 ID。
        name:
          type: string
          description: |
            要运行的函数的名称。
        arguments:
          type: string
          description: |
            要传递给函数的参数的 JSON 字符串。
        status:
          type: string
          description: |
            项目的状态。可以是 `in_progress`、`completed` 或 `incomplete`。当通过 API 返回项目时填充。
          enum:
            - in_progress
            - completed
            - incomplete
      required:
        - type
        - call_id
        - name
        - arguments
    WebSearchToolCall:
      type: object
      title: Web search tool call
      description: |
        网页搜索工具调用的结果。有关更多信息，请参阅 [网页搜索指南](/docs/guides/tools-web-search)。
      properties:
        id:
          type: string
          description: |
            网页搜索工具调用的唯一 ID。
        type:
          type: string
          enum:
            - web_search_call
          description: |
            网页搜索工具调用的类型。始终为 `web_search_call`。
          x-stainless-const: true
        status:
          type: string
          description: |
            网页搜索工具调用的状态。
          enum:
            - in_progress
            - searching
            - completed
            - failed
      required:
        - id
        - type
        - status
    ReasoningItem:
      type: object
      description: >
        对推理模型在生成响应时使用的思维链的描述。确保在手动

        [管理上下文](/docs/guides/conversation-state) 时将这些项目包含在对 Responses API 的
        `input` 中，以便在对话的后续轮次中使用。
      title: Reasoning
      properties:
        type:
          type: string
          description: |
            对象的类型。始终为 `reasoning`。
          enum:
            - reasoning
          x-stainless-const: true
        id:
          type: string
          description: |
            推理内容的唯一标识符。
        encrypted_content:
          type: string
          description: |
            推理项的加密内容 - 在生成响应时填充 `reasoning.encrypted_content` 的 `include` 参数。
          nullable: true
        summary:
          type: array
          description: |
            推理文本内容。
          items:
            type: object
            properties:
              type:
                type: string
                description: |
                  对象的类型。始终为 `summary_text`。
                enum:
                  - summary_text
                x-stainless-const: true
              text:
                type: string
                description: |
                  对模型生成响应时使用的推理的简短总结。
            required:
              - type
              - text
        status:
          type: string
          description: |
            项目的状态。可能的值有 `in_progress`、`completed` 或
            `incomplete`。当通过 API 返回项目时填充。
          enum:
            - in_progress
            - completed
            - incomplete
      required:
        - id
        - summary
        - type
    ImageGenToolCall:
      type: object
      title: 图像生成调用
      description: |
        由模型发起的图像生成请求。
      properties:
        type:
          type: string
          enum:
            - image_generation_call
          description: |
            图像生成调用的类型。始终为 `image_generation_call`。
          x-stainless-const: true
        id:
          type: string
          description: |
            图像生成调用的唯一 ID。
        status:
          type: string
          enum:
            - in_progress
            - completed
            - generating
            - failed
          description: |
            图像生成调用的状态。
        result:
          type: string
          description: |
            生成的图像的 Base64 编码。
          nullable: true
      required:
        - type
        - id
        - status
        - result
    LocalShellToolCall:
      type: object
      title: 本地 shell 调用
      description: |
        一个在本地 shell 上运行命令的工具调用。
      properties:
        type:
          type: string
          enum:
            - local_shell_call
          description: |
            本地 shell 调用的类型。始终为 `local_shell_call`。
          x-stainless-const: true
        id:
          type: string
          description: |
            本地 shell 调用的唯一 ID。
        call_id:
          type: string
          description: |
            由模型生成的本地 shell 工具调用的唯一 ID。
        action:
          $ref: '#/components/schemas/LocalShellExecAction'
        status:
          type: string
          enum:
            - in_progress
            - completed
            - incomplete
          description: |
            本地 shell 调用的状态。
      required:
        - type
        - id
        - call_id
        - action
        - status
    MCPToolCall:
      type: object
      title: MCP 工具调用
      description: |
        在 MCP 服务器上调用工具。
      properties:
        type:
          type: string
          enum:
            - mcp_call
          description: |
            项目的类型。始终为 `mcp_call`。
          x-stainless-const: true
        id:
          type: string
          description: |
            工具调用的唯一 ID。
        server_label:
          type: string
          description: |
            运行该工具的 MCP 服务器的标签。
        name:
          type: string
          description: |
            运行的工具的名称。
        arguments:
          type: string
          description: |
            传递给工具的参数的 JSON 字符串。
        output:
          type: string
          description: |
            工具调用的输出。
          nullable: true
        error:
          type: string
          description: |
            工具调用的错误（如果有）。
          nullable: true
      required:
        - type
        - id
        - server_label
        - name
        - arguments
    MCPListTools:
      type: object
      title: MCP list tools
      description: |
        MCP 服务器上可用工具的列表。
      properties:
        type:
          type: string
          enum:
            - mcp_list_tools
          description: |
            项目的类型。始终为 `mcp_list_tools`。
          x-stainless-const: true
        id:
          type: string
          description: |
            列表的唯一 ID。
        server_label:
          type: string
          description: |
            MCP 服务器的标签。
        tools:
          type: array
          items:
            $ref: '#/components/schemas/MCPListToolsTool'
          description: |
            服务器上可用的工具。
        error:
          type: string
          description: |
            如果服务器无法列出工具，则为错误消息。
          nullable: true
      required:
        - type
        - id
        - server_label
        - tools
    MCPApprovalRequest:
      type: object
      title: MCP 批准请求
      description: |
        对工具调用的人类批准请求。
      properties:
        type:
          type: string
          enum:
            - mcp_approval_request
          description: |
            项目的类型。始终为 `mcp_approval_request`。
          x-stainless-const: true
        id:
          type: string
          description: |
            批准请求的唯一 ID。
        server_label:
          type: string
          description: |
            发起请求的 MCP 服务器的标签。
        name:
          type: string
          description: |
            要运行的工具的名称。
        arguments:
          type: string
          description: |
            用于工具的参数的 JSON 字符串。
      required:
        - type
        - id
        - server_label
        - name
        - arguments
    OutputContent:
      oneOf:
        - $ref: '#/components/schemas/OutputTextContent'
        - $ref: '#/components/schemas/RefusalContent'
    ModelIdsShared:
      example: gpt-4o
      anyOf:
        - type: string
        - type: string
          enum:
            - gpt-4.1
            - gpt-4.1-mini
            - gpt-4.1-nano
            - gpt-4.1-2025-04-14
            - gpt-4.1-mini-2025-04-14
            - gpt-4.1-nano-2025-04-14
            - o4-mini
            - o4-mini-2025-04-16
            - o3
            - o3-2025-04-16
            - o3-mini
            - o3-mini-2025-01-31
            - o1
            - o1-2024-12-17
            - o1-preview
            - o1-preview-2024-09-12
            - o1-mini
            - o1-mini-2024-09-12
            - gpt-4o
            - gpt-4o-2024-11-20
            - gpt-4o-2024-08-06
            - gpt-4o-2024-05-13
            - gpt-4o-audio-preview
            - gpt-4o-audio-preview-2024-10-01
            - gpt-4o-audio-preview-2024-12-17
            - gpt-4o-audio-preview-2025-06-03
            - gpt-4o-mini-audio-preview
            - gpt-4o-mini-audio-preview-2024-12-17
            - gpt-4o-search-preview
            - gpt-4o-mini-search-preview
            - gpt-4o-search-preview-2025-03-11
            - gpt-4o-mini-search-preview-2025-03-11
            - chatgpt-4o-latest
            - codex-mini-latest
            - gpt-4o-mini
            - gpt-4o-mini-2024-07-18
            - gpt-4-turbo
            - gpt-4-turbo-2024-04-09
            - gpt-4-0125-preview
            - gpt-4-turbo-preview
            - gpt-4-1106-preview
            - gpt-4-vision-preview
            - gpt-4
            - gpt-4-0314
            - gpt-4-0613
            - gpt-4-32k
            - gpt-4-32k-0314
            - gpt-4-32k-0613
            - gpt-3.5-turbo
            - gpt-3.5-turbo-16k
            - gpt-3.5-turbo-0301
            - gpt-3.5-turbo-0613
            - gpt-3.5-turbo-1106
            - gpt-3.5-turbo-0125
            - gpt-3.5-turbo-16k-0613
    ReasoningEffort:
      type: string
      enum:
        - low
        - medium
        - high
      default: medium
      nullable: true
      description: |
        **仅限 o 系列模型**

        对 [推理模型](https://platform.openai.com/docs/guides/reasoning) 的推理工作量进行限制。
        当前支持的值有 `low`、`medium` 和 `high`。降低推理工作量可能会导致更快的响应和更少的令牌使用。
    ResponseFormatText:
      type: object
      title: Text
      description: |
        默认响应格式。用于生成文本响应。
      properties:
        type:
          type: string
          description: 正在定义的响应格式的类型。始终为 `text`。
          enum:
            - text
          x-stainless-const: true
      required:
        - type
    TextResponseFormatJsonSchema:
      type: object
      title: JSON schema
      description: |
        JSON Schema 响应格式。用于生成结构化 JSON 响应。
        详细了解[结构化输出](/docs/guides/structured-outputs)。
      properties:
        type:
          type: string
          description: 响应格式的类型。始终为 `json_schema`。
          enum:
            - json_schema
          x-stainless-const: true
        description:
          type: string
          description: |
            响应格式的描述。用于模型确定如何以该格式进行响应。
        name:
          type: string
          description: |
            响应格式的名称。必须是 a-z、A-Z、0-9，或包含下划线和短横线，且最大长度为 64。
        schema:
          $ref: '#/components/schemas/ResponseFormatJsonSchemaSchema'
        strict:
          type: boolean
          nullable: true
          default: false
          description: >
            是否在生成输出时启用严格的架构遵循。

            如果设置为 true，模型将始终遵循 `schema` 字段中定义的确切架构。

            当 `strict` 为 `true` 时，仅支持 JSON Schema 的子集。要了解更多信息，请阅读
            [结构化输出指南](/docs/guides/structured-outputs)。
      required:
        - type
        - schema
        - name
    ResponseFormatJsonObject:
      type: object
      title: JSON object
      description: |
        JSON 对象响应格式。生成 JSON 响应的旧方法。
        建议对支持 `json_schema` 的模型使用它。请注意，模型不会在没有系统消息或用户消息指示的情况下生成 JSON。
      properties:
        type:
          type: string
          description: 正在定义的响应格式的类型。始终为 `json_object`。
          enum:
            - json_object
          x-stainless-const: true
      required:
        - type
    FunctionTool:
      properties:
        type:
          type: string
          enum:
            - function
          description: 函数工具的类型。始终为 `function`。
          default: function
          x-stainless-const: true
        name:
          type: string
          description: 要调用的函数的名称。
        description:
          anyOf:
            - type: string
              description: 函数的描述。用于模型确定是否调用该函数。
            - type: 'null'
        parameters:
          anyOf:
            - additionalProperties: {}
              type: object
              description: 描述函数参数的 JSON schema 对象。
            - type: 'null'
        strict:
          anyOf:
            - type: boolean
              description: 是否强制执行严格的参数验证。默认值为 `true`。
            - type: 'null'
      type: object
      required:
        - type
        - name
        - strict
        - parameters
      title: Function
      description: >-
        定义一个模型可以选择调用的函数。了解有关
        [函数调用](https://platform.openai.com/docs/guides/function-calling) 的更多信息。
    FileSearchTool:
      properties:
        type:
          type: string
          enum:
            - file_search
          description: 文件搜索工具的类型。始终为 `file_search`。
          default: file_search
          x-stainless-const: true
        vector_store_ids:
          items:
            type: string
          type: array
          description: 要搜索的向量存储的 ID。
        max_num_results:
          type: integer
          description: 要返回的最大结果数。此数字应介于 1 和 50 之间（包括 1 和 50）。
        ranking_options:
          $ref: '#/components/schemas/RankingOptions'
          description: 搜索的排名选项。
        filters:
          anyOf:
            - $ref: '#/components/schemas/Filters'
              description: 要应用的过滤器。
            - type: 'null'
      type: object
      required:
        - type
        - vector_store_ids
      title: File search
      description: >-
        一个搜索已上传文件中相关内容的工具。详细了解
        [文件搜索工具](https://platform.openai.com/docs/guides/tools-file-search)。
    WebSearchPreviewTool:
      properties:
        type:
          type: string
          enum:
            - web_search_preview
            - web_search_preview_2025_03_11
          description: >-
            Web 搜索工具的类型。可以是 `web_search_preview` 或
            `web_search_preview_2025_03_11`。
          default: web_search_preview
          x-stainless-const: true
        user_location:
          anyOf:
            - $ref: '#/components/schemas/ApproximateLocation'
              description: 用户的位置。
            - type: 'null'
        search_context_size:
          type: string
          enum:
            - low
            - medium
            - high
          description: 有关搜索使用的上下文窗口空间量的高级指导。可以是 `low`、`medium` 或 `high`。`medium` 是默认值。
      type: object
      required:
        - type
      title: Web search preview
      description: >-
        该工具在网络上搜索相关结果以用于响应。详细了解 [Web
        搜索工具](https://platform.openai.com/docs/guides/tools-web-search)。
    ComputerUsePreviewTool:
      properties:
        type:
          type: string
          enum:
            - computer_use_preview
          description: 计算机使用工具的类型。始终为 `computer_use_preview`。
          default: computer_use_preview
          x-stainless-const: true
        environment:
          type: string
          enum:
            - windows
            - mac
            - linux
            - ubuntu
            - browser
          description: 要控制的计算机环境的类型。
        display_width:
          type: integer
          description: 计算机显示器的宽度。
        display_height:
          type: integer
          description: 计算机显示器的高度。
      type: object
      required:
        - type
        - environment
        - display_width
        - display_height
      title: Computer use preview
      description: >-
        一个控制虚拟计算机的工具。详细了解
        [计算机使用工具](https://platform.openai.com/docs/guides/tools-computer-use)。
    MCPTool:
      type: object
      title: MCP tool
      description: |
        通过远程模型上下文协议 (MCP) 服务器为模型提供对其他工具的访问
      properties:
        type:
          type: string
          enum:
            - mcp
          description: 项目的类型。始终为 `mcp`。
          x-stainless-const: true
        server_label:
          type: string
          description: |
            此 MCP 服务器的标签，用于在工具调用中标识它。
        server_url:
          type: string
          description: |
            MCP 服务器的 URL。
        headers:
          type: object
          additionalProperties:
            type: string
          nullable: true
          description: |
            可选的 HTTP 头部，用于发送到 MCP 服务器。可用于身份验证或其他目的。
        allowed_tools:
          description: |
            允许的工具名称列表或过滤器对象。
          oneOf:
            - type: array
              title: MCP allowed tools
              description: 允许的工具名称的字符串数组
              items:
                type: string
            - type: object
              title: MCP allowed tools filter
              description: |
                用于指定允许哪些工具的过滤器对象。
              properties:
                tool_names:
                  type: array
                  title: MCP allowed tools
                  items:
                    type: string
                  description: 允许的工具名称列表。
              required: []
              additionalProperties: false
          nullable: true
        require_approval:
          description: 指定 MCP 服务器的哪些工具需要批准。
          oneOf:
            - type: object
              title: MCP 工具批准过滤器
              properties:
                always:
                  type: object
                  description: |
                    始终需要批准的工具列表。
                  properties:
                    tool_names:
                      type: array
                      items:
                        type: string
                      description: 需要批准的工具列表。
                never:
                  type: object
                  description: |
                    从不需要批准的工具列表。
                  properties:
                    tool_names:
                      type: array
                      items:
                        type: string
                      description: 不需要批准的工具列表。
              additionalProperties: false
            - type: string
              title: MCP 工具批准设置
              description: |
                为所有工具指定单一的批准策略。可以是 `always` 或
                `never`。设置为 `always` 时，所有工具都将需要批准。设置为
                `never` 时，所有工具都将不需要批准。
              enum:
                - always
                - never
          default: always
          nullable: true
      required:
        - type
        - server_label
        - server_url
    ImageGenTool:
      type: object
      title: 图像生成工具
      description: |
        一个使用类似 `gpt-image-1` 的模型生成图像的工具。
      properties:
        type:
          type: string
          enum:
            - image_generation
          description: |
            图像生成工具的类型。始终为 `image_generation`。
          x-stainless-const: true
        model:
          type: string
          enum:
            - gpt-image-1
          description: |
            要使用的图像生成模型。默认值：`gpt-image-1`。
          default: gpt-image-1
        quality:
          type: string
          enum:
            - low
            - medium
            - high
            - auto
          description: |
            生成图像的质量。可以是 `low`、`medium`、`high` 或 `auto`。默认值：`auto`。
          default: auto
        size:
          type: string
          enum:
            - 1024x1024
            - 1024x1536
            - 1536x1024
            - auto
          description: |
            生成图像的大小。可以是 `1024x1024`、`1024x1536`、`1536x1024` 或 `auto`。默认值：`auto`。
          default: auto
        output_format:
          type: string
          enum:
            - png
            - webp
            - jpeg
          description: |
            生成图像的输出格式。可以是 `png`、`webp` 或 `jpeg`。默认值：`png`。
          default: png
        output_compression:
          type: integer
          minimum: 0
          maximum: 100
          description: |
            输出图像的压缩级别。默认值：100。
          default: 100
        moderation:
          type: string
          enum:
            - auto
            - low
          description: |
            生成图像的审核级别。默认值：`auto`。
          default: auto
        background:
          type: string
          enum:
            - transparent
            - opaque
            - auto
          description: |
            生成图像的背景类型。可以是 `transparent`、`opaque` 或 `auto`。默认值：`auto`。
          default: auto
        input_image_mask:
          type: object
          description: |
            可选的蒙版图像。包含 `image_url`（字符串，可选）和 `file_id`（字符串，可选）。
          properties:
            image_url:
              type: string
              description: |
                Base64 编码的蒙版图像
            file_id:
              type: string
              description: |
                蒙版图像的文件 ID
          required: []
          additionalProperties: false
        partial_images:
          type: integer
          minimum: 0
          maximum: 3
          description: |
            在流式模式下生成的部分图像数量，范围从 0（默认值）到 3。
          default: 0
      required:
        - type
    LocalShellTool:
      type: object
      title: 本地 shell 工具
      description: |
        允许模型在本地环境中执行 shell 命令的工具。
      properties:
        type:
          type: string
          enum:
            - local_shell
          description: 本地 shell 工具的类型。始终为 `local_shell`。
          x-stainless-const: true
      required:
        - type
    ResponsePromptVariables:
      type: object
      title: Prompt Variables
      description: |
        用于替换提示中变量的可选值映射。替换值可以是字符串，也可以是其他响应输入类型，如图像或文件。
      x-oaiExpandable: true
      x-oaiTypeLabel: map
      nullable: true
      additionalProperties:
        x-oaiExpandable: true
        x-oaiTypeLabel: map
        oneOf:
          - type: string
          - $ref: '#/components/schemas/InputTextContent'
          - $ref: '#/components/schemas/InputImageContent'
          - $ref: '#/components/schemas/InputFileContent'
    InputMessageContentList:
      type: array
      title: 输入内容列表
      description: |
        发送给模型的一个或多个输入项的列表，包含不同的内容类型。
      items:
        $ref: '#/components/schemas/InputContent'
    InputMessage:
      type: object
      title: Input message
      description: |
        具有指示指令遵循层级的角色的模型消息输入。`developer` 或 `system` 角色给出的指令优先于 `user` 角色给出的指令。
      properties:
        type:
          type: string
          description: |
            输入项的类型。始终为 `message`。
          enum:
            - message
          x-stainless-const: true
        role:
          type: string
          description: |
            输入项的角色。可以是 `user`、`system` 或 `developer`。
          enum:
            - user
            - system
            - developer
        status:
          type: string
          description: |
            项目的状态。可以是 `in_progress`、`completed` 或 `incomplete`。当通过 API 返回项目时填充。
          enum:
            - in_progress
            - completed
            - incomplete
        content:
          $ref: '#/components/schemas/InputMessageContentList'
      required:
        - role
        - content
    ComputerCallOutputItemParam:
      properties:
        id:
          anyOf:
            - type: string
              description: 计算机工具调用输出的 ID。
            - type: 'null'
        call_id:
          type: string
          maxLength: 64
          minLength: 1
          description: 生成该输出的计算机工具调用的 ID。
        type:
          type: string
          enum:
            - computer_call_output
          description: 计算机工具调用输出的类型。始终为 `computer_call_output`。
          default: computer_call_output
          x-stainless-const: true
        output: b9603ea1-fca1-4a50-9886-ce290c96a3e1
        acknowledged_safety_checks:
          anyOf:
            - items:
                $ref: '#/components/schemas/ComputerCallSafetyCheckParam'
              type: array
              description: API 报告的已被开发者确认的安全检查。
            - type: 'null'
        status:
          anyOf:
            - type: string
              enum:
                - in_progress
                - completed
                - incomplete
              description: >-
                消息输入的的状态。其值可以是 `in_progress`、`completed` 或 `incomplete`。当通过 API
                返回输入项时，此字段将被填充。
            - type: 'null'
      type: object
      required:
        - call_id
        - type
        - output
      title: 计算机工具调用输出
      description: 计算机工具调用的输出。
    FunctionCallOutputItemParam:
      properties:
        id:
          anyOf:
            - type: string
              description: 函数工具调用输出的唯一 ID。当通过 API 返回此项时填充。
            - type: 'null'
        call_id:
          type: string
          maxLength: 64
          minLength: 1
          description: 函数工具调用生成的唯一 ID。
        type:
          type: string
          enum:
            - function_call_output
          description: 函数工具调用输出的类型。始终为 `function_call_output`。
          default: function_call_output
          x-stainless-const: true
        output:
          type: string
          maxLength: 10485760
          description: 函数工具调用输出的 JSON 字符串。
        status:
          anyOf:
            - type: string
              enum:
                - in_progress
                - completed
                - incomplete
              description: >-
                项目的状态。可以是 `in_progress`、`completed` 或 `incomplete`。当通过 API
                返回输入项时，此字段将被填充。
            - type: 'null'
      type: object
      required:
        - call_id
        - type
        - output
      title: Function tool call output
      description: 函数工具调用的输出。
    LocalShellToolCallOutput:
      type: object
      title: 本地 shell 调用输出
      description: |
        本地 shell 工具调用的输出。
      properties:
        type:
          type: string
          enum:
            - local_shell_call_output
          description: |
            本地 shell 工具调用输出的类型。始终为 `local_shell_call_output`。
          x-stainless-const: true
        id:
          type: string
          description: |
            由模型生成的本地 shell 工具调用的唯一 ID。
        output:
          type: string
          description: |
            本地 shell 工具调用的输出的 JSON 字符串。
        status:
          type: string
          enum:
            - in_progress
            - completed
            - incomplete
          description: |
            项目状态。可以是 `in_progress`、`completed`或 `incomplete`。
          nullable: true
      required:
        - id
        - type
        - call_id
        - output
    MCPApprovalResponse:
      type: object
      title: MCP 批准响应
      description: |
        对 MCP 批准请求的响应。
      properties:
        type:
          type: string
          enum:
            - mcp_approval_response
          description: |
            项目的类型。始终为 `mcp_approval_response`。
          x-stainless-const: true
        id:
          type: string
          description: |
            批准响应的唯一 ID
          nullable: true
        approval_request_id:
          type: string
          description: |
            正在回答的批准请求的 ID。
        approve:
          type: boolean
          description: |
            请求是否获得批准。
        reason:
          type: string
          description: |
            对该决定的可选说明。
          nullable: true
      required:
        - type
        - request_id
        - approve
        - approval_request_id
    LocalShellExecAction:
      type: object
      title: 本地 shell 执行操作
      description: |
        在服务器上执行一条 shell 命令
      properties:
        type:
          type: string
          enum:
            - exec
          description: |
            本地 shell 操作的类型。始终为 `exec`。
          x-stainless-const: true
        command:
          type: array
          items:
            type: string
          description: |
            要运行的命令。
        timeout_ms:
          type: integer
          description: |
            可选的命令超时时间
          nullable: true
        working_directory:
          type: string
          description: |
            可选的命令工作目录
          nullable: true
        env:
          type: object
          additionalProperties:
            type: string
          description: |
            要设置的环境变量。
        user:
          type: string
          description: |
            可选的用户，以该用户身份运行命令。
          nullable: true
      required:
        - type
        - command
        - env
    MCPListToolsTool:
      type: object
      title: MCP list tools tool
      description: |
        可在 MCP 服务器上使用的工具。
      properties:
        name:
          type: string
          description: |
            工具的名称。
        description:
          type: string
          description: |
            工具的描述。
          nullable: true
        input_schema:
          type: object
          description: |
            描述工具输入的 JSON 架构。
        annotations:
          type: object
          description: |
            有关工具的其他注释。
          nullable: true
      required:
        - name
        - input_schema
    OutputTextContent:
      properties:
        type:
          type: string
          enum:
            - output_text
          description: 输出文本的类型。始终为 `output_text`。
          default: output_text
          x-stainless-const: true
        text:
          type: string
          description: 模型的文本输出。
        annotations:
          items:
            $ref: '#/components/schemas/Annotation'
          type: array
          description: 文本输出的注解。
        logprobs:
          items:
            $ref: '#/components/schemas/LogProb'
          type: array
      type: object
      required:
        - type
        - text
        - annotations
      title: 输出文本
      description: 模型文本输出
    RefusalContent:
      properties:
        type:
          type: string
          enum:
            - refusal
          description: 拒绝的类型。始终为 `refusal`。
          default: refusal
          x-stainless-const: true
        refusal:
          type: string
          description: 模型的拒绝解释。
      type: object
      required:
        - type
        - refusal
      title: Refusal
      description: 来自模型的拒绝。
    ResponseFormatJsonSchemaSchema:
      type: object
      title: JSON schema
      description: |
        响应格式的模式，描述为 JSON Schema 对象。
        了解有关如何构建 JSON Schema 的更多信息 [here](https://json-schema.org/)。
      additionalProperties: true
    RankingOptions:
      properties:
        ranker:
          type: string
          enum:
            - auto
            - default-2024-11-15
          description: 用于文件搜索的排名器。
        score_threshold:
          type: number
          description: 文件搜索的分数阈值，介于 0 和 1 之间的数字。接近 1 的数字将尝试仅返回最相关的结果，但可能返回更少的结果。
      type: object
      required: []
    Filters:
      anyOf:
        - 9a90b63d-4625-489e-98a9-c6fd7a9d4081
        - c30ed57f-1627-4d50-a54d-1d4f8b067c74
    ApproximateLocation:
      properties:
        type:
          type: string
          enum:
            - approximate
          description: 位置近似的类型。始终为 `approximate`。
          default: approximate
          x-stainless-const: true
        country:
          anyOf:
            - type: string
              description: >-
                用户的两字母 [ISO 国家代码](https://en.wikipedia.org/wiki/ISO_3166-1)，例如
                `US`。
            - type: 'null'
        region:
          anyOf:
            - type: string
              description: 用户的自由文本输入的地区，例如 `California`。
            - type: 'null'
        city:
          anyOf:
            - type: string
              description: 用户的自由文本输入的城市，例如 `San Francisco`。
            - type: 'null'
        timezone:
          anyOf:
            - type: string
              description: >-
                用户的 [IANA
                时区](https://timeapi.io/documentation/iana-timezones)，例如
                `America/Los_Angeles`。
            - type: 'null'
      type: object
      required:
        - type
    InputTextContent:
      properties:
        type:
          type: string
          enum:
            - input_text
          description: 输入项的类型。始终为 `input_text`。
          default: input_text
          x-stainless-const: true
        text:
          type: string
          description: 发送到模型的文本输入。
      type: object
      required:
        - type
        - text
      title: 输入文本
      description: 发送到模型的文本输入。
    InputImageContent:
      properties:
        type:
          type: string
          enum:
            - input_image
          description: 输入项的类型。始终为 `input_image`。
          default: input_image
          x-stainless-const: true
        image_url:
          anyOf:
            - type: string
              description: 要发送到模型的图像的 URL。可以是完全限定的 URL 或以数据 URL 形式编码的 base64 图像。
            - type: 'null'
        file_id:
          anyOf:
            - type: string
              description: 要发送到模型的文件的 ID。
            - type: 'null'
        detail:
          type: string
          enum:
            - low
            - high
            - auto
          description: 要发送到模型的图像的详细级别。可以是 `high`、`low` 或 `auto`。默认值为 `auto`。
      type: object
      required:
        - type
        - detail
      title: 输入图像
      description: 发送到模型的图像输入。了解有关 [图像输入](/docs/guides/vision) 的更多信息。
    InputFileContent:
      properties:
        type:
          type: string
          enum:
            - input_file
          description: 输入项的类型。始终为 `input_file`。
          default: input_file
          x-stainless-const: true
        file_id:
          anyOf:
            - type: string
              description: 要发送到模型的文件的 ID。
            - type: 'null'
        filename:
          type: string
          description: 要发送到模型的文件的名称。
        file_data:
          type: string
          description: |
            要发送到模型的文件的内容。
      type: object
      required:
        - type
      title: 输入文件
      description: 发送到模型的文件输入。
    InputContent:
      oneOf:
        - $ref: '#/components/schemas/InputTextContent'
        - $ref: '#/components/schemas/InputImageContent'
        - $ref: '#/components/schemas/InputFileContent'
    ComputerCallSafetyCheckParam:
      properties:
        id:
          type: string
          description: 待处理安全检查的 ID。
        code:
          anyOf:
            - type: string
              description: 待处理安全检查的类型。
            - type: 'null'
        message:
          anyOf:
            - type: string
              description: 待处理安全检查的详细信息。
            - type: 'null'
      type: object
      required:
        - id
      description: 计算机调用的待处理安全检查。
    Annotation:
      oneOf:
        - $ref: '#/components/schemas/FileCitationBody'
        - $ref: '#/components/schemas/UrlCitationBody'
        - $ref: '#/components/schemas/ContainerFileCitationBody'
        - ce3c6df5-2601-4adf-9892-6bcec438e5da
      discriminator:
        propertyName: type
    LogProb:
      properties:
        token:
          type: string
        logprob:
          type: number
        bytes:
          items:
            type: integer
          type: array
        top_logprobs:
          items:
            $ref: '#/components/schemas/TopLogProb'
          type: array
      type: object
      required:
        - token
        - logprob
        - bytes
        - top_logprobs
      title: Log probability
      description: 令牌的对数概率。
    FileCitationBody:
      properties:
        type:
          type: string
          enum:
            - file_citation
          description: 文件引用的类型。始终为 `file_citation`。
          default: file_citation
          x-stainless-const: true
        file_id:
          type: string
          description: 文件的 ID。
        index:
          type: integer
          description: 文件在文件列表中的索引。
        filename:
          type: string
          description: 被引用文件的文件名。
      type: object
      required:
        - type
        - file_id
        - index
        - filename
      title: File citation
      description: 对文件的引用。
    UrlCitationBody:
      properties:
        type:
          type: string
          enum:
            - url_citation
          description: URL 引用的类型。始终为 `url_citation`。
          default: url_citation
          x-stainless-const: true
        url:
          type: string
          description: Web 资源的 URL。
        start_index:
          type: integer
          description: URL 引用在消息中的第一个字符的索引。
        end_index:
          type: integer
          description: URL 引用在消息中的最后一个字符的索引。
        title:
          type: string
          description: Web 资源的标题。
      type: object
      required:
        - type
        - url
        - start_index
        - end_index
        - title
      title: URL citation
      description: 对用于生成模型响应的 Web 资源的引用。
    ContainerFileCitationBody:
      properties:
        type:
          type: string
          enum:
            - container_file_citation
          description: 容器文件引用的类型。始终为 `container_file_citation`。
          default: container_file_citation
          x-stainless-const: true
        container_id:
          type: string
          description: 容器文件的 ID。
        file_id:
          type: string
          description: 文件的 ID。
        start_index:
          type: integer
          description: 容器文件引用在消息中的第一个字符的索引。
        end_index:
          type: integer
          description: 容器文件引用在消息中的最后一个字符的索引。
        filename:
          type: string
          description: 被引用容器文件的文件名。
      type: object
      required:
        - type
        - container_id
        - file_id
        - start_index
        - end_index
        - filename
      title: Container file citation
      description: 对用于生成模型响应的容器文件的引用。
    TopLogProb:
      properties:
        token:
          type: string
        logprob:
          type: number
        bytes:
          items:
            type: integer
          type: array
      type: object
      required:
        - token
        - logprob
        - bytes
      title: Top log probability
      description: 令牌的最高对数概率。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API认证token
    apiKeyAuth:
      type: apiKey
      in: header
      name: GeekAI-API-Key
      description: API密钥认证

````