API migration
OpenAI-compatible API for multi-model routing
Keep the request body and SDK pattern. Change the base URL and API key to route more than 100 models through Pandoroute.
Migration
Two configuration changes
Use the current OpenAI-compatible client, set the base URL, and replace the provider key with a Pandoroute API key.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.PANDOROUTE_API_KEY,
baseURL: "https://api.pandoroute.ai/v1"
});
const response = await client.chat.completions.create({
model: "auto",
messages: [
{ role: "user", content: "Write a launch checklist." }
],
stream: false
});
console.log(response.choices[0].message.content);The API supports OpenAI-style chat, Responses, Anthropic-style Messages, model listing, token counting, and file uploads. Model IDs remain Pandoroute model codes and are not guaranteed to match provider IDs.
Compatibility
What changes
Most applications change credentials and endpoint configuration. Request support still depends on the selected endpoint and model capabilities.
| Client setting | Pandoroute value |
|---|---|
| Base URL | https://api.pandoroute.ai/v1 |
| Authentication | Authorization: Bearer sk_sli_... |
| Model | auto or an enabled model code from /v1/models |
| Chat path | /chat/completions |
| Request tracking | Keep the request-id response header in application logs. |
Questions
Can I use the existing OpenAI SDK?
Yes. The Pandoroute documentation recommends using its base URL with an OpenAI-compatible client and changing the API key.
Are provider model IDs accepted directly?
Use model codes returned by GET /v1/models. Pandoroute separates customer-facing model codes from upstream provider details.
Which request path is the safest first migration?
Start with POST /v1/chat/completions. Move to Responses or Anthropic-style Messages only when the application needs those request shapes.
Sources
Product and competitor facts were checked on . Current pricing and availability can change.