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

# EvoLink Auto - 智能模型路由

> 系统自动选择最合适的模型处理请求

## 智能模型路由

EvoLink Auto 是智能模型路由功能，系统会根据您的请求内容自动选择合适的 AI 模型，无需手动指定具体模型。

### 核心优势

* **智能匹配**：自动分析请求内容，选择合适的模型处理
* **成本优化**：在保证质量的前提下，优先选择性价比高的模型
* **负载均衡**：自动在多个模型间分配请求，提高系统稳定性
* **透明可见**：响应中返回实际使用的模型名称，方便追踪和优化

### 工作原理

系统根据请求的复杂度、长度和类型，在模型池中选择最适配的模型进行处理。

### 支持的模型

EvoLink Auto 会在以下模型之间智能路由：GPT-4、GPT-3.5、Claude、Gemini 等主流 AI 模型。

### 使用限制

* 不适用于需要指定特定模型能力的场景（如必须使用 GPT-4 的视觉功能）
* 不保证每次请求使用相同的模型

### 使用场景

适用于不确定使用哪个模型，或希望系统自动优化模型选择的场景。

<Note>
  只需将 `model` 参数设置为 `evolink/auto`，系统将自动为您选择合适的模型。
</Note>

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


## OpenAPI

````yaml cn/api-manual/language-series/evolink-auto/evolink-auto-quickstart.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: EvoLink Auto - 智能模型选择
  description: 智能模型路由功能，系统自动选择最合适的 AI 模型
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 生产环境（推荐）
  - url: https://api.evolink.ai
    description: 备用地址
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      tags:
        - 智能路由
      summary: 智能模型路由
      description: 系统自动选择最合适的模型处理请求
      operationId: createChatCompletionAuto
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutoRequest'
      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 feature
                  type: permission_error
        '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 again later
        '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:
    AutoRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: 使用智能路由
          enum:
            - evolink/auto
          default: evolink/auto
          example: evolink/auto
        messages:
          type: array
          description: 对话消息列表
          items:
            $ref: '#/components/schemas/MessageInput'
          minItems: 1
          example:
            - role: user
              content: 介绍一下人工智能的发展历史
        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
        stream:
          type: boolean
          description: |-
            是否以流式方式返回响应

            - `true`: 流式返回，逐块实时返回内容
            - `false`: 等待完整响应后一次性返回
          default: false
          example: false
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 对话完成的唯一标识符
          example: chatcmpl-20260308112637503180122ABCD1234
        model:
          type: string
          description: 实际使用的模型名称
          example: gpt-5.4
        object:
          type: string
          enum:
            - chat.completion
          description: 响应类型
          example: chat.completion
        created:
          type: integer
          description: 创建时间戳
          example: 1741428397
        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: 错误时的建议
    MessageInput:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: 消息角色
          enum:
            - system
            - user
            - assistant
        content:
          type: string
          description: 消息内容
    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: 15
        completion_tokens:
          type: integer
          description: 输出内容的 token 数量
          example: 120
        total_tokens:
          type: integer
          description: 总 token 数量
          example: 135
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          description: 消息发送者的角色
          enum:
            - assistant
          example: assistant
        content:
          type: string
          description: AI 回复的消息内容
          example: 人工智能的发展历史可以追溯到20世纪50年代...
  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
        ```
      bearerFormat: sk-evo-xxxxxxxxxx

````