OpenAI Compatibility
Leverage OpenAI Compatibility with Outspeed Live API
Outspeed Live API offers a seamless integration experience by being compatible with OpenAI’s Realtime API. This means you can often use similar integration patterns and even reuse existing code.
You can connect to Outspeed Live API in your applications using WebRTC. The process mirrors the one described in OpenAI’s Realtime API WebRTC Guide.
The key difference is the API endpoint:
- Outspeed Live API:
api.outspeed.com
- OpenAI API:
api.openai.com
Here’s a summary of the integration steps:
1. Obtain an Ephemeral Key
First, your backend needs to obtain an ephemeral key from Outspeed. This process is similar to OpenAI’s. You’ll make a POST request to the Outspeed sessions endpoint.
Example: Creating a session and obtaining a key
Remember to replace YOUR_OUTSPEED_API_KEY
with your actual Outspeed API key.
2. Establish WebRTC Connection on Frontend
Once you have the ephemeral key, use it on your application’s frontend to establish a WebRTC connection with Outspeed Live API.
You can find a client-side code snippet demonstrating this in our Voice Devtools repository on GitHub.
3. Reuse OpenAI Event Handlers
A significant advantage of Outspeed’s OpenAI compatibility is that the Live API emits the same events as OpenAI’s Realtime API. This allows you to retain your existing event handling logic if you are migrating from or familiar with OpenAI’s API.
For more details on the specific events and API specifications, please refer to the Outspeed Live API documentation.