Unode
User GuideAPI ReferenceHelp & SupportBusiness Cooperation

OpenAI Realtime API

Overview

Introduction

OpenAI Realtime API provides two connection methods:

  1. WebRTC - For real-time audio/video interaction in browsers and mobile clients

  2. WebSocket - For server-to-server application integration

Use Cases

  • Real-time voice conversations
  • Audio/video conferencing
  • Real-time translation
  • Speech transcription
  • Real-time code generation
  • Server-side real-time integration

Key Features

  • Bidirectional audio streaming
  • Mixed text and audio conversations
  • Function calling support
  • Automatic Voice Activity Detection (VAD)
  • Audio transcription capabilities
  • WebSocket server-side integration

Supported Models

Currently supported models include:

ModelDescription
gpt-4o-realtime-previewGPT-4o Realtime model
gpt-4o-realtime-preview-2024-12-17GPT-4o Realtime model (2024-12-17 version)
gpt-4o-mini-realtime-previewGPT-4o Mini Realtime model

Authentication & Security

Authentication Methods

  1. Standard API Key (server-side only)
  2. Ephemeral Token (client-side use)

Ephemeral Token

  • Validity: 1 minute
  • Usage limit: Single connection
  • Generation: Created via server-side API
POST https://www.unodetech.xyz/v1/realtime/sessions
Content-Type: application/json
Authorization: Bearer $API_KEY

{
  "model": "gpt-4o-realtime-preview-2024-12-17",
  "voice": "verse"
}

Security Recommendations

  • Never expose standard API keys on the client side
  • Use HTTPS/WSS for communication
  • Implement appropriate access controls
  • Monitor for unusual activity

Connection Establishment

WebRTC Connection

  • URL: https://www.unodetech.xyz/v1/realtime
  • Query parameters: model
  • Headers:
    • Authorization: Bearer EPHEMERAL_KEY
    • Content-Type: application/sdp

WebSocket Connection

  • URL: wss://www.unodetech.xyz/v1/realtime
  • Query parameters: model
  • Headers:
    • Authorization: Bearer YOUR_API_KEY
    • OpenAI-Beta: realtime=v1

Connection Flow

sequenceDiagram
    participant Client
    participant Server
    participant OpenAI
    
    alt WebRTC Connection
        Client->>Server: Request ephemeral token
        Server->>OpenAI: Create session
        OpenAI-->>Server: Return ephemeral token
        Server-->>Client: Return ephemeral token
        
        Client->>OpenAI: Create WebRTC offer
        OpenAI-->>Client: Return answer
        
        Note over Client,OpenAI: Establish WebRTC connection
        
        Client->>OpenAI: Create data channel
        OpenAI-->>Client: Confirm data channel
    else WebSocket Connection
        Server->>OpenAI: Establish WebSocket connection
        OpenAI-->>Server: Confirm connection
        
        Note over Server,OpenAI: Begin real-time conversation
    end

Data Channel

  • Name: oai-events
  • Purpose: Event transmission
  • Format: JSON

Audio Stream

  • Input: addTrack()
  • Output: ontrack event

Conversation Interaction

Conversation Modes

  1. Text-only conversations
  2. Voice conversations
  3. Mixed conversations

Session Management

  • Create session
  • Update session
  • End session
  • Session configuration

Event Types

  • Text events
  • Audio events
  • Function calls
  • Status updates
  • Error events

Configuration Options

Audio Configuration

  • Input formats
    • pcm16
    • g711_ulaw
    • g711_alaw
  • Output formats
    • pcm16
    • g711_ulaw
    • g711_alaw
  • Voice types
    • alloy
    • echo
    • shimmer

Model Configuration

  • Temperature
  • Maximum output length
  • System prompt
  • Tool configuration

VAD Configuration

  • Threshold
  • Silence duration
  • Prefix padding

Request Examples

WebSocket Connection

import WebSocket from "ws";

const url = "wss://www.unodetech.xyz/v1/realtime?model=gpt-4o-realtime-preview-2024-12-17";
const ws = new WebSocket(url, {
  headers: {
    "Authorization": "Bearer " + process.env.API_KEY,
    "OpenAI-Beta": "realtime=v1",
  },
});

ws.on("open", function open() {
  console.log("Connected to server.");
});

ws.on("message", function incoming(message) {
  console.log(JSON.parse(message.toString()));
});
# Requires websocket-client library:
# pip install websocket-client

import os
import json
import websocket

API_KEY = os.environ.get("API_KEY")

