跳转到主要内容

端点

创建语音会话

POST /api/v1/voice/session
配置临时的 OpenAI Realtime API 令牌,用于 WebRTC 语音连接。 响应:
{
  "token": "ephemeral-openai-token",
  "expires_at": "2026-02-18T12:00:00Z",
  "model": "gpt-4o-realtime-preview"
}
前端使用此令牌与 OpenAI Realtime API 建立直接 WebRTC 连接。Apollo Brain 的工具在语音会话中注册为函数调用。

音频转录

POST /audio/transcribe
使用 OpenAI Whisper API 转录音频。 请求: 包含音频文件的 multipart form 数据。 响应:
{
  "text": "Create a high priority task for the API migration",
  "language": "en",
  "duration": 3.5
}