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

# 创建 LLM 模型

> 创建一个新的大语言模型。模型必须关联到一个已存在的供应商。



## OpenAPI

````yaml /openapi/service-api-zh.json post /api/v1/provider/models/llm
openapi: 3.0.3
info:
  title: LangBot Service API
  description: |
    LangBot 外部服务 API 文档。这些接口支持 API 密钥认证，供外部系统以编程方式访问 LangBot 资源。

    **认证方式：**
    - 用户令牌（通过 `Authorization: Bearer <token>`）
    - API 密钥（通过 `X-API-Key: <key>` 或 `Authorization: Bearer <key>`）

    本文档中的所有接口都同时支持这两种认证方式（除特别说明外）。
  version: 4.9.5
  contact:
    name: LangBot
    url: https://langbot.app
  license:
    name: AGPL-3.0
    url: https://github.com/langbot-app/LangBot/blob/master/LICENSE
servers:
  - url: http://localhost:5300
    description: 本地开发服务器
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: 模型供应商
    description: 模型供应商管理。供应商定义了 API 地址和密钥，模型通过 provider_uuid 关联到供应商。
  - name: 大语言模型
    description: 大语言模型 (LLM) 管理。每个模型关联到一个供应商。
  - name: 向量模型
    description: 向量模型 (Embedding) 管理。每个模型关联到一个供应商。
  - name: 机器人
    description: 机器人实例管理及消息发送
  - name: 流水线
    description: 流水线（Pipeline）配置管理
  - name: 知识库
    description: 知识库管理操作
  - name: 知识引擎
    description: 知识引擎（插件提供）的查询
  - name: 解析器
    description: 文件解析器（插件提供）的查询
  - name: 文件
    description: 文件上传操作
  - name: 插件
    description: 插件安装、配置和管理
  - name: 系统
    description: 系统信息（无需认证）
paths:
  /api/v1/provider/models/llm:
    post:
      tags:
        - 大语言模型
      summary: 创建 LLM 模型
      description: 创建一个新的大语言模型。模型必须关联到一个已存在的供应商。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LLMModelCreate'
      responses:
        '200':
          description: 创建成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                  data:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
components:
  schemas:
    LLMModelCreate:
      type: object
      required:
        - name
        - provider_uuid
      properties:
        name:
          type: string
          description: 模型名称（即模型 ID）
          example: gpt-4o
        provider_uuid:
          type: string
          format: uuid
          description: 关联的供应商 UUID
        abilities:
          type: array
          items:
            type: string
          example:
            - chat
            - vision
        extra_args:
          type: object
        prefered_ranking:
          type: integer
          default: 0
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````