url = "wss://www.unodetech.xyz/v1/realtime?model=gpt-4o-realtime-preview-2024-12-17"
headers = [
    "Authorization: Bearer " + API_KEY,
    "OpenAI-Beta: realtime=v1"
]

def on_open(ws):
    print("Connected to server.");

def on_message(ws, message):
    data = json.loads(message)
    print("Received event:", json.dumps(data, indent=2))

ws = websocket.WebSocketApp(
    url,
    header=headers,
    on_open=on_open,
    on_message=on_message,
)

ws.run_forever()
/*
Note: In browser and other client environments, we recommend using WebRTC.
But in Deno and Cloudflare Workers and other browser-like environments,
you can also use the standard WebSocket interface.
*/

const ws = new WebSocket(
  "wss://www.unodetech.xyz/v1/realtime?model=gpt-4o-realtime-preview-2024-12-17",
  [
    "realtime",
    // Authentication
    "openai-insecure-api-key." + API_KEY, 
    // Optional
    "openai-organization." + OPENAI_ORG_ID,
    "openai-project." + OPENAI_PROJECT_ID,
    // Beta protocol, required
    "openai-beta.realtime-v1"
  ]
);

ws.on("open", function open() {
  console.log("Connected to server.");
});

ws.on("message", function incoming(message) {
  console.log(message.data);
});
Node.js/Browser
// Receive server events
ws.on("message", function incoming(message) {
  // Need to parse message data from JSON
  const serverEvent = JSON.parse(message.data)
  console.log(serverEvent);
});

// Send events, create JSON data structure conforming to client event format
const event = {
  type: "response.create",
  response: {
    modalities: ["audio", "text"],
    instructions: "Give me a haiku about code.",
  }
};
ws.send(JSON.stringify(event));
Python
# Send client events, serialize dictionary to JSON
def on_open(ws):
    print("Connected to server.");
    
    event = {
        "type": "response.create",
        "response": {
            "modalities": ["text"],
            "instructions": "Please assist the user."
        }
    }
    ws.send(json.dumps(event))

# Receive messages need to parse message payload from JSON
def on_message(ws, message):
    data = json.loads(message)
    print("Received event:", json.dumps(data, indent=2))
Example Documentation

This is a Python example of OpenAI Realtime WebSocket voice conversation, supporting real-time voice input and output.

Features
  • 🎤 Real-time Voice Recording: Automatically detects voice input and sends it to the server
  • 🔊 Real-time Audio Playback: Plays AI's voice responses
  • 📝 Text Display: Simultaneously displays AI's text responses
  • 🎯 Automatic Voice Detection: Uses server-side VAD (Voice Activity Detection)
  • 🔄 Bidirectional Communication: Supports continuous conversation
Requirements
  • Python 3.7+
  • Microphone and speakers
  • Stable network connection
Install Dependencies
pip install -r requirements.txt

System Dependencies: On Linux systems, you may need to install additional audio libraries:

# Ubuntu/Debian
sudo apt-get install portaudio19-dev python3-pyaudio

# CentOS/RHEL
sudo yum install portaudio-devel
Configuration

In the openai_realtime_client.py file, ensure the following configuration is correct:

WEBSOCKET_URL = "wss://www.unodetech.xyz/v1/realtime"
API_KEY = "sk-QMA3eCob2EmDI2graXo4onUupApVnrk8wPXemJ7lSfK4QPa0"
MODEL = "gpt-4o-realtime-preview-2024-12-17"
Usage
  1. Run the program:

    python openai_realtime_client.py
  2. Start conversation:

    • The program will automatically start recording after launch
    • Speak into the microphone
    • AI will respond to your voice in real-time
  3. Stop the program:

    • Press Ctrl+C to stop the program
Technical Details

Audio Configuration:

  • Sample Rate: 24kHz (OpenAI Realtime API requirement)
  • Format: PCM16
  • Channels: Mono
  • Encoding: Base64

WebSocket Message Types:

  • session.update: Session configuration
  • input_audio_buffer.append: Send audio data
  • input_audio_buffer.commit: Commit audio buffer
  • response.audio.delta: Receive audio response
  • response.text.delta: Receive text response

Voice Activity Detection: Uses server-side VAD configuration:

  • Threshold: 0.5
  • Prefix padding: 300ms
  • Silence duration: 500ms
Troubleshooting

