Migrate from OpenAI
Most OpenAI SDK applications can start using Supado by changing the API key and base URL. Keep the first migration small: do not change models, prompts, retries, and streaming behavior all at once.
Before you start
Section titled “Before you start”- Your current OpenAI integration works.
- You have a Supado API key.
- You know which model you want to test in Supado.
- You can compare one request before and after the migration.
1. Change environment variables
Section titled “1. Change environment variables”export SUPADO_API_KEY="sk-supado-..."export SUPADO_BASE_URL="https://supado.com/v1"Keep your old provider key available in a separate secret until the migration is verified.
2. Change SDK configuration
Section titled “2. Change SDK configuration”Before:
import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY,});After:
import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.SUPADO_API_KEY, baseURL: process.env.SUPADO_BASE_URL ?? "https://supado.com/v1",});3. Send one known request
Section titled “3. Send one known request”Use a prompt with a predictable output shape so you can compare behavior:
const response = await client.chat.completions.create({ model: "gpt-4o-mini", messages: [ { role: "user", content: "Return exactly three bullet points about API gateway migration.", }, ],});Rollout
Section titled “Rollout”Before routing more traffic:
- The app sends requests to
https://supado.com/v1. - The request succeeds with the Supado key.
- The Supado console shows the request log.
- Your server logs do not print the API key.
- Error handling preserves Supado response status and body.
- Retry logic does not retry
401,403, or invalid request400responses.
Avoid changing gateway, model, prompts, and retries in one deploy. Keep rollback possible until Supado logging and error handling are confirmed. Test optional fields against the target model before production use.
For streaming applications, complete this migration first with non-streaming requests, then follow Streaming Responses.