REST API文档

AI 管理

百度模块

查看所有百度实例的信息

  • 请求 URL/api/baidus
  • 请求方式GET
  • Body 信息:无
  • 返回值
[
  {
    "name": "baidu",
    "deleted_at": "",
    "disabled": 1,
    "description": "",
    "updated_at": "2022-05-17 12:20:56",
    "created_at": "2022-05-17 12:20:56",
    "id": 1
  }
]
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/baidus

查看指定百度实例的详细信息

  • 请求 URL/api/baidus/:id
  • 请求方式GET
  • Body 信息:无
  • 返回值
{
	"disabled":	0,
	"params":	[{
			"disabled":	"0",
			"realm":	"BAIDU-TTS",
			"deleted_at":	"",
			"ref_id":	"1",
			"k":	"token-url",
			"updated_at":	"2025-09-03 01:42:53",
			"created_at":	"2025-09-03 01:42:53",
			"id":	"883",
			"v":	"https://openapi.baidu.com/oauth/2.0/token"
		}, {
			"disabled":	"0",
			"realm":	"BAIDU-TTS",
			"deleted_at":	"",
			"ref_id":	"1",
			"k":	"tts-url",
			"updated_at":	"2025-09-03 01:42:53",
			"created_at":	"2025-09-03 01:42:53",
			"id":	"884",
			"v":	"http://tsn.baidu.com//text2audio"
		}
    ...
    ],
	"name":	"baidu",
	"updated_at":	"2025-09-03 01:42:52",
	"description":	"default",
	"created_at":	"2025-09-03 01:42:52",
	"id":	1,
	"deleted_at":	""
}

创建百度实例

  • 请求 URL/api/baidus
  • 请求方式POST
  • Body 信息
参数说明
namebaidu profile 名称
descriptionbaidu profile 描述
template模板,默认模板:"default"
{
  "name": "test",
  "description": "test",
  "template": "default"
}
  • 返回值
{
  "code": 200,
  "data": 2,
  "message": "success"
}
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"name": "test","description": "test","template": "default"}' 192.168.1.100:8081/api/baidus

修改指定百度实例的名称和描述

  • 请求 URL/api/baidus/$id
  • 请求方式PUT
  • Body 信息
参数说明
namebaidu profile 名称
descriptionbaidu profile 描述
idprofile ID
{
  "name": "baidu",
  "description": "百度模块",
  "id": "1"
}
  • 返回值
{
  "data": "1",
  "message": "success",
  "code": 200
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"name": "baidu","description": "百度模块","id": "1"}' 192.168.1.100:8081/api/baidus/1

创建指定百度实例中 TTS 和 ASR 参数

  • 请求 URL/api/baidus/$id/params
  • 请求方式POST
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
// TTS参数
{
	"k": "text1",
	"realm": "BAIDU-TTS",
	"v": "t1"
}

//ASR参数
{
	"k": "text2",
	"realm": "BAIDU-ASR",
	"v": "t2"
}
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": 1574
}
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "text1","v": "t1","realm": "BAIDU-TTS"}' 192.168.1.100:8081/api/baidus/1/params

修改指定百度实例中 TTS 或 ASR 参数

  • 请求 URL/api/baidus/$id/params/$param_id
  • 请求方式PUT
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
{
  "k": "token-url",
  "realm": "BAIDU-TTS",
  "v": "https://openapi.baidu.com/oauth/2.0/token"
}
  • 返回值
{
  "message": "success",
  "data": "1574",
  "code": 200
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "token-url","v": "https://openapi.baidu.com/oauth/2.0/token","realm": "BAIDU-TTS"}' 192.168.1.100:8081/api/baidus/1/params/1574

启用/禁用指定百度实例中 TTS 或 ASR 参数

  • 请求 URL/api/baidus/$id/params/$param_id
  • 请求方式PUT
  • Body 信息