Common Issues:

  1. Audio Device Issues:

    # Check audio devices
    python -c "import pyaudio; p = pyaudio.PyAudio(); print([p.get_device_info_by_index(i) for i in range(p.get_device_count())])"
  2. Permission Issues:

    • Ensure the program has microphone access permissions
    • Linux: Check ALSA/PulseAudio configuration
  3. Network Connection Issues:

    • Check if the WebSocket URL is correct
    • Ensure the API key is valid
    • Check firewall settings

Debug Mode:

Enable verbose logging:

logging.basicConfig(level=logging.DEBUG)
Code Structure
├── openai_realtime_client.py  # Main program file
├── requirements.txt           # Python dependencies
└── README.md                  # Documentation

Main Classes and Methods:

  • OpenAIRealtimeClient: Main client class
    • connect(): Connect to WebSocket
    • start_audio_streams(): Start audio streams
    • start_recording(): Start recording
    • handle_response(): Handle responses
    • start_conversation(): Start conversation
Notes
  1. Audio Quality: Ensure use in a quiet environment for best results
  2. Network Latency: Real-time conversation is sensitive to network latency
  3. Resource Usage: Long-running sessions may consume significant CPU and memory
  4. API Limits: Be aware of OpenAI API usage limits and costs
License

This project is for learning and testing purposes only. Please comply with OpenAI's terms of use.

Example Code
#!/usr/bin/env python3
"""
OpenAI Realtime WebSocket Audio Example
Supports real-time voice conversation, including audio recording, sending, and playback
"""

import asyncio
import json
import base64
import websockets
import pyaudio
import wave
import threading
import time
from typing import Optional
import logging

# Configure logging
logging.basicConfig(
    level=logging.DEBUG,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    handlers=[
        logging.StreamHandler(),
        logging.FileHandler('websocket_debug.log', encoding='utf-8')
    ]
)
logger = logging.getLogger(__name__)

