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

# /v1/responses

> 创建一个模型响应。提供文本或图像输入来生成文本或JSON输出。让模型调用您自己的自定义代码或使用内置工具，如网络搜索或文件搜索，将您自己的数据作为模型响应的输入。



## OpenAPI

````yaml POST /v1/responses
openapi: 3.1.0
info:
  title: TokenOps AI API
  description: TokenOps AI API 提供了强大的AI服务能力，包括聊天对话、Gemini模型集成等功能。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://model-api.skyengine.com.cn
    description: TokenOps AI API 生产环境
security: []
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: 创建模型响应
      description: >-
        创建一个模型响应。提供文本或图像输入来生成文本或JSON输出。让模型调用您自己的自定义代码或使用内置工具，如网络搜索或文件搜索，将您自己的数据作为模型响应的输入。
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateResponseRequest'
            examples:
              basic_text:
                summary: 基础文本对话
                description: 简单的文本对话请求
                value:
                  model: gpt-4.1
                  input: 解释一下什么是人工智能
                  max_output_tokens: 1000
                  temperature: 0.7
              structured_output:
                summary: 结构化输出
                description: 要求模型返回JSON格式的结构化数据
                value:
                  model: gpt-4.1
                  input: 分析苹果公司的基本信息，包括公司名称、成立年份、创始人、主要业务等，以JSON格式返回
                  text:
                    format:
                      type: json_object
                  max_output_tokens: 500
              thinking_mode:
                summary: 推理模式
                description: 启用模型的推理思考过程
                value:
                  model: o1-2024-12-17
                  input: 请解决这个数学问题：一个圆的面积是78.54平方厘米，求这个圆的周长。请详细说明解题思路。
                  reasoning:
                    effort: medium
              web_search:
                summary: 网络搜索
                description: 使用网络搜索工具获取最新信息
                value:
                  model: gpt-4.1
                  input: 今天有什么积极的新闻？
                  tools:
                    - type: web_search_preview
                  tool_choice: auto
                  max_output_tokens: 500
              file_search:
                summary: 文件搜索
                description: 在向量存储中搜索相关文档
                value:
                  model: gpt-4.1
                  input: 古代棕龙的属性是什么？
                  tools:
                    - type: file_search
                      vector_store_ids:
                        - vs_1234567890
                      max_num_results: 20
                  tool_choice: auto
                  max_output_tokens: 500
              function_calling:
                summary: 函数调用
                description: 调用自定义函数获取实时数据
                value:
                  model: gpt-4.1
                  input: 波士顿今天的天气如何？
                  tools:
                    - type: function
                      name: get_current_weather
                      description: 获取指定地点的当前天气
                      parameters:
                        type: object
                        properties:
                          location:
                            type: string
                            description: 城市和州，例如：San Francisco, CA
                          unit:
                            type: string
                            enum:
                              - celsius
                              - fahrenheit
                        required:
                          - location
                          - unit
                  tool_choice: auto
                  max_output_tokens: 500
              multimodal:
                summary: 多模态输入
                description: 处理包含图像的多模态输入
                value:
                  model: gpt-4.1
                  input:
                    - role: user
                      content:
                        - type: text
                          text: 这张图片里有什么？
                        - type: image_url
                          image_url:
                            url: >-
                              https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg
                  max_output_tokens: 300
              streaming:
                summary: 流式响应
                description: 启用实时流式响应
                value:
                  model: gpt-4.1
                  input: 写一篇关于人工智能发展历史的简短文章
                  stream: true
                  max_output_tokens: 1000
                  temperature: 0.8
      responses:
        '200':
          description: 响应生成成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResponseResponse'
              examples:
                basic_response:
                  summary: 基础响应
                  value:
                    id: resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b
                    object: response
                    created_at: 1741476542
                    status: completed
                    error: null
                    incomplete_details: null
                    instructions: null
                    max_output_tokens: null
                    model: gpt-4.1-2025-04-14
                    output:
                      - type: message
                        id: msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: >-
                              人工智能（Artificial Intelligence,
                              AI）是计算机科学的一个分支，致力于创建能够模拟人类智能的计算机系统。AI技术包括机器学习、深度学习、自然语言处理等多个领域，在医疗、金融、教育等行业都有广泛应用。
                            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: 12
                      input_tokens_details:
                        cached_tokens: 0
                      output_tokens: 150
                      output_tokens_details:
                        reasoning_tokens: 0
                      total_tokens: 162
                    user: null
                    metadata: {}
                structured_response:
                  summary: 结构化响应
                  value:
                    id: resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41
                    object: response
                    created_at: 1741476777
                    status: completed
                    error: null
                    incomplete_details: null
                    instructions: null
                    max_output_tokens: null
                    model: gpt-4.1-2025-04-14
                    output:
                      - type: message
                        id: msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: |-
                              {
                                "company_name": "Apple Inc.",
                                "founded_year": 1976,
                                "founders": ["Steve Jobs", "Steve Wozniak", "Ronald Wayne"],
                                "main_business": ["消费电子产品", "软件", "服务"]
                              }
                            annotations: []
                    parallel_tool_calls: true
                    previous_response_id: null
                    reasoning:
                      effort: null
                      summary: null
                    store: true
                    temperature: 1
                    text:
                      format:
                        type: json_object
                    tool_choice: auto
                    tools: []
                    top_p: 1
                    truncation: disabled
                    usage:
                      input_tokens: 25
                      input_tokens_details:
                        cached_tokens: 0
                      output_tokens: 80
                      output_tokens_details:
                        reasoning_tokens: 0
                      total_tokens: 105
                    user: null
                    metadata: {}
                thinking_response:
                  summary: 推理模式响应
                  value:
                    id: resp_67ccd7eca01881908ff0b5146584e408072912b2993db808
                    object: response
                    created_at: 1741477868
                    status: completed
                    error: null
                    incomplete_details: null
                    instructions: null
                    max_output_tokens: null
                    model: o1-2024-12-17
                    output:
                      - type: message
                        id: msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808
                        status: completed
                        role: assistant
                        content:
                          - type: output_text
                            text: |-
                              根据圆的面积为78.54平方厘米，我可以计算出周长为31.42厘米。

                              解题步骤：
                              1. 由面积公式 A = πr²，得到 r² = A/π = 78.54/3.14159 ≈ 25
                              2. 因此半径 r = √25 = 5厘米
                              3. 周长 C = 2πr = 2 × 3.14159 × 5 = 31.42厘米
                            annotations: []
                    parallel_tool_calls: true
                    previous_response_id: null
                    reasoning:
                      effort: high
                      summary: null
                    store: true
                    temperature: 1
                    text:
                      format:
                        type: text
                    tool_choice: auto
                    tools: []
                    top_p: 1
                    truncation: disabled
                    usage:
                      input_tokens: 81
                      input_tokens_details:
                        cached_tokens: 0
                      output_tokens: 1035
                      output_tokens_details:
                        reasoning_tokens: 832
                      total_tokens: 1116
                    user: null
                    metadata: {}
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ResponseStreamEvent'
              examples:
                streaming_response:
                  summary: 流式响应示例
                  value: >-
                    event: response.created

                    data:
                    {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"您是一个有用的助手。","max_output_tokens":null,"model":"gpt-4.1-2025-04-14","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}


                    event: response.output_item.added

                    data:
                    {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}}


                    event: response.content_part.added

                    data:
                    {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}


                    event: response.output_text.delta

                    data:
                    {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"人工智能"}


                    event: response.output_text.delta

                    data:
                    {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"是一门"}


                    event: response.output_text.done

                    data:
                    {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"人工智能是一门致力于创建智能机器的计算机科学分支..."}


                    event: response.completed

                    data:
                    {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"您是一个有用的助手。","max_output_tokens":null,"model":"gpt-4.1-2025-04-14","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"人工智能是一门致力于创建智能机器的计算机科学分支...","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":58,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":95},"user":null,"metadata":{}}}
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl https://model-api.skyengine.com.cn/v1/responses \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer $API_KEY" \
              -d '{
                "model": "gpt-4.1",
                "input": "给我讲一个关于独角兽的三句话睡前故事。"
              }'
        - lang: javascript
          label: JavaScript
          source: |-
            import OpenAI from "openai";

            const openai = new OpenAI();

            const response = await openai.responses.create({
                model: "gpt-4.1",
                input: "给我讲一个关于独角兽的三句话睡前故事。"
            });

            console.log(response);
        - lang: python
          label: Python
          source: |-
            from openai import OpenAI

            client = OpenAI(
                api_key="My API Key",
            )
            response = client.responses.create(
                model="gpt-4.1",
                input="给我讲一个关于独角兽的三句话睡前故事。"
            )
            print(response.id)
        - lang: csharp
          label: C#
          source: >-
            using System;

            using OpenAI.Responses;


            OpenAIResponseClient client = new(
                model: "gpt-4.1",
                apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
            );


            OpenAIResponse response =
            client.CreateResponse("给我讲一个关于独角兽的三句话睡前故事。");


            Console.WriteLine(response.GetOutputText());
        - lang: nodejs
          label: Node.js
          source: |-
            import OpenAI from 'openai';

            const client = new OpenAI({
              apiKey: 'My API Key',
            });

            const response = await client.responses.create({
              model: 'gpt-4.1',
              input: '给我讲一个关于独角兽的三句话睡前故事。'
            });

            console.log(response.id);
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "context"
              "fmt"

              "github.com/openai/openai-go"
              "github.com/openai/openai-go/option"
              "github.com/openai/openai-go/responses"
            )

            func main() {
              client := openai.NewClient(
                option.WithAPIKey("My API Key"),
              )
              response, err := client.Responses.New(context.TODO(), responses.ResponseNewParams{
                Model: openai.F("gpt-4.1"),
                Input: openai.F("给我讲一个关于独角兽的三句话睡前故事。"),
              })
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", response.ID)
            }
        - lang: java
          label: Java
          source: |-
            package com.openai.example;

            import com.openai.client.OpenAIClient;
            import com.openai.client.okhttp.OpenAIOkHttpClient;
            import com.openai.models.responses.Response;
            import com.openai.models.responses.ResponseCreateParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    OpenAIClient client = OpenAIOkHttpClient.fromEnv();

                    Response response = client.responses().create(
                        ResponseCreateParams.builder()
                            .model("gpt-4.1")
                            .input("给我讲一个关于独角兽的三句话睡前故事。")
                            .build()
                    );
                    System.out.println(response.getId());
                }
            }
        - lang: ruby
          label: Ruby
          source: |-
            require "openai"

            openai = OpenAI::Client.new(api_key: "My API Key")

            response = openai.responses.create(
              model: "gpt-4.1",
              input: "给我讲一个关于独角兽的三句话睡前故事。"
            )

            puts(response.id)
