1. Update the Base URL & Authentication
To point your requests to Routeway, you only need to change two configurations: the endpoint URL and your API key.| Provider | API Endpoint | Authentication Header |
|---|---|---|
| OpenAI | https://api.openai.com/v1 | Authorization: Bearer OPENAI_API_KEY |
| Routeway | https://api.routeway.ai/v1 | Authorization: Bearer ROUTEWAY_API_KEY |
In the authentication header,
ROUTEWAY_API_KEY represents your actual Routeway API key (e.g., sk-...).2. SDK Integration Examples
If you are using official OpenAI client libraries, you don’t need to install any new dependencies. Simply update the configuration during client initialization.- Python
- Node.js
Change your import/initialization to override the
base_url and use your ROUTEWAY_API_KEY:3. Migrating from Anthropic (Claude)
If you are already using the Anthropic SDK, you don’t need to switch to the OpenAI SDK. Simply update thebase_url to point to Routeway:
4. Other OpenAI-Compatible Gateways (e.g., DeepInfra, OpenRouter, Together AI)
If you are currently using the OpenAI SDK configured for another proxy, gateway, or compatibility layer (like DeepInfra, OpenRouter, Together AI, Groq, or Open WebUI), migrating is extremely simple. You only need to update the client configuration references:- Base URL: Change the base URL of your client to
https://api.routeway.ai/v1. - API Key: Replace your provider-specific API key with your
ROUTEWAY_API_KEY. - Model Identifier: Update the
modelparameter to one of Routeway’s supported models (e.g.gpt-4o,claude-3-5-sonnet,deepseek-v3).
5. General HTTP / REST Migration
If you are not using an SDK and instead make direct HTTP requests (e.g., usingfetch, axios, or Python requests), follow these general guidelines to migrate from any other provider:
- Endpoint: Point your POST requests to:
- Headers: Provide your API key in the standard bearer token format:
- Payload Structure: Ensure your JSON body uses the standard Chat Completions format:
See our Models page for the full list of model identifiers available on Routeway.