参数说明
action变更启用状态,固定为"toggle"
{
  "action": "toggle"
}
  • 返回值
{
  "message": "success",
  "data": "1574",
  "code": 200
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"action": "toggle"}' 192.168.1.100:8081/api/baidus/1/params/1574

删除指定百度实例中 TTS 或 ASR 参数

  • 请求 URL/api/baidus/$id/params/$params_id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "1"
}
  • curl 示例
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/baidus/1/params/1

删除指定百度实例

  • 请求 URL/api/baidus/$id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "message": "success",
  "data": "2",
  "code": 200
}
  • curl 示例
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/baidus/2

"阿里"、"华为"、"讯飞"、"腾讯"、"思必驰"、"微软 Azure"、"阶跃"模块

在 AI 接口中,对于"阿里","华为","讯飞","腾讯","思必驰","微软 Azure","阶跃"模块,调用接口参数一致,URL 进行调整:

  • 阿里:https://192.168.3.222/api/ali_profiles
  • 华为:https://192.168.3.222/api/huawei_profiles
  • 讯飞:https://192.168.3.222/api/xunfei_profiles
  • 腾讯:https://192.168.3.222/api/tencent_profiles
  • 思必驰:https://192.168.3.222/api/aispeech_profiles
  • 微软 Azure:https://192.168.3.222/api/azure_profiles
  • 阶跃:https://192.168.3.222/api/stepfun_profiles
各模块对应的 realm说明
阿里ALI-SETTINGS ALI-TTS ALI-ASR ALI-BL-TTS ALI-BL-ASR
华为HUAWEI-SETTINGS HUAWEI-TTS HUAWEI-ASR
讯飞XUNFEI-SETTINGS XUNFEI-TTS XUNFEI-ASR XUNFEI-MVAD
腾讯TENCENT-ASR-WS TENCENT-ASR-REST TENCENT-TTS-WS TENCENT-TTS-REST
思必驰AISPEECH-SETTINGS AISPEECH-TTS AISPEECH-ASR
微软 AzureAZURE-TTS AZURE-ASR
阶跃STEPFUN-TTS-REST STEPFUN-TTS-WS STEPFUN-ASR

以阿里模块为例:

查看阿里实例列表

  • 请求 URL/api/ali_profiles
  • 请求方式GET
  • Body 信息:无
  • 返回值
[
  {
		"updated_at":	"2025-09-03 01:42:52",
		"deleted_at":	"",
		"created_at":	"2025-09-03 01:42:52",
		"id":	1,
		"description":	"default",
		"disabled":	0,
		"name":	"ali"
	}
]
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/ali_profiles

查看指定阿里实例的详细信息

  • 请求 URL/api/ali_profiles/:id
  • 请求方式GET
  • Body 信息:无
  • 返回值
{
	"created_at":	"2025-09-03 01:42:52",
	"params":	[{
			"deleted_at":	"",
			"id":	"713",
			"disabled":	"0",
			"created_at":	"2025-09-03 01:42:53",
			"ref_id":	"1",
			"v":	"http://nls-meta.cn-shanghai.aliyuncs.com/",
			"updated_at":	"2025-09-03 01:42:53",
			"k":	"token-url",
			"realm":	"ALI-SETTINGS"
		}, {
			"deleted_at":	"",
			"id":	"714",
			"disabled":	"0",
			"created_at":	"2025-09-03 01:42:53",
			"ref_id":	"1",
			"v":	"cn-shanghai",
			"updated_at":	"2025-09-03 01:42:53",
			"k":	"region",
			"realm":	"ALI-SETTINGS"
		}
    ...
    ],
	"deleted_at":	"",
	"updated_at":	"2025-09-03 01:42:52",
	"description":	"default",
	"id":	1,
	"name":	"ali",
	"disabled":	0
}

创建阿里实例

  • 请求 URL/api/ali_profiles
  • 请求方式POST
  • Body 信息
