Docs

Migration guide

Migrate from OpenAI

Keep the official openai package. Point it at Silicon Network, give it a Silicon Network key, and pick an open weight model.

What changes

Before and after
OpenAISilicon Network
Base URLhttps://api.openai.com/v1 (the default)https://api.siliconnetwork.io/v1
Keysk-...sn_live_..., from the API Keys page
Modelsgpt-4o-mini, text-embedding-3-small, ...llama-3.2-3b, llama-3.1-8b, gpt-oss-120b, fast, best, bge-m3, ...
Clientopenai (Python, Node)the same package, unchanged

Python

before.py
from openai import OpenAI client = OpenAI()  # reads OPENAI_API_KEY resp = client.chat.completions.create(    model="gpt-4o-mini",    messages=[{"role": "user", "content": "Say hello in one line."}],)print(resp.choices[0].message.content)
after.py
import os from openai import OpenAI client = OpenAI(    base_url="https://api.siliconnetwork.io/v1",    api_key=os.environ["SILICON_API_KEY"],) resp = client.chat.completions.create(    model="llama-3.1-8b",    messages=[{"role": "user", "content": "Say hello in one line."}],    extra_body={"models": ["fast"]},  # optional: fall back to any fast model)print(resp.choices[0].message.content) # streaming works as beforestream = client.chat.completions.create(    model="llama-3.1-8b",    messages=[{"role": "user", "content": "Write a haiku about silicon."}],    stream=True,)for chunk in stream:    if chunk.choices:        print(chunk.choices[0].delta.content or "", end="", flush=True)print()

Silicon Network fields that the OpenAI SDK does not know (models fallback lists, quality, enable_thinking, metadata.project) go in extra_body in Python and as extra fields in Node.

TypeScript

before.ts
import OpenAI from "openai"; const client = new OpenAI(); // reads OPENAI_API_KEY const res = await client.chat.completions.create({  model: "gpt-4o-mini",  messages: [{ role: "user", content: "Say hello in one line." }],});console.log(res.choices[0].message.content);
after.ts
import OpenAI from "openai"; const client = new OpenAI({  baseURL: "https://api.siliconnetwork.io/v1",  apiKey: process.env.SILICON_API_KEY,}); const res = await client.chat.completions.create({  model: "llama-3.1-8b",  messages: [{ role: "user", content: "Say hello in one line." }],});console.log(res.choices[0].message.content);

Without touching the code

Both official SDKs read their base URL and key from the environment when the code does not pass them, so an app that calls OpenAI() with no arguments can move by configuration alone. The model names in the code still have to change, unless they come from configuration too.

environment - zsh
export OPENAI_BASE_URL=https://api.siliconnetwork.io/v1export OPENAI_API_KEY=sn_live_...

Responses, embeddings and the rest

The Responses API is at /v1/responses, with the same client call. Embeddings, rerank, audio transcription and speech, image generation and edits, Files, Batch and vector stores follow the OpenAI shapes too.

responses_and_embeddings.py
import os from openai import OpenAI client = OpenAI(base_url="https://api.siliconnetwork.io/v1", api_key=os.environ["SILICON_API_KEY"]) resp = client.responses.create(    model="gpt-oss-120b",    instructions="Answer in one sentence.",    input="Why is the sky blue?",)print(resp.output_text) emb = client.embeddings.create(model="bge-m3", input=["first text", "second text"])print(len(emb.data), len(emb.data[0].embedding))

An embedding model answers only while one is loaded: check GET /v1/models for bge-m3 before you move an embedding pipeline.

What does not carry over

Not served
OpenAIInstead
POST /v1/completions (legacy text completions)Use /v1/chat/completions with one user message.
GET /v1/models/{model} (models.retrieve)GET /v1/models lists every model; find the id in it.
POST /v1/moderationsNo moderation route.
Assistants, threads and runsResponses, or chat with your own state.
Fine-tuning jobsNot offered as a job API. For serving a LoRA adapter, see LoRA adapters in the guides.
POST /v1/audio/translationsTranscribe with /v1/audio/transcriptions.
POST /v1/images/variationsUse /v1/images/edits.
RealtimeNot offered. Stream chat completions instead.

Parameters that behave differently

logit_bias, n above 1 and parallel_tool_calls: false are refused with a 400 that names the parameter, rather than ignored. Sampler values out of range (for example temperature above 2) are refused too. An output length above 8,192 tokens is clamped to 8,192, and 8,192 is sent when you set none. See Chat completions.

Checklist

Before you switch traffic
StepDone when
Create a key and add balanceA key from the API Keys page; balance on the Billing page.
Change the base URL and keyThe client sends to https://api.siliconnetwork.io/v1.
Map each model nameEvery model in your code or config is in GET /v1/models, or is fast or best.
Remove routes that do not carry overNo legacy completions, moderations, assistants or models.retrieve calls.
Handle 402 and 429Out of credits and rate limits are caught and logged with Silicon-Request-Id.
Compare answersYour own prompts give acceptable answers on the new models.
Silicon Network›Docs›Guides›Migration guides›OpenAI54 items