class OpenAIRealtimeClient:
    def __init__(self, 
                 websocket_url: str,
                 api_key: str,
                 model: str = "gpt-4o-realtime-preview-2024-12-17"):
        self.websocket_url = websocket_url
        self.api_key = api_key
        self.model = model
        self.websocket = None
        self.is_recording = False
        self.is_connected = False
        
        # Audio configuration
        self.audio_format = pyaudio.paInt16
        self.channels = 1
        self.rate = 24000  # OpenAI Realtime API required sample rate
        self.chunk = 1024
        self.audio = pyaudio.PyAudio()
        
        # Audio streams
        self.input_stream = None
        self.output_stream = None
        
    async def connect(self):
        """Connect to WebSocket server"""
        headers = {
            "Authorization": f"Bearer {self.api_key}",
            "OpenAI-Beta": "realtime=v1"
        }
        
        logger.info("=" * 80)
        logger.info("🚀 Starting WebSocket connection")
        logger.info("=" * 80)
        logger.info(f"Connection URL: {self.websocket_url}")
        logger.info(f"API Key: {self.api_key[:10]}...")
        logger.info(f"Headers: {json.dumps(headers, ensure_ascii=False, indent=2)}")
        
        try:
            self.websocket = await websockets.connect(
                self.websocket_url,
                additional_headers=headers
            )
            self.is_connected = True
            logger.info("✅ WebSocket connection successful")
            
            # Send session configuration
            await self.send_session_config()
            
        except Exception as e:
            logger.error(f"❌ WebSocket connection failed: {e}")
            logger.error(f"Error type: {type(e).__name__}")
            raise
    
    async def send_session_config(self):
        """Send session configuration"""
        config = {
            "type": "session.update",
            "session": {
                "modalities": ["text", "audio"],
                "instructions": "You are a helpful AI assistant that can engage in real-time voice conversations.",
                "voice": "alloy",
                "input_audio_format": "pcm16",
                "output_audio_format": "pcm16",
                "input_audio_transcription": {
                    "model": "whisper-1"
                },
                "turn_detection": {
                    "type": "server_vad",
                    "threshold": 0.5,
                    "prefix_padding_ms": 300,
                    "silence_duration_ms": 500
                },
                "tools": [],
                "tool_choice": "auto",
                "temperature": 0.8,
                "max_response_output_tokens": 4096
            }
        }
        
        config_json = json.dumps(config, ensure_ascii=False, indent=2)
        logger.info("=" * 60)
        logger.info("📤 Sending session configuration:")
        logger.info(f"Message type: {config['type']}")
        logger.info(f"Configuration content:\n{config_json}")
        logger.info("=" * 60)
        
        await self.websocket.send(json.dumps(config))
        logger.info("✅ Session configuration sent")
    
    def start_audio_streams(self):
        """Start audio input and output streams"""
        try:
            # Input stream (microphone)
            self.input_stream = self.audio.open(
                format=self.audio_format,
                channels=self.channels,
                rate=self.rate,
                input=True,
                frames_per_buffer=self.chunk
            )
            
            # Output stream (speakers)
            self.output_stream = self.audio.open(
                format=self.audio_format,
                channels=self.channels,
                rate=self.rate,
                output=True,
                frames_per_buffer=self.chunk
            )
            
            logger.info("Audio streams started")
            
        except Exception as e:
            logger.error(f"Failed to start audio streams: {e}")
            raise
    
    def stop_audio_streams(self):
        """Stop audio streams"""
        if self.input_stream:
            self.input_stream.stop_stream()
            self.input_stream.close()
            self.input_stream = None
            
        if self.output_stream:
            self.output_stream.stop_stream()
            self.output_stream.close()
            self.output_stream = None
            
        logger.info("Audio streams stopped")
    
    async def start_recording(self):
        """Start recording and send audio data"""
        self.is_recording = True
        logger.info("Starting recording...")
        
        try:
            while self.is_recording and self.is_connected:
                # Read audio data
                audio_data = self.input_stream.read(self.chunk, exception_on_overflow=False)
                
                # Encode audio data as base64
                audio_base64 = base64.b64encode(audio_data).decode('utf-8')
                
                # Send audio data
                message = {
                    "type": "input_audio_buffer.append",
                    "audio": audio_base64
                }
                
                # Log audio data sending (every 10 times to avoid excessive logging)
                if hasattr(self, '_audio_count'):
                    self._audio_count += 1
                else:
                    self._audio_count = 1
                
                if self._audio_count % 10 == 0:  # Log every 10 times
                    logger.debug(f"🎤 Sending audio data #{self._audio_count}: length={len(audio_base64)} characters")
                
                await self.websocket.send(json.dumps(message))
                
                # Brief delay to avoid excessive sending
                await asyncio.sleep(0.01)
                
        except Exception as e:
            logger.error(f"Error during recording: {e}")
        finally:
            logger.info("Recording stopped")
    
    async def stop_recording(self):
        """Stop recording"""
        self.is_recording = False
        
        # Send recording end signal
        if self.websocket and self.is_connected:
            message = {
                "type": "input_audio_buffer.commit"
            }
            
            logger.info("=" * 60)
            logger.info("📤 Sending recording end signal:")
            logger.info(f"Message type: {message['type']}")
            logger.info("=" * 60)
            
            await self.websocket.send(json.dumps(message))
            logger.info("✅ Recording end signal sent")
    
    async def handle_response(self):
        """Handle WebSocket responses"""
        try:
            async for message in self.websocket:
                data = json.loads(message)
                message_type = data.get("type", "unknown")
                
                # Log all received messages in detail
                logger.info("=" * 60)
                logger.info("📥 Received WebSocket message:")
                logger.info(f"Message type: {message_type}")
                
                # Handle different message types
                if message_type == "response.audio.delta":
                    # Handle audio response
                    audio_data = base64.b64decode(data.get("delta", ""))
                    logger.info(f"🎵 Audio data: length={len(audio_data)} bytes")
                    if audio_data and self.output_stream:
                        self.output_stream.write(audio_data)
                        logger.info("✅ Audio data played")
                
                elif message_type == "response.text.delta":
                    # Handle text response
                    text = data.get("delta", "")
                    logger.info(f"💬 Text delta: '{text}'")
                    if text:
                        print(f"AI: {text}", end="", flush=True)
                
                elif message_type == "response.text.done":
                    # Text response complete
                    logger.info("✅ Text response complete")
                    print("\n")
                
                elif message_type == "response.audio.done":
                    # Audio response complete
                    logger.info("✅ Audio response complete")
                
                elif message_type == "error":
                    # Handle errors
                    error_info = data.get('error', {})
                    logger.error("❌ Server error:")
                    logger.error(f"Error details: {json.dumps(error_info, ensure_ascii=False, indent=2)}")
                
                elif message_type == "session.created":
                    # Session created successfully
                    logger.info("✅ Session created")
                
                elif message_type == "session.updated":
                    # Session updated successfully
                    logger.info("✅ Session updated")
                
                elif message_type == "conversation.item.created":
                    # Conversation item created
                    logger.info("📝 Conversation item created")
                
                elif message_type == "conversation.item.input_audio_buffer.speech_started":
                    # Speech started
                    logger.info("🎤 Speech start detected")
                
                elif message_type == "conversation.item.input_audio_buffer.speech_stopped":
                    # Speech stopped
                    logger.info("🔇 Speech stop detected")
                
                elif message_type == "conversation.item.input_audio_buffer.committed":
                    # Audio buffer committed
                    logger.info("📤 Audio buffer committed")
                
                else:
                    # Other unknown message types
                    logger.info(f"❓ Unknown message type: {message_type}")
                
                # Log complete message content (except audio data, as it's too long)
                if message_type != "response.audio.delta":
                    logger.info(f"Complete message content:\n{json.dumps(data, ensure_ascii=False, indent=2)}")
                
                logger.info("=" * 60)
                    
        except websockets.exceptions.ConnectionClosed:
            logger.info("WebSocket connection closed")
            self.is_connected = False
        except Exception as e:
            logger.error(f"Error handling response: {e}")
            self.is_connected = False
    
    async def start_conversation(self):
        """Start conversation"""
        try:
            # Start audio streams
            self.start_audio_streams()
            
            # Create tasks
            response_task = asyncio.create_task(self.handle_response())
            recording_task = asyncio.create_task(self.start_recording())
            
            logger.info("Conversation started, press Ctrl+C to stop")
            
            # Wait for tasks to complete
            await asyncio.gather(response_task, recording_task)
            
        except KeyboardInterrupt:
            logger.info("Stop signal received")
        except Exception as e:
            logger.error(f"Error during conversation: {e}")
        finally:
            await self.cleanup()
    
    async def cleanup(self):
        """Clean up resources"""
        self.is_recording = False
        self.is_connected = False
        
        # Stop audio streams
        self.stop_audio_streams()
        
        # Close WebSocket connection
        if self.websocket:
            await self.websocket.close()
            logger.info("WebSocket connection closed")
        
        # Terminate PyAudio
        self.audio.terminate()
        logger.info("Resource cleanup complete")
    
    async def run(self):
        """Run client"""
        try:
            await self.connect()
            await self.start_conversation()
        except Exception as e:
            logger.error(f"Error running client: {e}")
        finally:
            await self.cleanup()