参数说明
nameali profile 名称
descriptionali profile 描述
template模板,默认模板:"default"
{
  "name": "test",
  "description": "test",
  "template": "default"
}
  • 返回值
{
  "code": 200,
  "data": 2,
  "message": "success"
}
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"name": "test","description": "test","template": "default"}' 192.168.1.100:8081/api/ali_profiles

修改阿里实例名称和描述

  • 请求 URL/api/ali_profiles/$id
  • 请求方式PUT
  • Body 信息
参数说明
nameali profile 名称
descriptionali profile 描述
idprofile ID
{
  "name": "ali",
  "description": "阿里实例",
  "id": "1"
}
  • 返回值
{
  "data": "1",
  "message": "success",
  "code": 200
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"name": "ali","description": "阿里实例","id": "1"}' 192.168.1.100:8081/api/ali_profiles/1

启用/禁用阿里实例

  • 请求 URL/api/ali_profiles/toggle/:id
  • 请求方式PUT
  • Body 信息
{
  "action": "aliyun"
}
  • 返回值
{
	"data":	[{
			"id":	1,
			"description":	"default",
			"name":	"ali",
			"disabled":	1,
			"deleted_at":	"",
			"updated_at":	"2025-09-03 02:53:43",
			"created_at":	"2025-09-03 01:42:52"
		}, {
			"id":	2,
			"description":	"",
			"name":	"text11",
			"disabled":	0,
			"deleted_at":	"",
			"updated_at":	"2025-09-03 02:53:43",
			"created_at":	"2025-09-03 02:34:22"
		}],
	"message":	"success",
	"code":	200
}

创建阿里实例中参数

  • 请求 URL/api/ali_profiles/$id/params
  • 请求方式POST
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
// Settings参数
{
	"k": "text1",
	"realm": "ALI-SETTINGS",
	"v": "t1"
}

// TTS参数
{
	"k": "text1",
	"realm": "ALI-TTS",
	"v": "t1"
}

//ASR参数
{
	"k": "text2",
	"realm": "ALI-ASR",
	"v": "t2"
}

//BaiLian TTS参数
{
	"k": "text3",
	"realm": "ALI-BL-TTS",
	"v": "t1"
}

//BaiLian ASR参数
{
	"k": "text4",
	"realm": "ALI-BL-ASR",
	"v": "t2"
}
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": 1574
}
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "text1","v": "t1","realm": "ali-TTS"}' 192.168.1.100:8081/api/ali_profiles/1/params

修改阿里实例中参数

  • 请求 URL/api/ali_profiles/$id/params/$param_id
  • 请求方式PUT
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
{
  "k": "token-url",
  "realm": "ALI-TTS",
  "v": "https://nls-gateway.cn-shanghai.aliyuncs.com/stream/v1/tts"
}
  • 返回值
{
  "message": "success",
  "data": "1574",
  "code": 200
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "token-url","v": "https://openapi.ali.com/oauth/2.0/token","realm": "ali-TTS"}' 192.168.1.100:8081/api/ali_profiles/1/params/1574

启用/禁用阿里实例中参数

  • 请求 URL/api/ali_profiles/$id/params/$param_id
  • 请求方式PUT
  • Body 信息
参数说明
action变更启用状态,固定为"toggle"
{
  "action": "toggle"
}
  • 返回值
{
  "message": "success",
  "data": "1574",
  "code": 200
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"action": "toggle"}' 192.168.1.100:8081/api/ali_profiles/1/params/1574

删除阿里实例中参数

  • 请求 URL/api/ali_profiles/$id/params/$params_id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "1"
}
  • curl 示例
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/ali_profiles/1/params/1

删除阿里实例

  • 请求 URL/api/ali_profiles/$id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "message": "success",
  "data": "2",
  "code": 200
}
  • curl 示例
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/ali_profiles/2

MiniMax

查看 MiniMax 的配置

  • 请求 URL/api/minimax_profiles
  • 请求方式GET
  • Body 信息:无
  • 返回值
