Switching from OpenAI to SovrGPT
Move an OpenAI application to SovrGPT: swap the base URL and API key, pick a model ID. With a model mapping, context limits and a Python example.
The SovrGPT API speaks the OpenAI schema. Two changes in your client are enough to switch: the base URL and the API key. Then pick a suitable model ID. Streaming, function calling, JSON mode and image input work as they do with OpenAI.
1. Set the base URL
| Before (OpenAI) | After (SovrGPT) |
|---|---|
https://api.openai.com/v1 | https://sovrgpt.com/api/v1 |
In most SDKs: client.base_url = "https://sovrgpt.com/api/v1" or
new OpenAI({ baseURL: "https://sovrgpt.com/api/v1" }).
2. Swap the API key
Replace the OpenAI key (sk-…) with a SovrGPT key (sov_…). You create it under
Settings → API keys; details in
Authentication.
You can also put the SovrGPT key into OPENAI_API_KEY and leave the code unchanged. In that
case, make sure no other OpenAI calls share the same variable.
Pick a model ID
SovrGPT does not know OpenAI IDs such as gpt-4o and answers them with
404 model_not_found (details). Pick an
ID from this table:
| OpenAI | SovrGPT | Context | Notes |
|---|---|---|---|
gpt-4o | stackit-qwen3.8-27b | 262,144 | Our standard Qwen: operated by STACKIT in Germany, no cold start, understands images. Self-operated: qwen3.8-27b (balanced, 131,072, with cold start). |
gpt-4o-mini | gemma-4-12b (default) | 262,144 | Small and fast, with twice the context of gpt-4o-mini. |
gpt-4-turbo | stackit-qwen3.8-27b | 262,144 | More thorough than gemma-4-12b. |
o1 / o1-mini | qwen3.5-9b-deepseek-v4 (reasoning) | 16,384 | Chain of thought in reasoning_content. It counts against max_tokens; with a tight budget the answer comes back empty. |
gpt-4-vision-preview | gemma-4-26b-a4b (vision) | 262,144 | Image input. |
text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002 | bge-m3 | – | The OpenAI IDs map to bge-m3 (1024 dimensions), and that stays so. Existing vectors have to be regenerated. If you need long vectors with a selectable length (dimensions) as with text-embedding-3-*, use stackit-qwen3-vl-embedding-8b (4096, can be shortened to 256, 384, 768, 1024 or 1536, details). |
Watch the context window: /v1/chat/completions does not reject an over-long request. It
is truncated, and you get HTTP 200 with an answer that never saw the part of your prompt that
was cut off. Before switching, check context_window in
GET /v1/models and keep
input + max_tokens below it.
The full catalogue is under Models.
Example: Python
from openai import OpenAI
client = OpenAI(
- api_key=os.environ["OPENAI_API_KEY"],
+ api_key=os.environ["SOVR_API_KEY"],
+ base_url="https://sovrgpt.com/api/v1",
)
resp = client.chat.completions.create(
- model="gpt-4o-mini",
+ model="gemma-4-12b",
messages=[{"role": "user", "content": "Hello!"}],
)Other languages and libraries: SDK examples.
What differs
- Images:
/v1/images/generationsdoes not exist yet (planned). You generate images with Z-Image, Qwen-Image and FLUX.2 in chat or through the MCP server today. - Speech:
/v1/audio/speechand/v1/audio/transcriptionsare available. Model IDs and voices differ from OpenAI's; see Audio. - Assistants API: probably will not be implemented. The product offers similar things through the marketplace and scheduled jobs, both only in the user interface.
- Realtime API (WebRTC): not planned for 2026.
For these gaps you can keep using OpenAI alongside; then only those requests go to OpenAI.
Performance
- Plan for cold starts: self-hosted models need several minutes after a pause
(
cold_start_hintinGET /v1/models). Before nightly jobs, send a small request a few minutes ahead, or use a partner-operated model (tensorx-…,stackit-…) without a cold start. - Use streaming: for longer answers, text appears right away.
- Pick the right model:
gemma-4-12binstead ofqwen3.8-27bsaves money and waiting time when you do not need the depth. - Set
max_tokens: it prevents runaway answers and surprise bills.
Moving your data
- OpenAI threads and assistants cannot be imported directly.
- Embeddings have to be regenerated (different vector space).
- System prompts work unchanged.
For larger migrations (roughly ten applications or more), get in touch; contact details are in the legal notice.