async def main():
    """Main function"""
    # Configuration parameters
    WEBSOCKET_URL = "wss://www.unodetech.xyz/v1/realtime?model=gpt-4o-realtime-preview-2024-12-17"
    API_KEY = "sk-EpnduEXFxjAt0AF55W08WBmzqZHlv9f4tmCDWd9TcJqBwVjV"
    MODEL = "gpt-4o-realtime-preview-2024-12-17"
    
    # Create client
    client = OpenAIRealtimeClient(
        websocket_url=WEBSOCKET_URL,
        api_key=API_KEY,
        model=MODEL
    )
    
    # Run client
    await client.run()


if __name__ == "__main__":
    print("OpenAI Realtime WebSocket Audio Example")
    print("=" * 50)
    print("Features:")
    print("- Real-time voice conversation")
    print("- Automatic speech recognition")
    print("- Text and audio responses")
    print("- Press Ctrl+C to stop")
    print("=" * 50)
    
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nProgram stopped")
    except Exception as e:
        print(f"Program error: {e}")

Error Handling

Common Errors

  1. Connection errors
    • Network issues
    • Authentication failures
    • Configuration errors
  2. Audio errors
    • Device permissions
    • Unsupported formats
    • Codec issues
  3. Session errors
    • Token expiration
    • Session timeout
    • Concurrency limits

Error Recovery

  1. Automatic reconnection
  2. Session recovery
  3. Error retry
  4. Graceful degradation

Event Reference

Common Request Headers

All events need to include the following request headers:

HeaderTypeDescriptionExample Value
AuthorizationStringAuthentication tokenBearer $API_KEY
OpenAI-BetaStringAPI versionrealtime=v1

Client Events

session.update

Update the default configuration for the session.

input_audio_buffer.append

Append audio data to the input audio buffer.

input_audio_buffer.commit

Commit the audio data in the buffer as a user message.

input_audio_buffer.clear

Clear all audio data from the input audio buffer.

conversation.item.create

Add a new conversation item to the conversation.

conversation.item.truncate

Truncate audio content in assistant messages.

conversation.item.delete

Delete the specified conversation item from conversation history.

response.create

Trigger response generation.

response.cancel

Cancel ongoing response generation.