[
  {
		"id":	1,
		"disabled":	0,
		"deleted_at":	"",
		"description":	"default",
		"created_at":	"2025-09-03 01:42:52",
		"updated_at":	"2025-09-03 01:42:52",
		"name":	"default"
	}
]

查看指定 MiniMax 实例的详细信息

  • 请求 URL/api/minimax_profiles/:id
  • 请求方式GET
  • Body 信息:无
  • 返回值
{
	"params":	[{
			"id":	"2619",
			"created_at":	"2025-09-03 01:42:54",
			"v":	"https://api.minimax.chat/v1/tts/stream",
			"disabled":	"0",
			"ref_id":	"1",
			"deleted_at":	"",
			"k":	"tts-url",
			"realm":	"MINIMAX-TTS",
			"updated_at":	"2025-09-03 01:42:54"
		}, {
			"id":	"2620",
			"created_at":	"2025-09-03 01:42:54",
			"v":	"",
			"disabled":	"0",
			"ref_id":	"1",
			"deleted_at":	"",
			"k":	"token",
			"realm":	"MINIMAX-TTS",
			"updated_at":	"2025-09-03 01:42:54"
		}
    ...
    ],
	"disabled":	0,
	"description":	"default",
	"updated_at":	"2025-09-03 01:42:52",
	"name":	"default",
	"deleted_at":	"",
	"id":	1,
	"created_at":	"2025-09-03 01:42:52"
}

创建 MiniMax 实例

  • 请求 URL/api/minimax_profiles
  • 请求方式POST
  • Body 信息
参数说明
nameMiniMax profile 名称
descriptionMiniMax profile 描述
template模板,默认模板:"default"
{
  "name": "test",
  "description": "test",
  "template": "default",
  "disabled": "1"
}
  • 返回值
{
  "code": 200,
  "data": 2,
  "message": "success"
}

修改指定 MiniMax 实例的名称和描述

  • 请求 URL/api/minimax_profiles/$id
  • 请求方式PUT
  • Body 信息
参数说明
nameMiniMax profile 名称
descriptionMiniMax profile 描述
idprofile ID
{
  "name": "MiniMax",
  "description": "MiniMax实例",
  "id": "1"
}
  • 返回值
{
  "data": "1",
  "message": "success",
  "code": 200
}

启用/禁用指定 MiniMax 实例

  • 请求 URL/api/minimax_profiles/toggle/:id
  • 请求方式PUT
  • Body 信息
{
  "disabled": 0
}
  • 返回值
{
	"message":	"success",
	"code":	200,
	"data":	"4"
}

创建指定 MiniMax 实例中的 TTS 参数

  • 请求 URL/api/minimax_profiles/:id/tts/
  • 请求方式POST
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
{
  "k":"text",
  "v":"text",
  "realm":"MINIMAX-TTS"
}
  • 返回值
{
	"data":	3313,
	"message":	"success",
	"code":	200
}

创建指定 MiniMax 实例中的 TTSV2 参数

  • 请求 URL/api/minimax_profiles/:id/ttsv2/
  • 请求方式POST
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
{
  "k":"text",
  "v":"text",
  "realm":"MINIMAX-TTSV2"
}
  • 返回值
{
	"data":	3314,
	"message":	"success",
	"code":	200
}

创建指定 MiniMax 实例中的 TTSV2 WS 参数

  • 请求 URL/api/minimax_profiles/:id/ttsv2ws/
  • 请求方式POST
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
{
  "k":"text",
  "v":"text",
  "realm":"MINIMAX-TTSV2-WS"
}
  • 返回值
{
	"message":	"success",
	"data":	3316,
	"code":	200
}

修改指定 MiniMax 实例中的指定参数

  • 请求 URL/api/minimax_profiles/$id/tts/$param_id
  • 请求方式PUT
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
{
  "k": "token-url",
  "realm": "MiniMax-TTS",
  "v": "https://api.minimax.chat/v1/tts/stream"
}
  • 返回值
{
  "message": "success",
  "data": "1574",
  "code": 200
}

