wss://api.erlcrussia.com/v1/realtime?model=emmy-voice-1. The model parameter is optional.
Authentication works as in OpenAI:
- on a server, use the
Authorization: Bearer sk-voice-…header; - in a browser, use the WebSocket subprotocols
realtimeandopenai-insecure-api-key.sk-voice-….
instructions or tools) are ignored.
Session
After connecting, the server sendssession.created. Change settings with session.update:
ru, en, uk, be, es, it, fr, zh, ja, ko. Voices: F1, F2. Audio in both directions is PCM16, mono, 24 kHz.
Turns are manual: turn_detection must be null, and input_audio_buffer.commit ends a turn. Automatic voice detection (server_vad) is not supported.
Text request
id is optional. The role can be user or system.
Voice request
commit, the server sends input_audio_buffer.committed and conversation.item.added. Once the speech is recognized, conversation.item.input_audio_transcription.completed with the text and conversation.item.done arrive. If recognition fails, you get conversation.item.input_audio_transcription.failed. You can send response.create right after commit: the answer starts when recognition finishes.
input_audio_buffer.clear empties the buffer. Voice can also be sent as one conversation.item.create item with an input_audio part.
Response
The server sendsresponse.created, then response.output_audio_transcript.delta (text) and response.output_audio.delta (base64 PCM), and finally response.done with usage.
- Voice recognition costs the same as speech recognition.
event_idis optional (up to 128 characters). When sent, a repeated event with the sameevent_idis ignored.- One response at a time. A text request is 1 to 12,000 characters; voice is 100 ms to 120 seconds.
- After 100 exchanges or 4096 events, open a new connection.