Guides

Move from OpenAI

Change the base URL and the key, and keep the OpenAI SDK. What stays the same, what is different, and three checks to do before you move traffic.

Change the base URL and the key. Keep the openai SDK, your request code, your stream code and your tool calls.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["KONTINENT_API_KEY"],
    base_url="https://api.kontinentai.com/v1",
)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.KONTINENT_API_KEY,
  baseURL: "https://api.kontinentai.com/v1",
});
# Most tools read these, so often no code change at all.
export OPENAI_API_KEY="$KONTINENT_API_KEY"
export OPENAI_BASE_URL="https://api.kontinentai.com/v1"

What stays the same

  • Chat completions and the Responses API, with streams and tool calls.
  • Structured output on GPT and Gemini models.
  • The parameters temperature, top_p, seed, stop and logprobs.
  • The usage object, finish_reason, Idempotency-Key and the error format.

The model ids

The GPT models have the same ids as at OpenAI, for example gpt-5.5 and gpt-5. The same key also gives you access to Claude and Gemini models. See Models for the full list.

If you useA model to try first
A GPT model that we serveThe same id
A small, fast model for classification or extractiongemini-3.5-flash or claude-haiku-4-5-20251001
A large model for codeclaude-sonnet-5-5 or gpt-5.5

These are suggestions, not equivalents. Do your own tests on your own prompts.

Three checks before you move traffic

  1. Each model id exists. GET /v1/models needs no key, so a short script can do this check.
  2. Each capability that you use is in the catalogue. Look at supported_parameters. If you send tools or response_format to a model that does not show it, you get a 400 error.
  3. Each model works on your endpoint. Claude and Gemini models do not work on /v1/responses. See Supported endpoints.

What is not available

Embeddings, images, audio, moderations, assistants and batches. n larger than 1. See Not supported yet. If your app uses embeddings, keep that part at its current provider. You can use two clients with two base URLs.

Errors

A 402 error means that your balance is too low. It has the type insufficient_quota, so the error classes of the SDK work. The rate limit is 60 requests a minute for each key. See Errors and Rate limits.