启用/禁用指定 MiniMax 实例中的指定参数

  • 请求 URL/api/minimax_profiles/$id/params/$param_id
  • 请求方式PUT
  • Body 信息
参数说明
action变更启用状态,固定为"toggle"
{
  "action": "toggle"
}
  • 返回值
{
  "message": "success",
  "data": "1574",
  "code": 200
}

删除指定 MiniMax 实例中的指定参数

  • 请求 URL/api/minimax_profiles/:id/tts/:params_id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "1"
}

删除 MiniMax 实例

  • 请求 URL/api/minimax_profiles/:id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "message": "success",
  "data": "2",
  "code": 200
}

火山引擎

查看火山引擎的实例列表

  • 请求 URL/api/volcengine_profiles
  • 请求方式GET
  • Body 信息:无
  • 返回值
[
  {
		"name":	"default",
		"created_at":	"2025-09-03 01:42:52",
		"description":	"default",
		"updated_at":	"2025-09-03 01:42:52",
		"id":	1,
		"deleted_at":	"",
		"disabled":	0
	}
]

查看指定火山引擎实例的详细信息

  • 请求 URL/api/volcengine_profiles/:id
  • 请求方式GET
  • Body 信息:无
  • 返回值
{
	"disabled":	0,
	"created_at":	"2025-09-03 01:42:52",
	"name":	"default",
	"description":	"default",
	"params":	[{
			"disabled":	"0",
			"created_at":	"2025-09-03 01:42:54",
			"realm":	"VOLCENGINE-TTS",
			"ref_id":	"1",
			"updated_at":	"2025-09-03 01:42:54",
			"deleted_at":	"",
			"v":	"wss://openspeech.bytedance.com/api/v1/tts/ws_binary",
			"k":	"tts-url",
			"id":	"2755"
		}, {
			"disabled":	"0",
			"created_at":	"2025-09-03 01:42:54",
			"realm":	"VOLCENGINE-TTS",
			"ref_id":	"1",
			"updated_at":	"2025-09-03 01:42:54",
			"deleted_at":	"",
			"v":	"volcano_tts",
			"k":	"cluster",
			"id":	"2756"
		}
    ...
    ],
	"updated_at":	"2025-09-03 01:42:52",
	"deleted_at":	"",
	"id":	1
}

创建火山引擎实例

  • 请求 URL/api/volcengine_profiles
  • 请求方式POST
  • Body 信息
参数说明
name火山引擎 profile 名称
description火山引擎 profile 描述
template模板,默认模板:"default"
{
  "name":"text1",
  "description":"text1",
  "template":"default",
  "disabled":"1"
}
  • 返回值
{
  "code": 200,
  "data": 2,
  "message": "success"
}

修改指定火山引擎实例的名称和描述

  • 请求 URL/api/volcengine_profiles/$id
  • 请求方式PUT
  • Body 信息
参数说明
name火山引擎 profile 名称
description火山引擎 profile 描述
idprofile ID
{
  "name": "text",
  "description": "火山引擎实例",
  "id": "1"
}
  • 返回值
{
  "data": "1",
  "message": "success",
  "code": 200
}

启用/禁用火山引擎实例

  • 请求 URL/api/volcengine_profiles/toggle/:id
  • 请求方式PUT
  • Body 信息
{
  "disabled": 0
}
  • 返回值
{
	"message":	"success",
	"code":	200,
	"data":	"1"
}

创建指定火山引擎实例中的 TTS 参数

  • 请求 URL/api/volcengine_profiles/:id/tts/
  • 请求方式POST
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
{
  "k":"text",
  "v":"text",
  "realm":"VOLCENGINE-TTS"
}
  • 返回值
{
	"data":	3334,
	"message":	"success",
	"code":	200
}

