跳转到主要内容
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..."
}

Documentation Index

Fetch the complete documentation index at: https://docs.senseaudio.cn/llms.txt

Use this file to discover all available pages before exploring further.

说明

提供端到端的实时语音交互能力,适合构建语音助手、陪伴 Agent、呼叫机器人等低延迟交互应用。
  • 会话模型:一个会话由 session_id 唯一标识,音视频通过 RTC 通道传输
  • 生命周期invokestatus(轮询)→ leave

授权

Authorization
string
header
必填

格式:Bearer <API_KEY>

请求头

Content-Type
string
默认值:application/json
必填

内容类型。固定为 application/json

示例:

"application/json"

请求体

application/json
agent_id
string
必填

Agent ID,可通过获取 Agent 列表接口获取

示例:

"690f53770e9d9d60d98ba7a8"

new_dialogue
boolean
必填

是否开启新对话。true: 创建全新的对话会话;false: 继续之前的对话

示例:

true

conv_id
string

对话 ID。当 new_dialogue 为 false 时必填,用于继续之前的对话。可从之前调用此接口的返回结果中获取。如果未填写会创建新会话。

示例:

"9b8260e2-19d9-4609-abe7-3b74ac16b677"

响应

成功响应

conv_id
string
必填

对话 ID,用于后续继续对话

示例:

"9b8260e2-19d9-4609-abe7-3b74ac16b677"

app_id
string
必填

实时通信 App ID

示例:

"d4432b04117aj77r7755c2d8e86e140b"

room_id
string
必填

房间 ID,用于查询状态和停止对话

示例:

"lO81loRAfmUMFIwY"

room_user_id
integer
必填

房间用户 ID

示例:

360706506

token
string
必填

连接凭证 (JWT),用于建立实时通信连接

示例:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."