Server Events

error

Event returned when an error occurs.

conversation.item.input_audio_transcription.completed

Returned when input audio transcription is enabled and transcription succeeds.

conversation.item.input_audio_transcription.failed

Returned when input audio transcription is configured but transcription request for user message fails.

conversation.item.truncated

Returned when client truncates previous assistant audio message item.

conversation.item.deleted

Returned when an item in the conversation is deleted.

input_audio_buffer.committed

Returned when audio buffer data is committed.

input_audio_buffer.cleared

Returned when client clears input audio buffer.

input_audio_buffer.speech_started

In server voice detection mode, returned when voice input is detected.

input_audio_buffer.speech_stopped

In server voice detection mode, returned when voice input stops.

response.created

Returned when a new response is created.

response.done

Returned when response streaming is complete.

response.output_item.added

Returned when a new output item is created during response generation.

response.output_item.done

Returned when output item streaming is complete.

response.content_part.added

Returned when a new content part is added to assistant message item during response generation.

response.content_part.done

Returned when content part in assistant message item streaming is complete.

response.text.delta

Returned when text value of "text" type content part is updated.

response.text.done

Returned when "text" type content part text streaming is complete.

response.audio_transcript.delta

Returned when transcription content of model-generated audio output is updated.

response.audio_transcript.done

Returned when transcription of model-generated audio output streaming is complete.

response.audio.delta

Returned when model-generated audio content is updated.

response.audio.done

Returned when model-generated audio is complete.

Function Calling

response.function_call_arguments.delta

Returned when model-generated function call arguments are updated.

response.function_call_arguments.done

Returned when model-generated function call arguments streaming is complete.

Other Status Updates

rate_limits.updated

Triggered after each "response.done" event to indicate updated rate limits.

conversation.created

Returned when conversation is created.

conversation.item.created

Returned when conversation item is created.

session.created

Returned when session is created.

session.updated

Returned when session is updated.

Rate Limit Event Parameter Table

Function Call Parameter Table

Audio Format Parameter Table

Voice Detection Parameter Table

Tool Selection Parameter Table

Model Configuration Parameter Table

Event Common Parameter Table

Session Status Parameter Table

Conversation Item Status Parameter Table

Content Type Parameter Table

Response Status Parameter Table

Audio Transcription Parameter Table

Audio Stream Parameter Table

WebRTC Configuration Parameter Table

Last updated on

On this page

Overview
Introduction
Use Cases
Key Features
Supported Models
Authentication & Security
Authentication Methods
Ephemeral Token
Security Recommendations
Connection Establishment
WebRTC Connection
WebSocket Connection
Connection Flow
Data Channel
Audio Stream
Conversation Interaction
Conversation Modes
Session Management
Event Types
Configuration Options
Audio Configuration
Model Configuration
VAD Configuration
Request Examples
WebSocket Connection
Node.js/Browser
Python
Example Documentation
Features
Requirements
Install Dependencies
Configuration
Usage
Technical Details
Troubleshooting
Code Structure
Notes
License
Example Code
Error Handling
Common Errors
Error Recovery
Event Reference
Common Request Headers
Client Events
session.update
input_audio_buffer.append
input_audio_buffer.commit
input_audio_buffer.clear
conversation.item.create
conversation.item.truncate
conversation.item.delete
response.create
response.cancel
Server Events
error
conversation.item.input_audio_transcription.completed
conversation.item.input_audio_transcription.failed
conversation.item.truncated
conversation.item.deleted
input_audio_buffer.committed
input_audio_buffer.cleared
input_audio_buffer.speech_started
input_audio_buffer.speech_stopped
response.created
response.done
response.output_item.added
response.output_item.done
response.content_part.added
response.content_part.done
response.text.delta
response.text.done
response.audio_transcript.delta
response.audio_transcript.done
response.audio.delta
response.audio.done
Function Calling
response.function_call_arguments.delta
response.function_call_arguments.done
Other Status Updates
rate_limits.updated
conversation.created
conversation.item.created
session.created
session.updated
Rate Limit Event Parameter Table
Function Call Parameter Table
Audio Format Parameter Table
Voice Detection Parameter Table
Tool Selection Parameter Table
Model Configuration Parameter Table
Event Common Parameter Table
Session Status Parameter Table
Conversation Item Status Parameter Table
Content Type Parameter Table
Response Status Parameter Table
Audio Transcription Parameter Table
Audio Stream Parameter Table
WebRTC Configuration Parameter Table