修改指定火山引擎实例中的指定参数

  • 请求 URL/api/volcengine_profiles/$id/tts/$param_id
  • 请求方式PUT
  • Body 信息
参数说明
k参数名称
v参数数值
realm参数域
{
  "k": "tts-url",
  "realm": "VOLCENGINE-TTS",
  "v": "wss://openspeech.bytedance.com/api/v1/tts/ws_binary"
}
  • 返回值
{
  "message": "success",
  "data": "1574",
  "code": 200
}

启用/禁用指定火山引擎实例中的指定参数

  • 请求 URL/api/volcengine_profiles/$id/params/$param_id
  • 请求方式PUT
  • Body 信息
参数说明
action变更启用状态,固定为"toggle"
{
  "action": "toggle"
}
  • 返回值
{
  "message": "success",
  "data": "1574",
  "code": 200
}

删除指定火山引擎实例中的参数

  • 请求 URL/api/volcengine_profiles/:id/tts/:params_id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "1"
}

删除指定火山引擎实例

  • 请求 URL/api/volcengine_profiles/:id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "message": "success",
  "data": "2",
  "code": 200
}

AI 机器人

获取 AI 机器人列表

  • 请求 URL/api/ai_robot
  • 请求方式GET
  • 示例GET /api/ai_robot?page=1&perPage=500
  • Body 信息:无
  • 返回值
{
	"rowCount":	1,
	"page":	1,
	"data":	[{
			"domain":	"xswitch.cn",
			"deleted_at":	"",
			"name":	"text",
			"updated_at":	"2025-09-03 06:24:18",
			"created_at":	"2025-09-03 06:24:18",
			"uuid":	"7008553a-55ee-4db7-a45e-cbc93dc36d12",
			"data":	"{\"asr\": {\"asr_model\": \"default\", \"asr_engine\": \"ali\", \"asr_language\": \"ali\"}, \"tts\": {\"tts_voice\": \"aixia\", \"tts_engine\": \"aispeech\"}, \"beep\": true, \"name\": \"text\", \"texts\": {\"hello_text\": \"您好?\", \"goodbye_text\": [\"再见\", \"拜拜\", \"bye\"], \"init_prompts\": \"你是一名AI客服助理。\", \"init_welcome_text\": \"您好我Cherry,有什么可以帮您?\"}, \"domain\": \"xswitch.cn\", \"ai_config\": {\"gpt_token\": \"11\", \"service_model\": \"ChatGPT\"}, \"async_mode\": false, \"break_mode\": false, \"enable_record\": false, \"no_speaking_timeout\": 8}"
		}],
	"pageCount":	1
}

获取指定 AI 机器人详情

  • 请求 URL/api/ai_robot/:uuid
  • 请求方式GET
  • 示例GET /api/ai_robot/7008553a-55ee-4db7-a45e-cbc93dc36d12
  • Body 信息:无
  • 返回值
{
	"code":	200,
	"message":	"success",
	"data":	[{
			"uuid":	"7008553a-55ee-4db7-a45e-cbc93dc36d12",
			"created_at":	"2025-09-03 06:24:18",
			"domain":	"xswitch.cn",
			"updated_at":	"2025-09-03 06:24:18",
			"name":	"text",
			"deleted_at":	"",
			"data":	{
				"asr":	{
					"asr_engine":	"ali",
					"asr_language":	"ali",
					"asr_model":	"default"
				},
				"name":	"text",
				"no_speaking_timeout":	8,
				"domain":	"xswitch.cn",
				"break_mode":	false,
				"texts":	{
					"init_welcome_text":	"您好我Cherry,有什么可以帮您?",
					"goodbye_text":	["再见", "拜拜", "bye"],
					"init_prompts":	"你是一名AI客服助理。",
					"hello_text":	"您好?"
				},
				"beep":	true,
				"tts":	{
					"tts_engine":	"aispeech",
					"tts_voice":	"aixia"
				},
				"ai_config":	{
					"gpt_token":	"11",
					"service_model":	"ChatGPT"
				},
				"enable_record":	false,
				"async_mode":	false
			}
		}]
}

