https://yibuapi.com/v1/realtime
model
Authorization: Bearer EPHEMERAL_KEY
Content-Type: application/sdp
wss://yibuapi.com/v1/realtime
model
Authorization: Bearer YOUR_API_KEY
OpenAI-Beta: realtime=v1
oai-events
addTrack()
ontrack
事件pcm16
g711_ulaw
g711_alaw
pcm16
g711_ulaw
g711_alaw
alloy
echo
shimmer
请求头 | 类型 | 说明 | 示例值 |
---|---|---|---|
Authorization | 字符串 | 认证令牌 | Bearer $NEW_API_KEY |
OpenAI-Beta | 字符串 | API 版本 | realtime=v1 |
参数 | 类型 | 必需 | 说明 | 示例值/可选值 |
---|---|---|---|---|
event_id | 字符串 | 否 | 客户端生成的事件标识符 | event_123 |
type | 字符串 | 否 | 事件类型 | session.update |
modalities | 字符串数组 | 否 | 模型可以响应的模态类型 | ["text", "audio"] |
instructions | 字符串 | 否 | 预置到模型调用前的系统指令 | "Your knowledge cutoff is 2023-10..." |
voice | 字符串 | 否 | 模型使用的语音类型 | alloy、echo、shimmer |
input_audio_format | 字符串 | 否 | 输入音频格式 | pcm16、g711_ulaw、g711_alaw |
output_audio_format | 字符串 | 否 | 输出音频格式 | pcm16、g711_ulaw、g711_alaw |
input_audio_transcription.model | 字符串 | 否 | 用于转写的模型 | whisper-1 |
turn_detection.type | 字符串 | 否 | 语音检测类型 | server_vad |
turn_detection.threshold | 数字 | 否 | VAD 激活阈值(0.0-1.0) | 0.8 |
turn_detection.prefix_padding_ms | 整数 | 否 | 语音开始前包含的音频时长 | 500 |
turn_detection.silence_duration_ms | 整数 | 否 | 检测语音停止的静音持续时间 | 1000 |
tools | 数组 | 否 | 模型可用的工具列表 | [] |
tool_choice | 字符串 | 否 | 模型选择工具的方式 | auto/none/required |
temperature | 数字 | 否 | 模型采样温度 | 0.8 |
max_output_tokens | 字符串/整数 | 否 | 单次响应最大token数 | "inf"/4096 |
参数 | 类型 | 必需 | 说明 | 示例值 |
---|---|---|---|---|
event_id | 字符串 | 否 | 客户端生成的事件标识符 | event_456 |
type | 字符串 | 否 | 事件类型 | input_audio_buffer.append |
audio | 字符串 | 否 | Base64编码的音频数据 | Base64EncodedAudioData |
参数 | 类型 | 必需 | 说明 | 示例值 |
---|---|---|---|---|
event_id | 字符串 | 否 | 客户端生成的事件标识符 | event_789 |
type | 字符串 | 否 | 事件类型 | input_audio_buffer.commit |
参数 | 类型 | 必需 | 说明 | 示例值 |
---|---|---|---|---|
event_id | 字符串 | 否 | 客户端生成的事件标识符 | event_012 |
type | 字符串 |