Migrating from OpenAI SDK
This guide will help you migrate your existing OpenAI SDK (Python or Node.js) integration to use the Phaseo Gateway instead.Overview
Phaseo Gateway provides OpenAI-compatible endpoints, making migration straightforward. You’ll primarily need to:- Change the API base URL
- Update your API key
- Update authentication method (from
api_keytoAuthorization: Bearer)
Prerequisites
- A Phaseo account and API key (get one at Gateway Keys)
- Existing OpenAI SDK code
Migration Steps
1. Update API Key and Base URL
Instead of using the OpenAI API key and default base URL, use your Phaseo credentials.3. Test Your Integration
Run your existing code with the updated configuration to ensure it works.4. Handle Model Names
Phaseo supports a wide range of models. Check the models endpoint for available models and their names. Some model names may differ from OpenAI’s naming convention.Common Issues
- Model not found: Ensure the model name is available in Phaseo. Use the
/modelsendpoint to list available models. - Rate limits: Phaseo may have different rate limits than OpenAI.
- Features: Some OpenAI-specific features may not be available or work differently.
Next Steps
- Explore Phaseo’ additional features like analytics and multi-provider routing.
- Check out the API Reference for full documentation.