获取指定 AI 机器人关联路由

  • 请求 URL/api/ai_robot/:uuid/routes
  • 请求方式GET
  • 示例GET /api/ai_robot/7008553a-55ee-4db7-a45e-cbc93dc36d12/routes
  • Body 信息:无
  • 返回值
[]

新建 AI 机器人

  • 请求 URL/api/ai_robot
  • 请求方式POST
  • Body 信息
{
    "name": "text1",
    "break_mode": false,
    "no_speaking_timeout": 8,
    "enable_record": false,
    "async_mode": false,
    "beep": true,
    "tts": {
        "tts_engine": "aispeech",
        "tts_voice": "aixia"
    },
    "asr": {
        "asr_engine": "ali",
        "asr_language": "ali",
        "asr_model": "default"
    },
    "ai_config": {
        "service_model": "DouBao",
        "gpt_token": "1"
    },
    "texts": {
        "hello_text": "您好?",
        "init_prompts": "你是一名AI客服助理。",
        "init_welcome_text": "您好我Cherry,有什么可以帮您?",
        "goodbye_text": [
            "再见",
            "拜拜",
            "bye"
        ]
    },
    "domain": "xswitch.cn"
}
  • 返回值
{
	"code":	200,
	"message":	"success",
	"data":	{
		"data":	{
			"no_speaking_timeout":	8,
			"tts":	{
				"tts_voice":	"aixia",
				"tts_engine":	"aispeech"
			},
			"texts":	{
				"goodbye_text":	["再见", "拜拜", "bye"],
				"init_welcome_text":	"您好我Cherry,有什么可以帮您?",
				"hello_text":	"您好?",
				"init_prompts":	"你是一名AI客服助理。"
			},
			"name":	"text1",
			"beep":	true,
			"enable_record":	false,
			"ai_config":	{
				"gpt_token":	"1",
				"service_model":	"DouBao"
			},
			"async_mode":	false,
			"break_mode":	false,
			"domain":	"xswitch.cn",
			"asr":	{
				"asr_language":	"ali",
				"asr_model":	"default",
				"asr_engine":	"ali"
			}
		},
		"deleted_at":	"",
		"created_at":	"2025-09-03 06:46:33",
		"updated_at":	"2025-09-03 06:46:33",
		"domain":	"xswitch.cn",
		"name":	"text1",
		"uuid":	"36b22b26-10e0-4c48-809d-a18fcfdf0530"
	}
}

修改指定 AI 机器人

  • 请求 URL/api/ai_robot/:uuid
  • 请求方式PUT
  • Body 信息
{
    "name": "text2",
    "break_mode": false,
    "no_speaking_timeout": 8,
    "enable_record": false,
    "async_mode": false,
    "beep": true,
    "tts": {
        "tts_engine": "aispeech",
        "tts_voice": "aixia"
    },
    "asr": {
        "asr_engine": "ali",
        "asr_language": "ali",
        "asr_model": "default"
    },
    "ai_config": {
        "service_model": "ChatGPT",
        "gpt_token": "11"
    },
    "texts": {
        "hello_text": "您好?",
        "init_prompts": "你是一名AI客服助理。",
        "init_welcome_text": "您好我Cherry,有什么可以帮您?",
        "goodbye_text": [
            "再见",
            "拜拜",
            "bye"
        ]
    },
    "domain": "xswitch.cn"
}
  • 响应信息
{
	"data":	"{}",
	"message":	"success",
	"code":	200
}

删除指定 AI 机器人

  • 请求 URL/api/ai_robot/:uuid
  • 请求方式DELETE
  • 响应信息
{
	"uuid":	"7008553a-55ee-4db7-a45e-cbc93dc36d12"
}

AI 话单

