1. 模型模块
模型网关
  • 未命名文档
  • 模型模块
    • 添加模型配置
      POST
    • 获取模型配置
      GET
    • 更改模型配置
      PUT
    • 获取模型列表
      GET
    • 模型类型列表
      GET
    • 运营商列表
      GET
    • 删除模型配置
      DELETE
    • 更改会话模型
      POST
    • 获取会话模型
      GET
  • 任务模块
    • 构建消息
      POST
    • 创建任务
      POST
    • 批量查询任务
      POST
    • 查看任务结果
      GET
    • 批量查询异步任务
      GET
  1. 模型模块

添加模型配置

开发中
开发环境
http://127.0.0.1:3004
开发环境
http://127.0.0.1:3004
POST
http://127.0.0.1:3004
/model/createModel
最后修改时间:2026-07-06 05:06:58

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Body 参数application/json必填

示例
{
  "modelName": "doubao-seed-2-0-lite-260428-fb", // 模型名称(唯一标识)
  "operatorName": "火山引擎", // 运营商名称
  "modelType": 100, // 模型类型(100=推理模型,600+视频模型)
  "baseUrl": "https://ark.cn-beijing.volces.com/api/v3/chat/completions", // 模型服务地址
  "httpMethod": "POST", // 请求方式 GET/POST
  "headMsg": { // 请求头JSON结构
    "Content-Type": "application/json",
    "Authorization": "Bearer ark-xxx"
  },
  "isPrivate": 1, // 是否私有化:0-私有 1-公共
  "enabled": 1, // 是否启用:0-停用 1-启用
  "isChatModel": 1, // 是否为对话模型:0-否 1-是
  "callMode": 0, // 调用模式:0-同步 1-异步 2-流式
  "apiKey": "ark-xxx", // 调用凭证/密钥
  "form": [ // 动态表单配置(实际对接按照给我传递的参数再决定逻辑)
    {
      "key": "model",
      "type": "string",
      "label": "模型名称",
      "required": true,
      "defaultValue": "doubao-seed-2-0-lite-260428"
    },
    {
      "key": "messages.0.content.0.text",
      "type": "string",
      "label": "用户提示词",
      "required": true,
      "fieldConstraint": {
        "maxLength": 100000
      }
    }
  ],
  "responseMapping": { // 返回映射(其中content,total_tokens,prompt_tokens,completion_tokens前端定死)
    "content": "choices.0.message.content", //必填
    "total_tokens": "usage.total_tokens", //非必填
    "prompt_tokens": "usage.prompt_tokens", //非必填
    "completion_tokens": "usage.completion_tokens" //非必填
  },
  "queryConfig": { // 异步调用 查询/回调配置
    "url": "",
    "method": "GET",
    "task_id": "id",
    "status_path": "status",
    "status_values": {
      "succeeded": "succeeded",
      "failed": "failed"
    },
    "interval_seconds": 2
  },
  "streamConfig": {
    "enabled": true, // [固定] 是否启用
    "stream_to_client": false, // [固定] 是否透传流式数据
    "output_type": "text", // [固定] text / audio / image
    "events": [
      {
        "type": "concat", // [固定] concat / base64_concat / collect / final
        "aggregate_to": "content", // [固定] 结果字段名
        "match": "chat.completion.chunk", // [自定义] 匹配chunk的type值
        "order_by": "", // [自定义] 排序字段,collect用
        "fields": { // key固定,value自定义
          "content": "choices.0.delta.content"
        }
      }
    ]
  },
  "specialParams": { // 请求特殊参数(首尾帧等,其中first_frame,last_frame前端定死)
    "first_frame": "content.0.image_url.url",
    "last_frame": "content.1.image_url.url"
  },
  "maxConcurrency": 100, // 最大并发数(默认10)
  "timeoutSeconds": 1200, // 请求超时时间(秒,默认600)
  "retryTimes": 3 // 失败重试次数(默认3)
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location 'http://127.0.0.1:3004/model/createModel' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
  "modelName": "doubao-seed-2-0-lite-260428-fb", // 模型名称(唯一标识)
  "operatorName": "火山引擎", // 运营商名称
  "modelType": 100, // 模型类型(100=推理模型,600+视频模型)
  "baseUrl": "https://ark.cn-beijing.volces.com/api/v3/chat/completions", // 模型服务地址
  "httpMethod": "POST", // 请求方式 GET/POST
  "headMsg": { // 请求头JSON结构
    "Content-Type": "application/json",
    "Authorization": "Bearer ark-xxx"
  },
  "isPrivate": 1, // 是否私有化:0-私有 1-公共
  "enabled": 1, // 是否启用:0-停用 1-启用
  "isChatModel": 1, // 是否为对话模型:0-否 1-是
  "callMode": 0, // 调用模式:0-同步 1-异步 2-流式
  "apiKey": "ark-xxx", // 调用凭证/密钥
  "form": [ // 动态表单配置(实际对接按照给我传递的参数再决定逻辑)
    {
      "key": "model",
      "type": "string",
      "label": "模型名称",
      "required": true,
      "defaultValue": "doubao-seed-2-0-lite-260428"
    },
    {
      "key": "messages.0.content.0.text",
      "type": "string",
      "label": "用户提示词",
      "required": true,
      "fieldConstraint": {
        "maxLength": 100000
      }
    }
  ],
  "responseMapping": { // 返回映射(其中content,total_tokens,prompt_tokens,completion_tokens前端定死)
    "content": "choices.0.message.content", //必填
    "total_tokens": "usage.total_tokens", //非必填
    "prompt_tokens": "usage.prompt_tokens", //非必填
    "completion_tokens": "usage.completion_tokens" //非必填
  },
  "queryConfig": { // 异步调用 查询/回调配置
    "url": "",
    "method": "GET",
    "task_id": "id",
    "status_path": "status",
    "status_values": {
      "succeeded": "succeeded",
      "failed": "failed"
    },
    "interval_seconds": 2
  },
  "streamConfig": {
    "enabled": true, // [固定] 是否启用
    "stream_to_client": false, // [固定] 是否透传流式数据
    "output_type": "text", // [固定] text / audio / image
    "events": [
      {
        "type": "concat", // [固定] concat / base64_concat / collect / final
        "aggregate_to": "content", // [固定] 结果字段名
        "match": "chat.completion.chunk", // [自定义] 匹配chunk的type值
        "order_by": "", // [自定义] 排序字段,collect用
        "fields": { // key固定,value自定义
          "content": "choices.0.delta.content"
        }
      }
    ]
  },
  "specialParams": { // 请求特殊参数(首尾帧等,其中first_frame,last_frame前端定死)
    "first_frame": "content.0.image_url.url",
    "last_frame": "content.1.image_url.url"
  },
  "maxConcurrency": 100, // 最大并发数(默认10)
  "timeoutSeconds": 1200, // 请求超时时间(秒,默认600)
  "retryTimes": 3 // 失败重试次数(默认3)
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "code": 0,
    "message": "OK",
    "data": {
        "id": "2047599564411637760"
    }
}
修改于 2026-07-06 05:06:58
上一页
未命名文档
下一页
获取模型配置
Built with