OpenAI compatibility
Seamlessly migrate existing OpenAI integrations to Vapi with zero code changes
Overview
Migrate your existing OpenAI chat applications to Vapi without changing a single line of code. Perfect for teams already using OpenAI SDKs, third-party tools expecting OpenAI API format, or developers who want to leverage existing OpenAI workflows.
What You’ll Build:
- Drop-in replacement for OpenAI chat endpoints using Vapi assistants
- Migration path from OpenAI to Vapi with existing codebases
- Integration with popular frameworks like LangChain and Vercel AI SDK
- Production-ready server implementations with both streaming and non-streaming
Prerequisites
- Completed Chat quickstart tutorial
- Existing OpenAI integration or familiarity with OpenAI SDK
Scenario
We’ll migrate “TechFlow’s” existing OpenAI-powered customer support chat to use Vapi assistants, maintaining all existing functionality while gaining access to Vapi’s advanced features like custom voices and tools.
1. Quick Migration Test
2. Migrate Existing OpenAI Code
Update your OpenAI client configuration
Change only the base URL and API key in your existing code:
Before (OpenAI)
With Vapi (No Code Changes)
After (Vapi)
3. Implement Streaming with OpenAI SDK
4. Framework Integrations
Next Steps
Enhance your migrated system:
- Explore Vapi-specific features - Leverage advanced assistant capabilities
- Add voice capabilities - Extend beyond text to voice interactions
- Integrate tools - Give your assistant access to external APIs
- Optimize for streaming - Improve real-time user experience