查询 AI 话单

  • 请求 URL/api/cherrygpt_logs
  • 请求 URL/api/cherrygpt_logs?page=1&perPage=500&last=60 查看近60天的话单
  • 请求 URL/api/cherrygpt_logs?page=1&perPage=500&startDate=2025-07-06&endDate=2025-09-04&cidNumber=823&destNumber=1000479 按条件查询
  • 请求方式GET
  • 请求参数
参数名类型是否必填描述
pageint页码
perPageint每页条数
lastint最近天数
cidNumberint主叫号码
destNumberint被叫号码
startDatestring开始时间
endDatestring结束时间
  • 响应信息
{
	"pageCount":	1,
	"rowCount":	1,
	"page":	1,
	"data":	[{
			"robot_info":	"{\"service_model\":\"ChatGPT\",\"gpt_token\":\"6ba7b811-9dad-11d1-80b4-00c04fd430c8\",\"gpt_model\":\"gpt-4o\",\"gpt_max_tokens\":100,\"gpt_url\":\"https://openai.xswitch.cn/v1/\",\"ASync\":false,\"breakMode\":true}",
			"ai_robot_uuid":	"0ec755d3-5b6c-41e9-91dc-f71ed756c616",
			"channel_uuid":	"019890b3-2816-7b5f-8697-c1b993884121",
			"start_stamp":	"2025-08-10 05:18:37",
			"end_stamp":	"",
			"id":	"109",
			"created_at":	"2025-08-10 05:18:37",
			"cid_number":	"607",
			"domain":	"xyt.xswitch.cn",
			"node_uuid":	"0dbd5892-a0b3-4a3a-b19c-9d9e15d503bd",
			"dest_number":	"10000475"
		}]
}

查询指定 AI 话单

  • 请求 URL/api/cherrygpt_logs/:id

  • 请求方式GET

  • 请求参数

    参数名类型是否必填描述
    idint话单 ID
  • 响应信息

{
	"data":	{
		"cid_number":	"823",
		"end_stamp":	"",
		"ai_robot_uuid":	"c56038e1-bcac-4c70-82c8-4f6e9b7e6f35",
		"node_uuid":	"567559e7-eb40-4d5e-ab19-1a7654debe69",
		"id":	86,
		"dest_number":	"10000479",
		"created_at":	"2025-07-14 22:47:23",
		"start_stamp":	"2025-07-14 22:47:23",
		"prompts":	[{
				"channel_uuid":	"5976900e-0a1a-9be1-f1a5-2033b66a3602",
				"role":	"assistant",
				"absolute_path":	"/usr/local/freeswitch/storage/recordings/20250714-823-10000479-.wav",
				"mime":	"audio/wav",
				"created_at":	"2025-07-14 22:47:23",
				"id":	384,
				"message_uuid":	"",
				"content":	"喂,你好。",
				"extension":	"wav"
			}, {
				"channel_uuid":	"5976900e-0a1a-9be1-f1a5-2033b66a3602",
				"role":	"user",
				"absolute_path":	"/usr/local/freeswitch/storage/recordings/20250714-823-10000479-333db217422e46e9b3b3599a0da2e679.wav",
				"mime":	"audio/wav",
				"created_at":	"2025-07-14 22:47:29",
				"id":	385,
				"message_uuid":	"333db217-422e-46e9-b3b3-599a0da2e679",
				"content":	"你好",
				"extension":	"wav"
			}...],
		"robot_info":	"{\"service_model\":\"ChatGPT\",\"gpt_token\":\"6ba7b811-9dad-11d1-80b4-00c04fd430c8\",\"gpt_model\":\"gpt-4o\",\"gpt_max_tokens\":100,\"gpt_url\":\"https://openai.xswitch.cn/v1/\",\"ASync\":false,\"breakMode\":true}",
		"domain":	"xyt.xswitch.cn",
		"channel_uuid":	"5976900e-0a1a-9be1-f1a5-2033b66a3602"
	},
	"code":	200,
	"message":	"success"
}
呼叫中心