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

# GPT-5.2 - 完整参数文档

> - 使用 OpenAI SDK 格式调用 GPT-5.2 模型
- 同步处理模式，实时返回对话内容
- **纯文本对话**：单轮或多轮上下文对话
- **系统提示词**：自定义 AI 的角色和行为
- **多模态输入**：支持文本 + 图像混合输入
- 💡 快速上手？查看 [快速开始文档](./gpt-5.2-quickstart)

<Note>
  **BaseURL 说明**：默认 BaseURL 为 `https://direct.evolink.ai`，对文本模型支持更好，支持长连接；`https://api.evolink.ai` 是多模态主力地址，对文本模型作为备用地址使用。
</Note>


## OpenAPI

````yaml cn/api-manual/language-series/gpt-5.2/gpt-5.2-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: GPT-5.2 完整参数文档
  description: GPT-5.2 对话接口的完整 API 参考，包含所有参数和高级功能
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 生产环境（推荐）
  - url: https://api.evolink.ai
    description: 备用地址
security:
  - bearerAuth: []
tags:
  - name: 对话生成
    description: AI对话生成相关接口
paths:
  /v1/chat/completions:
    post:
      tags:
        - 对话生成
      summary: GPT-5.2 对话接口
      description: |-
        - 使用 OpenAI SDK 格式调用 GPT-5.2 模型
        - 同步处理模式，实时返回对话内容
        - **纯文本对话**：单轮或多轮上下文对话
        - **系统提示词**：自定义 AI 的角色和行为
        - **多模态输入**：支持文本 + 图像混合输入
        - 💡 快速上手？查看 [快速开始文档](./gpt-5.2-quickstart)
      operationId: createChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple_text:
                summary: 单轮文本对话
                value:
                  model: gpt-5.2
                  messages:
                    - role: user
                      content: 请介绍一下你自己
              multi_turn:
                summary: 多轮对话（上下文理解）
                value:
                  model: gpt-5.2
                  messages:
                    - role: user
                      content: 什么是Python？
                    - role: assistant
                      content: Python是一种高级编程语言...
                    - role: user
                      content: 它有什么优点？
              system_prompt:
                summary: 使用系统提示词
                value:
                  model: gpt-5.2
                  messages:
                    - role: system
                      content: 你是一个专业的Python编程助手，用简洁的语言回答问题。
                    - role: user
                      content: 如何读取文件？
              vision:
                summary: 多模态输入（文本 + 图像）
                value:
                  model: gpt-5.2
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: 请详细描述这张图片中的场景和主要元素。
                        - type: image_url
                          image_url:
                            url: https://example.com/image.png
              multi_image:
                summary: 多图片输入
                value:
                  model: gpt-5.2
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: 对比这两张图片的区别
                        - type: image_url
                          image_url:
                            url: https://example.com/image1.png
                        - type: image_url
                          image_url:
                            url: https://example.com/image2.png
      responses:
        '200':
          description: 对话生成成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 400
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未认证、Token无效或过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: 配额不足、需要充值
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota_error
                  fallback_suggestion: https://evolink.ai/dashboard/billing
        '403':
          description: 无权限访问
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Access denied for this model
                  type: permission_error
                  param: model
        '404':
          description: 资源不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Specified model not found
                  type: not_found_error
                  param: model
                  fallback_suggestion: gpt-5.2
        '413':
          description: 请求体过大
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Image file too large
                  type: request_too_large_error
                  param: content
                  fallback_suggestion: compress image to under 10MB
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  type: rate_limit_error
                  fallback_suggestion: retry after 60 seconds
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: Internal server error
                  type: internal_server_error
                  fallback_suggestion: try again later
        '502':
          description: 上游服务错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Upstream AI service unavailable
                  type: upstream_error
                  fallback_suggestion: try different model
        '503':
          description: 服务暂时不可用
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: 对话模型名称
          enum:
            - gpt-5.2
          default: gpt-5.2
          example: gpt-5.2
        messages:
          type: array
          description: 对话消息列表，支持多轮对话和多模态输入（文本、图片）
          items:
            $ref: '#/components/schemas/Message'
          minItems: 1
        stream:
          type: boolean
          description: |-
            是否以流式方式返回响应

            - `true`: 流式返回，逐块实时返回内容
            - `false`: 等待完整响应后一次性返回
          example: false
        temperature:
          type: number
          description: |-
            采样温度，控制输出的随机性

            **说明**:
            - 较低值(如 0.2): 更确定、更聚焦的输出
            - 较高值(如 1.5): 更随机、更有创意的输出
          minimum: 0
          maximum: 2
          example: 0.7
        top_p:
          type: number
          description: |-
            核采样(Nucleus Sampling)参数

            **说明**:
            - 控制从累积概率前多少的token中采样
            - 例如 0.9 表示从累积概率达到90%的token中选择
            - 默认值: 1.0（考虑所有token）

            **建议**: 不要同时调整 temperature 和 top_p
          minimum: 0
          maximum: 1
          example: 0.9
        top_k:
          type: integer
          description: |-
            Top-K 采样参数

            **说明**:
            - 例如 10 表示限制每次采样时只考虑概率最高的 10 个 token
            - 较小的值会使输出更加聚焦
            - 默认不限制
          minimum: 1
          example: 40
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 对话完成的唯一标识符
          example: chatcmpl-20251010015944503180122WJNB8Eid
        model:
          type: string
          description: 实际使用的模型名称
          example: gpt-5.2
        object:
          type: string
          enum:
            - chat.completion
          description: 响应类型
          example: chat.completion
        created:
          type: integer
          description: 创建时间戳
          example: 1760032810
        choices:
          type: array
          description: 对话生成的选择列表
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP状态错误代码
            message:
              type: string
              description: 错误描述信息
            type:
              type: string
              description: 错误类型
            param:
              type: string
              description: 相关参数名称
            fallback_suggestion:
              type: string
              description: 错误时的建议
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: |-
            消息角色

            - `user`: 用户消息
            - `assistant`: AI助手消息（用于多轮对话）
            - `system`: 系统提示词（设定AI的角色和行为）
          enum:
            - user
            - assistant
            - system
          example: user
        content:
          type: array
          description: |-
            消息内容。支持两种格式：

            **1. 纯文本字符串**：可直接传入字符串，如 `"content":"请介绍一下自己"`

            **2. 对象数组**（支持文本输入、多模态输入）：见下方示例结构
          items:
            $ref: '#/components/schemas/ContentPart'
    Choice:
      type: object
      properties:
        index:
          type: integer
          description: 选择的索引
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          description: 完成原因
          enum:
            - stop
            - length
            - content_filter
          example: stop
    Usage:
      type: object
      description: Token 使用统计信息
      properties:
        prompt_tokens:
          type: integer
          description: 输入内容的 token 数量
          example: 13
        completion_tokens:
          type: integer
          description: 输出内容的 token 数量
          example: 1891
        total_tokens:
          type: integer
          description: 总 token 数量
          example: 1904
        prompt_tokens_details:
          type: object
          description: 输入 token 详细信息
          properties:
            cached_tokens:
              type: integer
              description: 击中缓存的 token 数量
              example: 0
            text_tokens:
              type: integer
              description: 文本 token 数量
              example: 13
            audio_tokens:
              type: integer
              description: 音频 token 数量
              example: 0
            image_tokens:
              type: integer
              description: 图像 token 数量
              example: 0
        completion_tokens_details:
          type: object
          description: 输出 token 详细信息
          properties:
            text_tokens:
              type: integer
              description: 文本 token 数量
              example: 0
            audio_tokens:
              type: integer
              description: 音频 token 数量
              example: 0
            reasoning_tokens:
              type: integer
              description: 推理 token 数量
              example: 1480
        input_tokens:
          type: integer
          description: 输入 token 数量（兼容字段）
          example: 0
        output_tokens:
          type: integer
          description: 输出 token 数量（兼容字段）
          example: 0
        input_tokens_details:
          type: object
          nullable: true
          description: 输入 token 详细信息（兼容字段）
          example: null
    ContentPart:
      oneOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/ImageContent'
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 消息发送者的角色
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AI 回复的消息内容
          example: >-
            你好！我是 GPT-5.2，拥有更强的推理和理解能力。我在处理复杂问题、多步骤推理和代码生成方面表现出色。\n\n主要特点包括：\n-
            更强的逻辑推理能力\n- 更好的上下文理解\n- 更准确的代码生成
    TextContent:
      title: 文本内容
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          description: 内容类型
        text:
          type: string
          description: 文本内容
          example: 请详细描述这张图片
    ImageContent:
      title: 图像内容
      type: object
      required:
        - type
        - image_url
      properties:
        type:
          type: string
          enum:
            - image_url
          description: 内容类型
        image_url:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
              description: |-
                图像URL地址

                **限制**:
                - 单张图片最大: `10MB`
                - 支持格式: `.jpeg`, `.jpg`, `.png`, `.webp`
                - URL要求: 必须公网可访问，一般以图片扩展名结尾
              example: https://example.com/image.png
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##所有接口均需要使用Bearer Token进行认证##

        **获取 API Key：**

        访问 [API Key 管理页面](https://evolink.ai/dashboard/keys) 获取您的 API Key

        **使用时在请求头中添加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````