模型管理/创建模型。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
aicontent:ModelRouterCreateModel |
create |
*全部资源
|
无 | 无 |
请求语法
POST /api/v1/modelRouter/open/models HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| body |
object |
否 |
请求 body 参数 |
|
| name |
string |
否 |
模型名称 |
通义千问 |
| description |
string |
否 |
模型描述 |
通义千问大模型 |
| symbol |
string |
否 |
厂商 symbol |
alibaba |
| tags |
string |
否 |
标签,逗号分隔 |
TXT_GEN,DEEP_THINK |
| modelId |
string |
否 |
模型标识 |
qwen-turbo |
| modelType |
string |
否 |
模型类型 |
Chat |
| apiKey |
string |
否 |
API Key |
sk-xxxx |
| baseUrl |
string |
否 |
Base URL |
https://dashscope.aliyuncs.com |
| maxInputLength |
string |
否 |
最大输入长度 |
32K |
| maxOutputLength |
string |
否 |
最大输出长度 |
8K |
| inOut |
string |
否 |
描述模型支持的输入和输出数据类型 |
text |
| extensions |
string |
否 |
模型的扩展配置参数,以 JSON 字符串存储 |
{} |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
OpenApiSingleResponse |
{ "success": true, "data": {"id": 1, "name": "gpt-4", "type": "chat"}, "requestId": "592A27EF-26D3-1434-98C1-97AD63337852" } |
|
| requestId |
string |
请求编号 |
xxxx-xxxx-xxxx-xxxxxxxx |
| success |
boolean |
是否成功 |
true |
| errCode |
string |
错误信息编码 |
UNKNOWN_ERROR |
| errMessage |
string |
错误信息 |
未知错误 |
| httpStatusCode |
integer |
http 状态码 |
200 |
| data | ModelDTO |
数据对象 |
[] |
示例
正常返回示例
JSON格式
{
"requestId": "xxxx-xxxx-xxxx-xxxxxxxx",
"success": true,
"errCode": "UNKNOWN_ERROR",
"errMessage": "未知错误",
"httpStatusCode": 200,
"data": {
"id": 1,
"name": "通义千问",
"description": "通义千问大模型",
"symbol": "alibaba",
"tags": "chat,NLP",
"modelCode": "qwen-turbo",
"modelType": "Chat",
"apiKeyPreview": "sk-xxx****xxx",
"baseUrl": "https://dashscope.aliyuncs.com",
"maxInputLength": "8192",
"maxOutputLength": "2048",
"isCustom": false,
"tagNames": "对话,自然语言处理",
"deleteTag": 0,
"gmtCreate": "2024-01-01T00:00:00Z",
"gmtModified": "2024-01-01T00:00:00Z",
"version": 0,
"hasBillingRule": false,
"inOut": "",
"extensions": ""
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 500 | Server.Internal.UnknownError | The request processing has failed due to some unknown error. | |
| 403 | B.Permission.DeniedException | 鉴权失败或权限不足 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。