字段名 | 描述 |
---|---|
id | 超体ID |
create_time | 创建时间 |
update_time | 更新时间 |
sort | 超体排序 |
ext1 | 扩展字段 |
ext2 | 扩展字段 |
ext3 | 扩展字段 |
name | 超体名称 |
type | 超体类型 |
user_id | 用户ID |
server_id | 启动超体节点ID |
config | 设备配置;具体参考官方文档 |
超体管理接口
1844字约6分钟
2025-04-10
使用超体管理接口可以进行查询超体列表
、添加超体
、更新超体
、删除超体
等。
查询超体列表
适用对象: 第三方服务端请求
请求URL: https://api.espai2.fun/equipment/list
请求方式: POST
请求参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
name | string | 否 | 超体名称 |
type | string | 否 | 超体类型;0:AI对话 |
enable | string | 否 | 是否启用;0:不启用,1:启用 |
page | string | 否 | 分页查询当前页;默认当前第1页 |
limit | string | 否 | 分页查询查询条数;默认查询9999条 |
注意:当所有参数都不传时,默认查询当前用户下的所有超体,返回超体列表。
参数示例:
{
"name": "琳琅",
"type": "0",
"enable": "1",
"page": "1",
"limit": "10"
}
返回参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
success | boolean | 是 | 结果标识;true:成功,false:请求失败 |
message | string | 是 | 返回的消息;例如:请求成功 或其他异常信息 |
data | array | 是 | 返回的数据列表 |
超体信息:
字段名 | 描述 |
---|---|
api_key | 设备的api_key |
cdkey_id | 额度卡ID |
enable | 是否启用超体 |
model_id | 模型ID;001:树晓晓(默认),7f0e5bd2ca3e4553a1f011b07c2960bb:艾米 |
cdkey_name | 额度卡兑换码 |
api_limit | 剩余调度额度 |
cdkey_type | 额度卡类型 |
server_ip | 节点IP |
server_port | 节点端口 |
model_name | 模型名称 |
model_path | 模型路径 |
file_name | 模型文件名称 |
返回示例:
{
"success": true,
"message": "请求成功",
"data": [
{
"id": "679f9af935e047639ddb98f35e103e8f",
"sort": 99,
"create_time": 1744180100787,
"update_time": 1744189426664,
"ext1": null,
"ext2": null,
"ext3": null,
"name": "琳琅",
"type": "0",
"user_id": "87215a4192654cea8781a1a596d23cae",
"server_id": "0aadd1d790cf410892fb9459d5d5cb74",
"config": "{\"iat_server\":\"esp-ai-asr-volcengine\",\"iat_config\":{\"clusterId\":\"volcengine_streaming_common\"},\"tts_server\":\"esp-ai-tts-volcengine\",\"tts_config\":{\"voice_type\":\"ICL_zh_female_jiaoruoluoli_tob\"},\"llm_server\":\"esp-ai-llm\",\"llm_config\":{\"model\":\"qwen2.5:7b\",\"api_key\":\"7b131bi418f94c788033i225dc00i1d0\"},\"llm_init_messages\":[{\"role\":\"system\",\"content\":\"你是东星帮的乌鸦哥,你要用乌鸦哥的语气和用户聊天。\"}],\"connected_reply\":\"服务连接成功。\"}",
"api_key": "设备的api_key",
"cdkey_id": "772868ead56c48d68fd1924aa5ec3aac",
"enable": "1",
"model_id": "001",
"cdkey_name": "wNaa1GDw",
"api_limit": 61,
"cdkey_type": "0",
"server_ip": "xxx.xxx.xxx.xxx",
"server_port": 8080,
"model_name": "艾米",
"model_path": "/models/amy/",
"file_name": "model.glb"
}
]
}
错误示例:
{
"success": false,
"message": "系统错误:xxx",
"code": 500
}
代码示例:
Nodejs
const axios = require('axios');
// 定义请求头部
const headers = {
'authorization': 'esp_ai平台的32位open_api_key',
'Content-Type': 'application/json'
};
// 定义要发送的数据
const data = {
"name": "琳琅",
"type": "0",
"enable": "1",
"page": "1",
"limit": "10"
};
// 发送POST请求
axios.post('https://api.espai2.fun/equipment/list', data, {headers})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
添加超体
适用对象: 第三方服务端请求
请求URL: https://api.espai2.fun/equipment/add
请求方式: POST
请求参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
cdkey_id | string | 是 | 额度卡ID |
name | string | 是 | 超体名称 |
type | string | 是 | 超体类型;0:AI对话(默认填0) |
enable | string | 否 | 是否启用;0:不启用(默认),1:启用 |
model_id | string | 否 | 模型ID;001:树晓晓(默认),7f0e5bd2ca3e4553a1f011b07c2960bb:艾米 |
sort | string | 否 | 超体排序,默认99 |
server_id | string | 否 | 启动超体节点ID,默认:0aadd1d790cf410892fb9459d5d5cb74 |
copy | string | 否 | 其他超体ID |
参数示例:
{
"cdkey_id": "772868ead56c48d68fd1924aa5ec3aac",
"name": "琳琅1",
"type": "0",
"enable": "1",
"copy": "679f9af935e047639ddb98f35e103e8f",
"model_id": "001",
"sort": "99"
}
返回参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
success | boolean | 是 | 结果标识;true:成功,false:请求失败 |
message | string | 是 | 返回的消息;例如:新增成功 或其他异常信息 |
data | json | 是 | 返回的超体数据,参考超体信息 |
返回示例:
{
"success": true,
"message": "新增成功",
"data": {
"id": "ab6ed07786074f4896d7fbeb9194d08a",
"sort": "99",
"create_time": 1744282066227,
"api_key": "设备的api_key",
"name": "琳琅1",
"type": "0",
"user_id": "87215a4192654cea8781a1a596d23cae",
"server_id": "0aadd1d790cf410892fb9459d5d5cb74",
"enable": "1",
"cdkey_id": "772868ead56c48d68fd1924aa5ec3aac",
"model_id": "001",
"config": "{\"iat_server\":\"esp-ai-asr-volcengine\",\"iat_config\":{\"clusterId\":\"volcengine_streaming_common\"},\"tts_server\":\"esp-ai-tts-volcengine\",\"tts_config\":{\"voice_type\":\"ICL_zh_female_jiaoruoluoli_tob\"},\"llm_server\":\"esp-ai-llm\",\"llm_config\":{\"model\":\"qwen2.5:7b\",\"api_key\":\"7b131bi418f94c788033i225dc00i1d0\"},\"llm_init_messages\":[{\"role\":\"system\",\"content\":\"你是东星帮的乌鸦哥,你要用乌鸦哥的语气和用户聊天。\"}],\"connected_reply\":\"服务连接成功。\"}",
"cdkey_name": "wNaa1GDw",
"api_limit": 61,
"cdkey_type": "0",
"server_ip": "xxx.xxx.xxx.xx",
"server_port": 8080,
"model_name": "树晓晓",
"model_path": "./models/",
"file_name": "giry3.glb"
}
}
错误示例:
{
"success": false,
"message": "系统错误:xxx",
"code": 500
}
{
"success": false,
"message": "额度卡不存在"
}
代码示例:
Nodejs
const axios = require('axios');
// 定义请求头部
const headers = {
'authorization': 'esp_ai平台的32位open_api_key',
'Content-Type': 'application/json'
};
// 定义要发送的数据
const data = {
"cdkey_id": "772868ead56c48d68fd1924aa5ec3aac",
"name": "琳琅1",
"type": "0",
"enable": "1",
"copy": "679f9af935e047639ddb98f35e103e8f",
"model_id": "001",
"sort": "99"
};
// 发送POST请求
axios.post('https://api.espai2.fun/equipment/add', data, {headers})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
更新超体
适用对象: 第三方服务端请求
请求URL: https://api.espai2.fun/equipment/update
请求方式: POST
请求参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
id | string | 是 | 超体ID |
name | string | 否 | 超体名称 |
cdkey_id | string | 否 | 额度卡ID |
type | string | 否 | 超体类型;0:AI对话 |
enable | string | 否 | 是否启用;0:不启用,1:启用 |
model_id | string | 否 | 模型ID;001:树晓晓(默认),7f0e5bd2ca3e4553a1f011b07c2960bb:艾米 |
sort | string | 否 | 超体排序 |
server_id | string | 否 | 启动超体节点ID,默认填:0aadd1d790cf410892fb9459d5d5cb74 |
config | string | 否 | 设备配置;具体参考官方文档 |
参数示例:
{
"id": "e1eebb0275cd48e1a34f8cd7ecd30441",
"name": "琳琅1",
"cdkey_id": "772868ead56c48d68fd1924aa5ec3aac",
"type": "0",
"enable": "1",
"model_id": "001",
"sort": "99",
"server_id": "0aadd1d790cf410892fb9459d5d5cb74",
"config": {
"iat_server": "esp-ai-asr-volcengine",
"iat_config": {
"api_key": "7b131bi418f94c788033i225dc00i1d0",
"clusterId": "volcengine_streaming_common"
},
"tts_server": "esp-ai-tts-volcengine",
"tts_config": {
"api_key": "7b131bi418f94c788033i225dc00i1d0",
"voice_type": "zh_female_wanwanxiaohe_moon_bigtts"
},
"llm_server": "esp-ai-llm-volcengine",
"llm_config": {
"api_key": "7b131bi418f94c788033i225dc00i1d0",
"epId": "ep-20250215214941-l969g"
},
"llm_init_messages": [
{
"content": "你是小明同学,你要书本中小明同学的语气和用户聊天。",
"id": "214562",
"role": "system"
}
],
"connected_reply": "服务连接成功。"
}
}
返回参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
success | boolean | 是 | 结果标识;true:成功,false:请求失败 |
message | string | 是 | 返回的消息;例如:修改成功 或其他异常信息 |
data | json | 是 | 返回的已变更的数据 |
返回示例:
{
"success": true,
"message": "修改成功",
"data": {
"name": "琳琅1",
"type": "0",
"cdkey_id": "772868ead56c48d68fd1924aa5ec3aac",
"enable": "1",
"model_id": "001",
"config": "{\"iat_server\":\"esp-ai-asr-volcengine\",\"iat_config\":{\"api_key\":\"7b131bi418f94c788033i225dc00i1d0\",\"clusterId\":\"volcengine_streaming_common\"},\"tts_server\":\"esp-ai-tts-volcengine\",\"tts_config\":{\"api_key\":\"7b131bi418f94c788033i225dc00i1d0\",\"voice_type\":\"zh_female_wanwanxiaohe_moon_bigtts\"},\"llm_server\":\"esp-ai-llm-volcengine\",\"llm_config\":{\"api_key\":\"7b131bi418f94c788033i225dc00i1d0\",\"epId\":\"ep-20250215214941-l969g\"},\"llm_init_messages\":[{\"content\":\"你是小明同学,你要书本中小明同学的语气和用户聊天。\",\"id\":\"214562\",\"role\":\"system\"}],\"connected_reply\":\"服务连接成功。\"}",
"sort": "1",
"update_time": 1744281119753
}
}
错误示例:
{
"success": false,
"message": "系统错误:xxx",
"code": 500
}
{
"success": false,
"message": "额度卡不存在"
}
代码示例:
Nodejs
const axios = require('axios');
// 定义请求头部
const headers = {
'authorization': 'esp_ai平台的32位open_api_key',
'Content-Type': 'application/json'
};
// 设备配置信息
const config = {
"iat_server": "esp-ai-asr-volcengine",
"iat_config": {
"api_key": "7b131bi418f94c788033i225dc00i1d0",
"clusterId": "volcengine_streaming_common"
},
"tts_server": "esp-ai-tts-volcengine",
"tts_config": {
"api_key": "7b131bi418f94c788033i225dc00i1d0",
"voice_type": "zh_female_wanwanxiaohe_moon_bigtts"
},
"llm_server": "esp-ai-llm-volcengine",
"llm_config": {
"api_key": "7b131bi418f94c788033i225dc00i1d0",
"epId": "ep-20250215214941-l969g"
},
"llm_init_messages": [
{
"content": "你是小明同学,你要书本中小明同学的语气和用户聊天。",
"id": "214562",
"role": "system"
}
],
"connected_reply": "服务连接成功。"
}
// 定义要发送的数据
const data = {
"id": "e1eebb0275cd48e1a34f8cd7ecd30441",
"name": "琳琅1",
"cdkey_id": "772868ead56c48d68fd1924aa5ec3aac",
"type": "0",
"enable": "1",
"model_id": "001",
"sort": "99",
"server_id": "0aadd1d790cf410892fb9459d5d5cb74",
"config": JSON.stringify(config)
};
// 发送POST请求
axios.post('https://api.espai2.fun/equipment/update', data, {headers})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
删除超体
适用对象: 第三方服务端请求
请求URL: https://api.espai2.fun/equipment/del
请求方式: POST
请求参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
id | string | 是 | 超体ID |
参数示例:
[
{
"id": "ab6ed07786074f4896d7fbeb9194d08a"
}
]
返回参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
success | boolean | 是 | 结果标识;true:成功,false:请求失败 |
message | string | 是 | 返回的消息;例如:删除成功 或其他异常信息 |
返回示例:
{
"success": true,
"message": "删除成功"
}
错误示例:
{
"success": false,
"message": "系统错误:xxx",
"code": 500
}
代码示例:
Nodejs
const axios = require('axios');
// 定义请求头部
const headers = {
'authorization': 'esp_ai平台的32位open_api_key',
'Content-Type': 'application/json'
};
// 定义要发送的数据
const data = [{"id": "ab6ed07786074f4896d7fbeb9194d08a"}];
// 发送POST请求
axios.post('https://api.espai2.fun/equipment/del', data, {headers})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});