components:
  schemas:
    CreateResponseRequest:
      allOf:
        - $ref: '#/components/schemas/CreateModelResponseProperties'
        - $ref: '#/components/schemas/ResponseProperties'
        - type: object
          properties:
            input:
              description: >-
                文本、图像或文件输入到模型，用于生成响应。


                了解更多：

                - [文本输入和输出](https://platform.openai.com/docs/guides/text)

                - [图像输入](https://platform.openai.com/docs/guides/images)

                - [文件输入](https://platform.openai.com/docs/guides/pdf-files)

                -
                [对话状态](https://platform.openai.com/docs/guides/conversation-state)

                -
                [函数调用](https://platform.openai.com/docs/guides/function-calling)
              anyOf:
                - type: string
                  title: 文本输入
                  description: 模型的文本输入，相当于具有'user'角色的文本输入。
                - type: array
                  title: 输入项列表
                  description: 模型的一个或多个输入项列表，包含不同的内容类型。
                  items:
                    $ref: '#/components/schemas/InputItem'
            include:
              anyOf:
                - type: array
                  description: >-
                    指定在模型响应中包含的额外输出数据。当前支持的值有：

                    - `web_search_call.action.sources`: 包括网络搜索工具调用的来源。

                    - `code_interpreter_call.outputs`:
                    包括代码解释器工具调用中Python代码执行的输出。

                    - `computer_call_output.output.image_url`:
                    包括来自计算机调用输出的图像URL。

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

                    - `message.input_image.image_url`: 包括来自输入消息的图像URL。

                    - `message.output_text.logprobs`: 包括带有助手消息的对数概率。

                    - `reasoning.encrypted_content`:
                    包括推理项输出中推理token的加密版本。这使得在使用Responses
                    API无状态（如当`store`参数设置为`false`时，或当组织注册了零数据保留计划时）时，推理项可以用于多轮对话。
                  items:
                    $ref: '#/components/schemas/Includable'
                - type: 'null'
            parallel_tool_calls:
              anyOf:
                - type: boolean
                  description: 是否允许模型并行运行工具调用。
                  default: true
                - type: 'null'
            store:
              anyOf:
                - type: boolean
                  description: 是否存储生成的模型响应以供以后通过API检索。
                  default: true
                - type: 'null'
            instructions:
              anyOf:
                - type: string
                  description: >-
                    插入到模型上下文中的系统（或开发者）消息。


                    当与`previous_response_id`一起使用时，前一个响应的指令不会被带到下一个响应。这使得在新响应中简单地交换系统（或开发者）消息变得简单。
                - type: 'null'
            stream:
              anyOf:
                - description: >-
                    如果设置为true，模型响应数据将使用[服务器发送事件](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)实时流式传输。

                    有关更多信息，请参阅[流式响应部分](https://platform.openai.com/docs/api-reference/responses-streaming)。
                  type: boolean
                  default: false
                - type: 'null'
            stream_options:
              $ref: '#/components/schemas/ResponseStreamOptions'
            conversation:
              anyOf:
                - description: |-
                    此响应所属的对话。此对话中的项目会被添加到此响应请求的`input_items`之前。
                    此响应的输入项和输出项在此响应完成后会自动添加到此对话中。
                  anyOf:
                    - type: string
                      title: 对话ID
                      description: 对话的唯一ID。
                    - $ref: '#/components/schemas/ConversationParam'
                - type: 'null'
    CreateResponseResponse:
      title: 响应对象
      allOf:
        - $ref: '#/components/schemas/ModelResponseProperties'
        - $ref: '#/components/schemas/ResponseProperties'
        - type: object
          properties:
            id:
              type: string
              description: 此响应的唯一标识符。
              example: resp_abc123
            object:
              type: string
              description: 此资源的对象类型 - 始终设置为 `response`。
              enum:
                - response
              example: response
            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:
              anyOf:
                - type: object
                  description: 有关响应为何不完整的详细信息。
                  properties:
                    reason:
                      type: string
                      description: 响应不完整的原因。
                      enum:
                        - max_output_tokens
                        - content_filter
                - type: 'null'
            output:
              type: array
              description: >-
                由模型生成的内容项数组。


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

                - 不要简单地访问 `output` 数组中的第一项并假设它是带有模型生成内容的 `assistant`
                消息，您可以考虑在SDK支持的情况下使用 `output_text` 属性。
              items:
                $ref: '#/components/schemas/OutputItem'
            instructions:
              anyOf:
                - description: >-
                    插入到模型上下文中的系统（或开发者）消息。


                    当与 `previous_response_id`
                    一起使用时，前一个响应的指令不会被带到下一个响应。这使得在新响应中简单地交换系统（或开发者）消息变得简单。
                  anyOf:
                    - type: string
                      description: 模型的文本输入，相当于具有 `developer` 角色的文本输入。
                    - type: array
                      title: 输入项列表
                      description: 模型的一个或多个输入项列表，包含不同的内容类型。
                      items:
                        $ref: '#/components/schemas/InputItem'
                - type: 'null'
            output_text:
              anyOf:
                - type: string
                  description: >-
                    仅SDK便利属性，包含 `output` 数组中所有 `output_text`
                    项的聚合文本输出（如果存在）。在Python和JavaScript SDK中支持。
                - type: 'null'
            usage:
              $ref: '#/components/schemas/ResponseUsage'
            parallel_tool_calls:
              type: boolean
              description: 是否允许模型并行运行工具调用。
              default: true
            conversation:
              anyOf:
                - $ref: '#/components/schemas/Conversation'
                - type: 'null'
          required:
            - id
            - object
            - created_at
            - error
            - incomplete_details
            - instructions
            - model
            - tools
            - output
            - parallel_tool_calls
            - metadata
            - tool_choice
            - temperature
            - top_p
    ResponseStreamEvent:
      anyOf:
        - $ref: '#/components/schemas/ResponseAudioDeltaEvent'
        - $ref: '#/components/schemas/ResponseAudioDoneEvent'
        - $ref: '#/components/schemas/ResponseTextDeltaEvent'
        - $ref: '#/components/schemas/ResponseTextDoneEvent'
        - $ref: '#/components/schemas/ResponseCompletedEvent'
        - $ref: '#/components/schemas/ResponseCreatedEvent'
        - $ref: '#/components/schemas/ResponseErrorEvent'
        - $ref: '#/components/schemas/ResponseInProgressEvent'
        - $ref: '#/components/schemas/ResponseFailedEvent'
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Status'
          description: 错误信息
    CreateModelResponseProperties:
      allOf:
        - $ref: '#/components/schemas/ModelResponseProperties'
        - type: object
          properties:
            top_logprobs:
              description: 一个介于0和20之间的整数，指定在每个token位置返回的最可能token的数量，每个token都有相关的对数概率。
              type: integer
              minimum: 0
              maximum: 20
    ResponseProperties:
      type: object
      properties:
        previous_response_id:
          anyOf:
            - type: string
              description: >-
                先前响应的唯一ID，用于创建多轮对话。了解更多关于[对话状态](https://platform.openai.com/docs/guides/conversation-state)。不能与`conversation`参数同时使用。
            - type: 'null'
        model:
          $ref: '#/components/schemas/ModelIds'
          description: >-
            用于生成响应的模型ID，如`gpt-4o`或`o3`。OpenAI提供具有不同功能、性能特性和价格点的广泛模型。参考[模型指南](https://platform.openai.com/docs/models)浏览和比较可用模型。
        reasoning:
          anyOf:
            - $ref: '#/components/schemas/Reasoning'
            - type: 'null'
        background:
          anyOf:
            - type: boolean
              description: >-
                是否在后台运行模型响应。[了解更多](https://platform.openai.com/docs/guides/background)。
              default: false
            - type: 'null'
        max_output_tokens:
          anyOf:
            - description: >-
                可以为响应生成的token数量的上限，包括可见输出token和[推理token](https://platform.openai.com/docs/guides/reasoning)。
              type: integer
            - type: 'null'
        max_tool_calls:
          anyOf:
            - description: >-
                在响应中可以处理的内置工具调用总数的最大值。此最大数量适用于所有内置工具调用，而不是每个单独工具。模型进一步尝试调用工具将被忽略。
              type: integer
            - type: 'null'
        text:
          type: object
          description: >-
            模型文本响应的配置选项。可以是纯文本或结构化JSON数据。了解更多：

            - [文本输入和输出](https://platform.openai.com/docs/guides/text)

            -
            [结构化输出](https://platform.openai.com/docs/guides/structured-outputs)
          properties:
            format:
              $ref: '#/components/schemas/TextResponseFormatConfiguration'
            verbosity:
              $ref: '#/components/schemas/Verbosity'
        tools:
          type: array
          description: >-
            模型在生成响应时可以调用的工具数组。您可以通过设置`tool_choice`参数来指定使用哪个工具。


            我们支持以下类别的工具：

            -
            **内置工具**：由OpenAI提供的扩展模型功能的工具，如[网络搜索](https://platform.openai.com/docs/guides/tools-web-search)或[文件搜索](https://platform.openai.com/docs/guides/tools-file-search)。了解更多关于[内置工具](https://platform.openai.com/docs/guides/tools)。

            - **MCP工具**：通过自定义MCP服务器或预定义连接器（如Google
            Drive和SharePoint）与第三方系统集成。了解更多关于[MCP工具](https://platform.openai.com/docs/guides/tools-connectors-mcp)。

            -
            **函数调用（自定义工具）**：由您定义的函数，使模型能够使用强类型参数和输出调用您自己的代码。了解更多关于[函数调用](https://platform.openai.com/docs/guides/function-calling)。您也可以使用自定义工具调用您自己的代码。
          items:
            $ref: '#/components/schemas/ResponseTool'
        tool_choice:
          description: 模型在生成响应时应如何选择使用哪个工具（或工具）。请参阅`tools`参数了解如何指定模型可以调用的工具。
          anyOf:
            - $ref: '#/components/schemas/ToolChoiceOptions'
            - $ref: '#/components/schemas/ToolChoiceAllowed'
            - $ref: '#/components/schemas/ToolChoiceTypes'
            - $ref: '#/components/schemas/ToolChoiceFunction'
            - $ref: '#/components/schemas/ToolChoiceMCP'
            - $ref: '#/components/schemas/ToolChoiceCustom'
          discriminator:
            propertyName: type
        prompt:
          $ref: '#/components/schemas/Prompt'
        truncation:
          anyOf:
            - type: string
              description: |-
                用于模型响应的截断策略。
                - `auto`：如果此响应的输入超过模型的上下文窗口大小，模型将通过从对话开头删除项目来截断响应以适应上下文窗口。
                - `disabled`（默认）：如果输入大小将超过模型的上下文窗口大小，请求将失败并返回400错误。
              enum:
                - auto
                - disabled
              default: disabled
            - type: 'null'
    InputItem:
      discriminator:
        propertyName: type
      anyOf:
        - $ref: '#/components/schemas/EasyInputMessage'
        - $ref: '#/components/schemas/Item'
          type: object
          title: 项目
          description: 表示为模型生成响应的上下文部分的项目。可以包含文本、图像和音频输入，以及之前的助手响应和工具调用输出。
        - $ref: '#/components/schemas/ItemReferenceParam'
    Includable:
      type: string
      description: 指定在模型响应中包含的额外输出数据。
      enum:
        - code_interpreter_call.outputs
        - computer_call_output.output.image_url
        - file_search_call.results
        - message.input_image.image_url
        - message.output_text.logprobs
        - reasoning.encrypted_content
    ResponseStreamOptions:
      anyOf:
        - description: '流式响应的选项。仅在设置 `stream: true` 时设置。'
          type: object
          properties:
            include_obfuscation:
              type: boolean
              description: >-
                当为true时，启用流混淆。流混淆在流式增量事件上添加随机字符到 `obfuscation`
                字段，以规范化有效载荷大小，作为对某些侧信道攻击的缓解措施。
        - type: 'null'
    ConversationParam:
      properties:
        id:
          type: string
          description: 对话的唯一ID。
          example: conv_123
      type: object
      required:
        - id
      title: 对话对象
      description: 此响应所属的对话。
    ModelResponseProperties:
      type: object
      properties:
        metadata:
          type: object
          description: 请求的元数据
          additionalProperties: true
        top_logprobs:
          anyOf:
            - description: 一个介于0和20之间的整数，指定在每个token位置返回的最可能token的数量，每个token都有相关的对数概率。
              type: integer
              minimum: 0
              maximum: 20
            - type: 'null'
        temperature:
          anyOf:
            - type: number
              minimum: 0
              maximum: 2
              default: 1
              example: 1
              description: |-
                采样温度，取值范围在0到2之间。较高的值（如0.8）会使输出更加随机，而较低的值（如0.2）会使输出更加集中和确定性。
                通常建议仅调整temperature或top_p其中之一，不建议两者都修改。
            - type: 'null'
        top_p:
          anyOf:
            - type: number
              minimum: 0
              maximum: 1
              default: 1
              example: 1
              description: >-
                核采样的替代方法，称为nucleus采样，模型考虑具有top_p概率质量的token结果。例如，0.1意味着只考虑构成前10%概率质量的token。

                通常建议仅调整temperature或top_p其中之一，不建议两者都修改。
            - type: 'null'
        user:
          type: string
          example: user-1234
          deprecated: true
          description: >-
            此字段正在被safety_identifier和prompt_cache_key替代。请使用prompt_cache_key来维持缓存优化。

            用于您的终端用户的稳定标识符。用于提高缓存命中率，通过更好地分组类似请求，并帮助检测和防止滥用。
        safety_identifier:
          type: string
          example: safety-identifier-1234
          description: >-
            一个稳定的标识符，用于帮助检测可能违反使用政策的用户。ID应该是唯一标识每个用户的字符串。我们建议对用户名或电子邮件地址进行哈希处理，以避免向我们发送任何识别信息。
        prompt_cache_key:
          type: string
          example: prompt-cache-key-1234
          description: 用于缓存类似请求的响应以优化缓存命中率。替代user字段。
        service_tier:
          type: string
          enum:
            - default
            - scale
          description: 服务层级
    ResponseError:
      anyOf:
        - type: object
          description: 当模型无法生成响应时返回的错误对象。
          properties:
            code:
              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
            message:
              type: string
              description: 错误的人类可读描述。
          required:
            - code
            - message
        - type: 'null'
    OutputItem:
      description: 模型生成的输出项，可以是消息、工具调用或其他内容类型。
      anyOf:
        - $ref: '#/components/schemas/OutputMessage'
        - $ref: '#/components/schemas/FileSearchToolCall'
        - $ref: '#/components/schemas/FunctionToolCall'
        - $ref: '#/components/schemas/WebSearchToolCall'
        - $ref: '#/components/schemas/ComputerToolCall'
        - $ref: '#/components/schemas/ReasoningItem'
        - $ref: '#/components/schemas/ImageGenToolCall'
        - $ref: '#/components/schemas/CodeInterpreterToolCall'
        - $ref: '#/components/schemas/LocalShellToolCall'
        - $ref: '#/components/schemas/MCPToolCall'
        - $ref: '#/components/schemas/MCPListTools'
        - $ref: '#/components/schemas/MCPApprovalRequest'
        - $ref: '#/components/schemas/CustomToolCall'
      discriminator:
        propertyName: type
    ResponseUsage:
      type: object
      description: 表示token使用详情，包括输入token、输出token、输出token的细分和使用的总token。
      properties:
        input_tokens:
          type: integer
          description: 输入token的数量。
        input_tokens_details:
          type: object
          description: 输入token的详细细分。
          properties:
            cached_tokens:
              type: integer
              description: 从缓存中检索的token数量。
          required:
            - cached_tokens
        output_tokens:
          type: integer
          description: 输出token的数量。
        output_tokens_details:
          type: object
          description: 输出token的详细细分。
          properties:
            reasoning_tokens:
              type: integer
              description: 推理token的数量。
          required:
            - reasoning_tokens
        total_tokens:
          type: integer
          description: 使用的总token数量。
      required:
        - input_tokens
        - input_tokens_details
        - output_tokens
        - output_tokens_details
        - total_tokens
    Conversation:
      properties:
        id:
          type: string
          description: 对话的唯一ID。
      type: object
      required:
        - id
      title: 对话
      description: 此响应所属的对话。此响应的输入项和输出项会自动添加到此对话中。
    ResponseAudioDeltaEvent:
      type: object
      description: 当有部分音频响应时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.audio.delta`。
          enum:
            - response.audio.delta
        sequence_number:
          type: integer
          description: 流响应的这个块的序列号。
        delta:
          type: string
          description: 一块Base64编码的响应音频字节。
      required:
        - type
        - delta
        - sequence_number
    ResponseAudioDoneEvent:
      type: object
      description: 当音频响应完成时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.audio.done`。
          enum:
            - response.audio.done
        sequence_number:
          type: integer
          description: 增量的序列号。
      required:
        - type
        - sequence_number
    ResponseTextDeltaEvent:
      type: object
      description: 当有额外的文本增量时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.output_text.delta`。
          enum:
            - response.output_text.delta
        item_id:
          type: string
          description: 添加文本增量的输出项的ID。
        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
    ResponseTextDoneEvent:
      type: object
      description: 当文本内容完成时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.output_text.done`。
          enum:
            - response.output_text.done
        item_id:
          type: string
          description: 完成文本的输出项的ID。
        output_index:
          type: integer
          description: 完成文本的输出项的索引。
        content_index:
          type: integer
          description: 完成文本的内容部分的索引。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - item_id
        - output_index
        - content_index
        - sequence_number
    ResponseCompletedEvent:
      type: object
      description: 当响应完成时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.completed`。
          enum:
            - response.completed
        response:
          $ref: '#/components/schemas/CreateResponseResponse'
          description: 完成的响应对象。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response
        - sequence_number
    ResponseCreatedEvent:
      type: object
      description: 当响应被创建时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.created`。
          enum:
            - response.created
        response:
          $ref: '#/components/schemas/CreateResponseResponse'
          description: 创建的响应对象。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response
        - sequence_number
    ResponseErrorEvent:
      type: object
      description: 当响应生成过程中发生错误时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.error`。
          enum:
            - response.error
        error:
          $ref: '#/components/schemas/ResponseError'
          description: 发生的错误。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - error
        - sequence_number
    ResponseInProgressEvent:
      type: object
      description: 当响应处于进行中状态时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.in_progress`。
          enum:
            - response.in_progress
        response:
          $ref: '#/components/schemas/CreateResponseResponse'
          description: 进行中的响应对象。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response
        - sequence_number
    ResponseFailedEvent:
      type: object
      description: 当响应生成失败时发出。
      properties:
        type:
          type: string
          description: 事件的类型。始终为 `response.failed`。
          enum:
            - response.failed
        response:
          $ref: '#/components/schemas/CreateResponseResponse'
          description: 失败的响应对象。
        sequence_number:
          type: integer
          description: 此事件的序列号。
      required:
        - type
        - response
        - sequence_number
    Status:
      type: object
      properties:
        code:
          type: integer
          description: 错误代码
        message:
          type: string
          description: 错误消息
        details:
          type: array
          description: 错误详情
          items:
            type: object
            additionalProperties: true
    ModelIds:
      type: string
      description: 用于生成响应的模型ID。OpenAI提供具有不同功能、性能特性和价格点的广泛模型。
      example: gpt-4o
    Reasoning:
      type: object
      description: |-
        **gpt-5和o系列模型专用**

        [推理模型](https://platform.openai.com/docs/guides/reasoning)的配置选项。
      title: 推理配置
      properties:
        effort:
          $ref: '#/components/schemas/ReasoningEffort'
        summary:
          anyOf:
            - type: string
              description: 模型执行推理的摘要。这对于调试和理解模型的推理过程很有用。可选值：`auto`、`concise`或`detailed`。
              enum:
                - auto
                - concise
                - detailed
            - type: 'null'
    TextResponseFormatConfiguration:
      type: object
      description: 文本响应格式配置选项。用于控制模型生成文本的格式和结构。
      properties:
        type:
          type: string
          enum:
            - text
            - json_object
          description: 响应格式类型：`text` 表示纯文本，`json_object` 表示JSON对象格式
        schema:
          type: object
          description: 当格式为json_object时，定义JSON响应的结构schema
    Verbosity:
      type: string
      enum:
        - low
        - medium
        - high
      description: 控制模型响应的详细程度。
      default: medium
    ResponseTool:
      oneOf:
        - title: 函数工具
          type: object
          description: 自定义函数工具，允许模型调用您定义的函数
          properties:
            type:
              type: string
              const: function
              description: 工具类型，必须为 'function'
            name:
              type: string
              description: 函数名称
            description:
              type: string
              description: 函数的描述，用于帮助模型了解何时及如何调用函数
            parameters:
              type: object
              description: 函数参数的JSON Schema定义
              additionalProperties: true
            strict:
              type: boolean
              description: 是否使用严格模式进行函数调用
              default: false
          required:
            - type
            - name
          additionalProperties: false
        - title: 网络搜索工具
          type: object
          description: 网络搜索工具，允许模型搜索互联网获取最新信息
          properties:
            type:
              type: string
              const: web_search_preview
              description: 工具类型，必须为 'web_search_preview'
            domains:
              type: array
              description: 限制搜索的域名列表，空数组表示无限制
              items:
                type: string
              default: []
            search_context_size:
              type: string
              description: 搜索上下文大小
              enum:
                - small
                - medium
                - large
              default: medium
            user_location:
              type: object
              description: 用户位置信息，用于本地化搜索结果
              properties:
                type:
                  type: string
                  enum:
                    - approximate
                    - exact
                  description: 位置类型
                city:
                  type: string
                  nullable: true
                  description: 城市名称
                country:
                  type: string
                  nullable: true
                  description: 国家代码
                region:
                  type: string
                  nullable: true
                  description: 地区名称
                timezone:
                  type: string
                  nullable: true
                  description: 时区
          required:
            - type
          additionalProperties: false
        - title: 文件搜索工具
          type: object
          description: 文件搜索工具，允许模型在向量存储中搜索相关文档
          properties:
            type:
              type: string
              const: file_search
              description: 工具类型，必须为 'file_search'
            vector_store_ids:
              type: array
              description: 要搜索的向量存储ID列表
              items:
                type: string
            max_num_results:
              type: integer
              description: 返回的最大搜索结果数量
              minimum: 1
              maximum: 50
              default: 20
            filters:
              type: object
              nullable: true
              description: 搜索过滤条件
              additionalProperties: true
            ranking_options:
              type: object
              description: 搜索结果排序选项
              properties:
                ranker:
                  type: string
                  enum:
                    - auto
                    - default_2022
                  description: 排序算法
                  default: auto
                score_threshold:
                  type: number
                  description: 搜索结果相关性分数阈值
                  minimum: 0
                  maximum: 1
                  default: 0
          required:
            - type
          additionalProperties: false
      discriminator:
        propertyName: type
    ToolChoiceOptions:
      type: string
      description: 工具选择模式。控制模型调用哪个（如果有的话）工具。
      enum:
        - none
        - auto
        - required
    ToolChoiceAllowed:
      type: object
      description: 限制模型可用的工具为预定义集合。
      properties:
        type:
          type: string
          description: 允许的工具配置类型。始终为 allowed_tools。
          enum:
            - allowed_tools
          x-stainless-const: true
        mode:
          type: string
          description: 限制模型可用的工具为预定义集合。auto 允许模型从允许的工具中选择并生成消息。required 要求模型调用一个或多个允许的工具。
          enum:
            - auto
            - required
        tools:
          type: array
          description: 模型应被允许调用的工具定义列表。
          items:
            $ref: '#/components/schemas/ToolChoiceTypes'
      required:
        - type
        - mode
        - tools
    ToolChoiceTypes:
      anyOf:
        - $ref: '#/components/schemas/HostedTool'
        - $ref: '#/components/schemas/ToolChoiceFunction'
        - $ref: '#/components/schemas/ToolChoiceMCP'
        - $ref: '#/components/schemas/ToolChoiceCustom'
      discriminator:
        propertyName: type
    ToolChoiceFunction:
      type: object
      description: 使用此选项强制模型调用特定函数。
      properties:
        type:
          type: string
          description: 对于函数调用，类型始终为 function。
          enum:
            - function
          x-stainless-const: true
        name:
          type: string
          description: 要调用的函数名称。
      required:
        - type
        - name
    ToolChoiceMCP:
      type: object
      description: 使用此选项强制模型调用远程 MCP 服务器上的特定工具。
      properties:
        type:
          type: string
          description: 对于 MCP 工具，类型始终为 mcp。
          enum:
            - mcp
          x-stainless-const: true
        server_label:
          type: string
          description: 要使用的 MCP 服务器标签。
        name:
          type: string
          description: 要在服务器上调用的工具名称。
      required:
        - type
        - server_label
    ToolChoiceCustom:
      type: object
      description: 使用此选项强制模型调用特定的自定义工具。
      properties:
        type:
          type: string
          description: 对于自定义工具调用，类型始终为 custom。
          enum:
            - custom
          x-stainless-const: true
        name:
          type: string
          description: 要调用的自定义工具名称。
      required:
        - type
        - name
    Prompt:
      type: string
      description: 用于生成或指导模型响应的提示文本。这是发送给模型的主要指令或问题。
      example: 请解释一下机器学习的基本概念
    EasyInputMessage:
      type: object
      title: 输入消息
      description: >-
        模型的消息输入，其角色指示指令遵循层次结构。使用 `developer` 或 `system` 角色给出的指令优先于使用 `user`
        角色给出的指令。具有 `assistant` 角色的消息被假定为在先前的交互中由模型生成。
      properties:
        role:
          type: string
          description: 消息输入的角色。`user`、`assistant`、`system` 或 `developer` 之一。
          enum:
            - user
            - assistant
            - system
            - developer
        content:
          description: 模型的文本、图像或音频输入，用于生成响应。也可以包含先前的助手响应。
          anyOf:
            - 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
      title: 输入项
      description: 表示响应生成上下文的一部分的项。可以包含文本、图像和音频输入，以及之前的助手响应和工具调用输出。
      properties:
        type:
          type: string
          description: 项的类型。
      anyOf:
        - $ref: '#/components/schemas/InputMessage'
        - $ref: '#/components/schemas/OutputMessage'
        - $ref: '#/components/schemas/FileSearchToolCall'
        - $ref: '#/components/schemas/ComputerToolCall'
        - $ref: '#/components/schemas/ComputerCallOutputItemParam'
        - $ref: '#/components/schemas/WebSearchToolCall'
        - $ref: '#/components/schemas/FunctionToolCall'
        - $ref: '#/components/schemas/FunctionCallOutputItemParam'
        - $ref: '#/components/schemas/ReasoningItem'
        - $ref: '#/components/schemas/ImageGenToolCall'
        - $ref: '#/components/schemas/CodeInterpreterToolCall'
        - $ref: '#/components/schemas/LocalShellToolCall'
        - $ref: '#/components/schemas/LocalShellToolCallOutput'
        - $ref: '#/components/schemas/MCPListTools'
        - $ref: '#/components/schemas/MCPApprovalRequest'
        - $ref: '#/components/schemas/MCPApprovalResponse'
        - $ref: '#/components/schemas/MCPToolCall'
        - $ref: '#/components/schemas/CustomToolCallOutput'
        - $ref: '#/components/schemas/CustomToolCall'
    ItemReferenceParam:
      type: object
      title: 项引用
      description: 对现有项的引用。
      properties:
        type:
          type: string
          enum:
            - item_reference
          description: 引用类型。始终为 'item_reference'。
        id:
          type: string
          description: 引用的项的ID。
      required:
        - type
        - id
    OutputMessage:
      type: object
      title: 输出消息
      description: 来自模型的输出消息。
      properties:
        id:
          type: string
          description: 输出消息的唯一ID。
        type:
          type: string
          description: 输出消息的类型。始终为 `message`。
          enum:
            - message
        role:
          type: string
          description: 输出消息的角色。始终为 `assistant`。
          enum:
            - assistant
        content:
          type: array
          description: 输出消息的内容。
          items:
            $ref: '#/components/schemas/OutputMessageContent'
        status:
          type: string
          description: >-
            消息输入的状态。可以是 `in_progress`、`completed` 或 `incomplete`
            之一。通过API返回输入项时填充。
          enum:
            - in_progress
            - completed
            - incomplete
      required:
        - id
        - type
        - role
        - content
        - status
    FileSearchToolCall:
      type: object
      title: 文件搜索工具调用
      description: 文件搜索工具调用的结果。更多信息请参阅文件搜索指南。
      properties:
        id:
          type: string
          description: 文件搜索工具调用的唯一ID。
        type:
          type: string
          enum:
            - file_search_call
          description: 文件搜索工具调用的类型。始终为 `file_search_call`。
        status:
          type: string
          description: >-
            文件搜索工具调用的状态。可以是 `in_progress`、`searching`、`incomplete` 或 `failed`
            之一。
          enum:
            - in_progress
            - searching
            - completed
            - incomplete
            - failed
        queries:
          type: array
          items:
            type: string
          description: 用于搜索文件的查询。
        results:
          anyOf:
            - type: array
              description: 文件搜索工具调用的结果。
              items:
                type: object
                properties:
                  file_id:
                    type: string
                    description: 文件的唯一ID。
                  text:
                    type: string
                    description: 从文件中检索的文本。
                  file_name:
                    type: string
                    description: 文件的名称。
                  file_type:
                    type: string
                    description: 文件的类型。
                  score:
                    type: number
                    description: 搜索结果的相关性分数。
                  location:
                    type: object
                    properties:
                      start:
                        type: integer
                        description: 检索文本在文件中的起始位置。
                      end:
                        type: integer
                        description: 检索文本在文件中的结束位置。
                    description: 检索文本在文件中的位置。
            - type: 'null'
      required:
        - id
        - type
        - status
    FunctionToolCall:
      type: object
      title: 函数工具调用
      description: 运行函数的工具调用。更多信息请参阅函数调用指南。
      properties:
        id:
          type: string
          description: 函数工具调用的唯一ID。
        type:
          type: string
          enum:
            - function_call
          description: 函数工具调用的类型。始终为 `function_call`。
        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: 网络搜索工具调用
      description: 网络搜索工具调用的结果。更多信息请参阅网络搜索指南。
      properties:
        id:
          type: string
          description: 网络搜索工具调用的唯一ID。
        type:
          type: string
          enum:
            - web_search_call
          description: 网络搜索工具调用的类型。始终为 `web_search_call`。
        status:
          type: string
          description: 网络搜索工具调用的状态。
          enum:
            - in_progress
            - searching
            - completed
            - failed
        action:
          type: object
          description: 描述此网络搜索调用中采取的特定操作的对象。包括有关模型如何使用网络（搜索、打开页面、查找）的详细信息。
          properties:
            type:
              type: string
              description: 网络搜索操作的类型。
      required:
        - id
        - type
        - status
        - action
    ComputerToolCall:
      type: object
      title: 计算机工具调用
      description: 计算机使用工具的工具调用。更多信息请参阅计算机使用指南。
      properties:
        type:
          type: string
          description: 计算机调用的类型。始终为 `computer_call`。
          enum:
            - computer_call
          default: computer_call
        id:
          type: string
          description: 计算机调用的唯一ID。
        call_id:
          type: string
          description: 响应工具调用时使用的标识符。
        action:
          type: object
          description: 计算机操作，如点击、双击、拖动、按键等。
          properties:
            type:
              type: string
              description: 操作类型。
        pending_safety_checks:
          type: array
          items:
            type: object
            description: 计算机调用的待处理安全检查。
            properties:
              id:
                type: string
                description: 待处理安全检查的ID。
              code:
                type: string
                description: 待处理安全检查的类型。
              message:
                type: string
                description: 关于待处理安全检查的详细信息。
            required:
              - id
              - code
              - message
          description: 计算机调用的待处理安全检查。
        status:
          type: string
          description: 项的状态。可以是 `in_progress`、`completed` 或 `incomplete` 之一。通过API返回项时填充。
          enum:
            - in_progress
            - completed
            - incomplete
      required:
        - type
        - id
        - action
        - call_id
        - pending_safety_checks
        - status
    ReasoningItem:
      type: object
      title: 推理
      description: >-
        推理模型在生成响应时使用的思维链的描述。如果您正在手动管理上下文，请确保在后续对话轮次中将这些项目包含在您对Responses
        API的`input`中。
      properties:
        type:
          type: string
          description: 对象的类型。始终为 `reasoning`。
          enum:
            - reasoning
        id:
          type: string
          description: 推理内容的唯一标识符。
        encrypted_content:
          anyOf:
            - type: string
              description: 推理项的加密内容 - 当使用`include`参数中的`reasoning.encrypted_content`生成响应时填充。
            - type: 'null'
        summary:
          type: array
          description: 推理摘要内容。
          items:
            $ref: '#/components/schemas/Summary'
        content:
          type: array
          description: 推理文本内容。
          items:
            $ref: '#/components/schemas/ReasoningTextContent'
        status:
          type: string
          description: 项的状态。可以是 `in_progress`、`completed` 或 `incomplete` 之一。通过API返回项时填充。
          enum:
            - in_progress
            - completed
            - incomplete
      required:
        - type
        - id
    ImageGenToolCall:
      type: object
      title: 图像生成调用
      description: 模型发出的图像生成请求。
      properties:
        type:
          type: string
          enum:
            - image_generation_call
          description: 图像生成调用的类型。始终为 `image_generation_call`。
        id:
          type: string
          description: 图像生成调用的唯一ID。
        status:
          type: string
          enum:
            - in_progress
            - completed
            - generating
            - failed
          description: 图像生成调用的状态。
        result:
          anyOf:
            - type: string
              description: Base64编码的生成图像。
            - type: 'null'
      required:
        - type
        - id
        - status
        - result
    CodeInterpreterToolCall:
      type: object
      title: 代码解释器工具调用
      description: 运行代码的工具调用。
      properties:
        type:
          type: string
          enum:
            - code_interpreter_call
          default: code_interpreter_call
          description: 代码解释器工具调用的类型。始终为 `code_interpreter_call`。
        id:
          type: string
          description: 代码解释器工具调用的唯一ID。
        status:
          type: string
          enum:
            - in_progress
            - completed
            - incomplete
            - interpreting
            - failed
          description: >-
            代码解释器工具调用的状态。有效值为
            `in_progress`、`completed`、`incomplete`、`interpreting` 和 `failed`。
        container_id:
          type: string
          description: 用于运行代码的容器的ID。
        code:
          anyOf:
            - type: string
              description: 要运行的代码，如果不可用则为null。
            - type: 'null'
        outputs:
          anyOf:
            - type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: 输出类型。
              description: 代码执行的输出。
            - type: 'null'
      required:
        - type
        - id
        - status
    LocalShellToolCall:
      type: object
      title: 本地Shell调用
      description: 在本地Shell上运行命令的工具调用。
      properties:
        type:
          type: string
          enum:
            - local_shell_call
          description: 本地Shell调用的类型。始终为 `local_shell_call`。
        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`。
        id:
          type: string
          description: 工具调用的唯一ID。
        server_label:
          type: string
          description: 运行工具的MCP服务器的标签。
        name:
          type: string
          description: 运行的工具的名称。
        arguments:
          type: string
          description: 传递给工具的参数的JSON字符串。
        output:
          anyOf:
            - type: string
              description: 工具调用的输出。
            - type: 'null'
        error:
          anyOf:
            - type: string
              description: 工具调用的错误（如果有）。
            - type: 'null'
      required:
        - type
        - id
        - server_label
        - name
        - arguments
    MCPListTools:
      type: object
      title: MCP工具列表
      description: MCP服务器上可用工具的列表。
      properties:
        type:
          type: string
          enum:
            - mcp_list_tools
          description: 项的类型。始终为 `mcp_list_tools`。
        id:
          type: string
          description: 列表的唯一ID。
        server_label:
          type: string
          description: MCP服务器的标签。
        tools:
          type: array
          items:
            $ref: '#/components/schemas/MCPListToolsTool'
          description: 服务器上可用的工具。
        error:
          anyOf:
            - type: string
              description: 如果服务器无法列出工具，则为错误消息。
            - type: 'null'
      required:
        - type
        - id
        - server_label
        - tools
    MCPApprovalRequest:
      type: object
      title: MCP审批请求
      description: 工具调用的人工审批请求。
      properties:
        type:
          type: string
          enum:
            - mcp_approval_request
          description: 项的类型。始终为 `mcp_approval_request`。
        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
    CustomToolCall:
      type: object
      title: 自定义工具调用
      description: 模型创建的对自定义工具的调用。
      properties:
        type:
          type: string
          enum:
            - custom_tool_call
          description: 自定义工具调用的类型。始终为 `custom_tool_call`。
        id:
          type: string
          description: OpenAI平台中自定义工具调用的唯一ID。
        call_id:
          type: string
          description: 用于将此自定义工具调用映射到工具调用输出的标识符。
        name:
          type: string
          description: 被调用的自定义工具的名称。
        input:
          type: string
          description: 由模型生成的自定义工具调用的输入。
      required:
        - type
        - call_id
        - name
        - input
    ReasoningEffort:
      anyOf:
        - type: string
          enum:
            - minimal
            - low
            - medium
            - high
          default: medium
          description: >-
            限制推理模型的推理努力程度。当前支持的值有 `minimal`、`low`、`medium` 和
            `high`。减少推理努力可以导致更快的响应和在响应中使用更少的推理token。
        - type: 'null'
    HostedTool:
      type: object
      description: 指示模型应使用内置工具来生成响应。了解更多关于内置工具的信息。
      properties:
        type:
          type: string
          description: 模型应使用的托管工具类型。了解更多关于内置工具的信息。
          enum:
            - file_search
            - web_search_preview
            - computer_use_preview
            - code_interpreter
            - image_generation
      required:
        - type
    InputMessageContentList:
      type: array
      title: 输入项目内容列表
      description: 模型的一个或多个输入项目的列表，包含不同的内容类型。
      items:
        $ref: '#/components/schemas/InputContent'
    InputMessage:
      type: object
      title: 输入消息
      description: >-
        带有角色的模型输入消息，指示指令遵循层次结构。使用 `developer` 或 `system` 角色给出的指令优先于使用 `user`
        角色给出的指令。
      properties:
        type:
          type: string
          description: 消息输入的类型。始终设置为 `message`。
          enum:
            - message
        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:
          type: array
          title: 输入项内容列表
          description: 包含不同内容类型的模型输入项列表。
          items:
            $ref: '#/components/schemas/InputContent'
      required:
        - type
        - role
        - content
    ComputerCallOutputItemParam:
      type: object
      title: 计算机调用输出项参数
      description: 计算机工具调用的输出。
      properties:
        type:
          type: string
          description: 计算机调用输出的类型。始终为 `computer_call_output`。
          enum:
            - computer_call_output
          default: computer_call_output
        call_id:
          type: string
          description: 与此输出关联的计算机调用的ID。
        output:
          type: object
          description: 计算机调用的输出。
          properties:
            type:
              type: string
              description: 输出类型。
        status:
          type: string
          description: 项的状态。可以是 `in_progress`、`completed` 或 `incomplete` 之一。通过API返回项时填充。
          enum:
            - in_progress
            - completed
            - incomplete
      required:
        - type
        - call_id
        - output
    FunctionCallOutputItemParam:
      type: object
      title: 函数调用输出项参数
      description: 函数工具调用的输出。
      properties:
        id:
          anyOf:
            - type: string
              description: 函数工具调用输出的唯一ID。通过API返回此项时填充。
              example: fc_123
            - 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
        output:
          description: 函数工具调用的文本、图像或文件输出。
          anyOf:
            - type: string
              maxLength: 10485760
              description: 函数工具调用输出的JSON字符串。
      required:
        - call_id
        - type
        - output
    LocalShellToolCallOutput:
      type: object
      title: 本地Shell调用输出
      description: 本地Shell工具调用的输出。
      properties:
        type:
          type: string
          enum:
            - local_shell_call_output
          description: 本地Shell工具调用输出的类型。始终为 `local_shell_call_output`。
        id:
          type: string
          description: 由模型生成的本地Shell工具调用的唯一ID。
        call_id:
          type: string
          description: 本地Shell工具调用的唯一ID。
        output:
          type: string
          description: 本地Shell工具调用输出的JSON字符串。
        status:
          anyOf:
            - type: string
              enum:
                - in_progress
                - completed
                - incomplete
              description: 项的状态。可以是 `in_progress`、`completed` 或 `incomplete` 之一。
            - type: 'null'
      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`。
        id:
          anyOf:
            - type: string
              description: 审批响应的唯一ID。
            - type: 'null'
        approval_request_id:
          type: string
          description: 正在回答的审批请求的ID。
        approve:
          type: boolean
          description: 请求是否被批准。
        reason:
          anyOf:
            - type: string
              description: 决定的可选原因。
            - type: 'null'
      required:
        - type
        - approval_request_id
        - approve
    CustomToolCallOutput:
      type: object
      title: 自定义工具调用输出
      description: 从您的代码发送回模型的自定义工具调用的输出。
      properties:
        type:
          type: string
          enum:
            - custom_tool_call_output
          description: 自定义工具调用输出的类型。始终为 `custom_tool_call_output`。
        id:
          type: string
          description: OpenAI平台中自定义工具调用输出的唯一ID。
        call_id:
          type: string
          description: 调用ID，用于将此自定义工具调用输出映射到自定义工具调用。
        output:
          description: 由您的代码生成的自定义工具调用的输出。可以是字符串或输出内容列表。
          anyOf:
            - type: string
              description: 自定义工具调用输出的字符串。
              title: 字符串输出
            - type: array
              items:
                $ref: '#/components/schemas/FunctionAndCustomToolCallOutput'
              title: 输出内容列表
              description: 自定义工具调用的文本、图像或文件输出。
      required:
        - type
        - call_id
        - output
    OutputMessageContent:
      discriminator:
        propertyName: type
      anyOf:
        - $ref: '#/components/schemas/OutputTextContent'
        - $ref: '#/components/schemas/RefusalContent'
    Summary:
      type: object
      title: 摘要文本
      description: 来自模型的摘要文本。
      properties:
        type:
          type: string
          enum:
            - summary_text
          description: 对象的类型。始终为 `summary_text`。
          default: summary_text
        text:
          type: string
          description: 模型到目前为止的推理输出的摘要。
      required:
        - type
        - text
    ReasoningTextContent:
      type: object
      title: 推理文本
      description: 来自模型的推理文本。
      properties:
        type:
          type: string
          enum:
            - reasoning_text
          description: 推理文本的类型。始终为 `reasoning_text`。
          default: reasoning_text
        text:
          type: string
          description: 来自模型的推理文本。
      required:
        - type
        - text
    LocalShellExecAction:
      type: object
      title: 本地Shell执行操作
      description: 在服务器上执行Shell命令。
      properties:
        type:
          type: string
          enum:
            - exec
          description: 本地Shell操作的类型。始终为 `exec`。
        command:
          type: array
          items:
            type: string
          description: 要运行的命令。
        timeout_ms:
          anyOf:
            - type: integer
              description: 命令的可选超时时间（毫秒）。
            - type: 'null'
      required:
        - type
        - command
    MCPListToolsTool:
      type: object
      title: MCP工具列表工具
      description: MCP服务器上可用的工具。
      properties:
        name:
          type: string
          description: 工具的名称。
        description:
          anyOf:
            - type: string
              description: 工具的描述。
            - type: 'null'
        input_schema:
          type: object
          description: 描述工具输入的JSON模式。
        annotations:
          anyOf:
            - type: object
              description: 关于工具的其他注释。
            - type: 'null'
      required:
        - name
        - input_schema
    InputContent:
      anyOf:
        - $ref: '#/components/schemas/InputTextContent'
        - $ref: '#/components/schemas/InputImageContent'
        - $ref: '#/components/schemas/InputFileContent'
        - $ref: '#/components/schemas/InputAudio'
      discriminator:
        propertyName: type
    FunctionAndCustomToolCallOutput:
      discriminator:
        propertyName: type
      anyOf:
        - $ref: '#/components/schemas/InputTextContent'
        - $ref: '#/components/schemas/InputImageContent'
        - $ref: '#/components/schemas/InputFileContent'
    OutputTextContent:
      type: object
      title: 输出文本内容
      description: 来自模型的文本输出。
      properties:
        type:
          type: string
          enum:
            - output_text
          description: 输出文本的类型。始终为 `output_text`。
          default: output_text
        text:
          type: string
          description: 来自模型的文本输出。
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/Annotation'
          description: 文本输出的注释。
        logprobs:
          type: array
          items:
            $ref: '#/components/schemas/LogProb'
      required:
        - type
        - text
    RefusalContent:
      type: object
      title: 拒绝内容
      description: 来自模型的拒绝。
      properties:
        type:
          type: string
          enum:
            - refusal
          description: 拒绝的类型。始终为 `refusal`。
          default: refusal
        refusal:
          type: string
          description: 来自模型的拒绝解释。
      required:
        - type
        - refusal
    InputTextContent:
      properties:
        type:
          type: string
          enum:
            - input_text
          description: 输入项的类型。始终为 `input_text`。
          default: input_text
        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
        image_url:
          anyOf:
            - type: string
              description: 要发送到模型的图像的URL。完全限定的URL或数据URL中的base64编码图像。
            - type: 'null'
        file_id:
          anyOf:
            - type: string
              description: 要发送到模型的文件的ID。
            - type: 'null'
      type: object
      required:
        - type
      title: 输入图像
      description: 输入到模型的图像。
    InputFileContent:
      properties:
        type:
          type: string
          enum:
            - input_file
          description: 输入项的类型。始终为 `input_file`。
          default: input_file
        file_id:
          anyOf:
            - type: string
              description: 要发送到模型的文件的ID。
            - type: 'null'
        filename:
          type: string
          description: 要发送到模型的文件的名称。
        file_url:
          type: string
          description: 要发送到模型的文件的URL。
      type: object
      required:
        - type
      title: 输入文件
      description: 输入到模型的文件。
    InputAudio:
      type: object
      title: 输入音频
      description: 音频输入。
      properties:
        type:
          type: string
          description: 输入类型。始终为 'audio'。
          enum:
            - audio
        audio:
          type: object
          properties:
            data:
              type: string
              description: Base64编码的音频数据。
            format:
              type: string
              description: 音频格式。
              enum:
                - mp3
                - wav
          required:
            - data
            - format
      required:
        - type
        - audio
    Annotation:
      title: 注释
      description: 文本输出的注释。
      discriminator:
        propertyName: type
      anyOf:
        - $ref: '#/components/schemas/FileCitationBody'
        - $ref: '#/components/schemas/UrlCitationBody'
        - $ref: '#/components/schemas/ContainerFileCitationBody'
        - $ref: '#/components/schemas/FilePath'
    LogProb:
      type: object
      title: 对数概率
      description: token的对数概率信息。
      properties:
        token:
          type: string
          description: Token文本。
        logprob:
          type: number
          description: Token的对数概率。
        bytes:
          type: array
          items:
            type: integer
          description: Token的字节表示。
        top_logprobs:
          type: array
          items:
            type: object
            properties:
              token:
                type: string
              logprob:
                type: number
              bytes:
                type: array
                items:
                  type: integer
          description: 该位置最可能的token及其对数概率。
    FileCitationBody:
      type: object
      title: 文件引用
      description: 对文件的引用。
      properties:
        type:
          type: string
          enum:
            - file_citation
          description: 文件引用的类型。始终为 `file_citation`。
          default: file_citation
        file_id:
          type: string
          description: 文件的ID。
        index:
          type: integer
          description: 文件在文件列表中的索引。
        filename:
          type: string
          description: 被引用文件的文件名。
      required:
        - type
        - file_id
        - index
        - filename
    UrlCitationBody:
      type: object
      title: URL引用
      description: 对用于生成模型响应的Web资源的引用。
      properties:
        type:
          type: string
          enum:
            - url_citation
          description: URL引用的类型。始终为 `url_citation`。
          default: url_citation
        url:
          type: string
          description: Web资源的URL。
        start_index:
          type: integer
          description: URL引用在消息中第一个字符的索引。
        end_index:
          type: integer
          description: URL引用在消息中最后一个字符的索引。
        title:
          type: string
          description: Web资源的标题。
      required:
        - type
        - url
        - start_index
        - end_index
        - title
    ContainerFileCitationBody:
      type: object
      title: 容器文件引用
      description: 对用于生成模型响应的容器文件的引用。
      properties:
        type:
          type: string
          enum:
            - container_file_citation
          description: 容器文件引用的类型。始终为 `container_file_citation`。
          default: container_file_citation
        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: 被引用容器文件的文件名。
      required:
        - type
        - container_id
        - file_id
        - start_index
        - end_index
        - filename
    FilePath:
      type: object
      title: 文件路径
      description: 文件的路径。
      properties:
        type:
          type: string
          description: 文件路径的类型。始终为 `file_path`。
          enum:
            - file_path
        file_id:
          type: string
          description: 文件的ID。
        index:
          type: integer
          description: 文件在文件列表中的索引。
      required:
        - type
        - file_id
        - index
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        ModelHub API密钥认证。在 `Authorization` HTTP Header 中包含您的 API-Key，格式为 `Bearer
        {API_KEY}`

````