Base URL:http://localhost:{{PORT}}
无
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | 服务唯一标识,格式 name|version,用于 /api/model/call 的 model 参数 |
| functions[].name | string | 功能名称,用于 /api/model/call 的 function 参数 |
| functions[].args | string[] | 调用时 param 对象的顶层参数字段名,对应 param.字段名 |
| functions[].param | object[] | 调用时 param.param 的参数定义列表,每项含 name/title/type/defaultValue 等 |
{
"code": 0,
"data": [
{
"id": "aigcpanel-server-tts|1.0.0",
"name": "aigcpanel-server-tts",
"version": "1.0.0",
"title": "语音合成",
"functions": [
{
"name": "soundTts",
"args": ["text"],
"param": [
{ "name": "speaker", "title": "发音人", "type": "select", "defaultValue": "", "options": [...] }
]
},
{
"name": "soundClone",
"args": ["text", "promptAudio", "promptText"],
"param": []
}
]
},
{
"id": "aigcpanel-server-sd|1.2.0",
"name": "aigcpanel-server-sd",
"version": "1.2.0",
"title": "图像生成",
"functions": [
{
"name": "textToImage",
"args": ["prompt"],
"param": [
{ "name": "width", "title": "宽度", "type": "inputNumber", "defaultValue": 512 },
{ "name": "height", "title": "高度", "type": "inputNumber", "defaultValue": 512 }
]
}
]
}
]
}
| 字段 | 类型 | 说明 |
|---|---|---|
| model*必填 | string | 服务标识,格式为 name|version,来自 /api/model/list 的 id 字段 |
| function*必填 | string | 调用的功能名称,来自 functions[].name |
| param*必填 | object | 功能参数对象,顶层字段来自 functions[].args,嵌套 param 字段来自 functions[].param |
| param.<arg> | any | 各 args 字段直接放在 param 顶层,如 text、prompt、audio 等 |
| param.param | object | 动态参数对象,字段定义来自 functions[].param,key 为各项的 name |
{
"model": "aigcpanel-server-tts|1.0.0",
"function": "soundTts",
"param": {
"text": "你好,欢迎使用 AigcPanel",
"param": { "speaker": "zh-CN-XiaoxiaoNeural" }
}
}
{
"model": "aigcpanel-server-sd|1.2.0",
"function": "textToImage",
"param": {
"prompt": "a beautiful landscape, 4k",
"param": { "width": 512, "height": 512, "steps": 20 }
}
}
{
"code": 0,
"data": { "taskId": "lz3k8m2abc1" }
}
| 字段 | 类型 | 说明 |
|---|---|---|
| taskId*必填 | string | 由 /api/model/call 返回的任务 ID |
{ "code": 0, "data": { "status": "pending" } }
{
"code": 0,
"data": {
"status": "success",
"result": {
"type": "success",
"start": 1714300000000,
"end": 1714300005000,
"data": { "url": "/path/to/output.wav" }
}
}
}
{ "code": 0, "data": { "status": "error", "error": "错误信息" } }