curl --request POST \
--url https://api.senseaudio.cn/v1/realtime/invoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"agent_id": "690f53770e9d9d60d98ba7a8",
"new_dialogue": true
}
'
{
"conv_id": "9b8260e2-19d9-4609-abe7-3b74ac16b677",
"app_id": "d4432b04117aj77r7755c2d8e86e140b",
"room_id": "lO81loRAfmUMFIwY",
"room_user_id": 360706506,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
实时智能体
创建实时会话
启动语音Agent对话会话,获取实时通信所需的房间信息和连接凭证。支持创建新对话或继续已有对话。
POST
/
v1
/
realtime
/
invoke
curl --request POST \
--url https://api.senseaudio.cn/v1/realtime/invoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"agent_id": "690f53770e9d9d60d98ba7a8",
"new_dialogue": true
}
'
{
"conv_id": "9b8260e2-19d9-4609-abe7-3b74ac16b677",
"app_id": "d4432b04117aj77r7755c2d8e86e140b",
"room_id": "lO81loRAfmUMFIwY",
"room_user_id": 360706506,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
说明
提供端到端的实时语音交互能力,适合构建语音助手、陪伴 Agent、呼叫机器人等低延迟交互应用。授权
格式:Bearer <API_KEY>
请求头
内容类型。固定为 application/json
示例:
"application/json"
请求体
application/json
响应
成功响应
对话 ID,用于后续继续对话
示例:
"9b8260e2-19d9-4609-abe7-3b74ac16b677"
实时通信 App ID
示例:
"d4432b04117aj77r7755c2d8e86e140b"
房间 ID,用于查询状态和停止对话
示例:
"lO81loRAfmUMFIwY"
房间用户 ID
示例:
360706506
连接凭证 (JWT),用于建立实时通信连接
示例:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."