Why Use OpenAI SDK with Edgee?
- No Code Changes: Use your existing OpenAI SDK code as-is
- Multi-Provider Access: Route to OpenAI, Anthropic, Google, and more through one API
- Automatic Failover: Built-in reliability with fallback providers
- Cost Tracking: Real-time visibility into token usage and costs
- Observability: Request tracing and logging across all providers
Installation
Install the OpenAI SDK for your preferred language:- TypeScript
- Python
Configuration
Configure the OpenAI SDK to use Edgee’s API endpoint:Advanced Usage
Function Calling (Tools)
Edgee fully supports OpenAI’s function calling interface:Streaming Responses
Edgee supports streaming responses for real-time token delivery:Migration from OpenAI
If you’re already using the OpenAI SDK, migrating to Edgee is straightforward:- Change the base URL: Update
baseURLfromhttps://api.openai.com/v1tohttps://api.edgee.ai/v1 - Update API key: Use your Edgee API key instead of your OpenAI key
- That’s it! Your existing code will work without any other changes
What’s Next?
Get API Key
Create an account and get your Edgee API key to start using the OpenAI SDK.
Supported Models
Browse 200+ models available through Edgee from multiple providers.
Edgee SDK
Check out the native Edgee SDKs for TypeScript, Python, Go, and Rust.
API Reference
Explore the full REST API documentation.