Migrate from OpenAI
Most OpenAI-compatible applications only need three configuration changes:
- Replace the API key.
- Set the Base URL to
https://getrouter.ai/v1. - Select a model ID available on GetRouter.
Python
Before:
After:
Node.js / TypeScript
Before:
After:
Environment variables
If your application reads standard OpenAI environment variables, you can often update its runtime configuration without changing source code:
The exact environment variable names are application-specific. Confirm that your SDK or tool supports a custom Base URL.
Check feature compatibility
OpenAI-compatible request shapes are supported, but capabilities depend on the selected model and endpoint. Verify the features your application uses:
- Chat Completions or Responses API
- Streaming
- Tool or function calling
- Structured output
- Vision or other multimodal input
- Embeddings, images, or audio
Migrate with a short non-streaming request first. Then enable streaming, tools, reasoning, and other advanced fields one at a time.
Common migration issues
The request goes to the original provider
Confirm that your application is actually reading the custom Base URL. Some applications load environment variables only during startup.
The URL contains /v1/v1
Your application may append /v1 automatically. Use the Base URL format required by that specific client.
The model is rejected
Replace the original provider's model name with an exact ID from GetRouter Models.
Chat works but Responses does not
The two APIs use different endpoints and response event formats. Confirm that the model and integration support POST /v1/responses.
