Docs

Migration guide

Migrate from Claude Messages

The gateway serves the Messages API at /v1/messages, so the Anthropic SDK works with a new base URL, a Silicon Network key and an open weight model. Claude models are not served here.

What changes

Before and after
AnthropicSilicon Network
Base URLhttps://api.anthropic.com (the default)https://api.siliconnetwork.io (no /v1: the SDK adds /v1/messages)
Keysk-ant-..., sent as x-api-keysn_live_..., sent as x-api-key or Authorization: Bearer
ModelsClaude model idsllama-3.1-8b, glm-4.7, gpt-oss-120b, fast, best, ...
Clientanthropic (Python), @anthropic-ai/sdk (TypeScript)the same packages, unchanged

The request fields the gateway takes: model, messages, system, max_tokens, stream, tools, tool_choice and thinking. The sampler bounds and the 8,192 token output clamp of Chat completions apply here too.

Python

before.py
from anthropic import Anthropic client = Anthropic()  # reads ANTHROPIC_API_KEY msg = client.messages.create(    model="claude-model-id",    max_tokens=512,    system="Answer in one sentence.",    messages=[{"role": "user", "content": "What is trustless inference?"}],)print(msg.content[0].text)
after.py
import os from anthropic import Anthropic client = Anthropic(    base_url="https://api.siliconnetwork.io",    api_key=os.environ["SILICON_API_KEY"],) msg = client.messages.create(    model="llama-3.1-8b",    max_tokens=512,    system="Answer in one sentence.",    messages=[{"role": "user", "content": "What is trustless inference?"}],)print(msg.content[0].text)

Streaming

stream.py
import os from anthropic import Anthropic client = Anthropic(base_url="https://api.siliconnetwork.io", api_key=os.environ["SILICON_API_KEY"]) with client.messages.stream(    model="llama-3.1-8b",    max_tokens=512,    messages=[{"role": "user", "content": "Write a haiku about silicon."}],) as stream:    for text in stream.text_stream:        print(text, end="", flush=True)print()

TypeScript

before.ts
import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic(); // reads ANTHROPIC_API_KEY const msg = await client.messages.create({  model: "claude-model-id",  max_tokens: 512,  messages: [{ role: "user", content: "What is trustless inference?" }],});console.log(msg.content[0].type === "text" ? msg.content[0].text : "");
after.ts
import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({  baseURL: "https://api.siliconnetwork.io",  apiKey: process.env.SILICON_API_KEY,}); const msg = await client.messages.create({  model: "llama-3.1-8b",  max_tokens: 512,  messages: [{ role: "user", content: "What is trustless inference?" }],});console.log(msg.content[0].type === "text" ? msg.content[0].text : "");

curl

A raw HTTP client keeps its headers: x-api-key carries the Silicon Network key, and Authorization: Bearer works as well.

messages - curl
curl https://api.siliconnetwork.io/v1/messages \  -H "x-api-key: $SILICON_API_KEY" \  -H "anthropic-version: 2023-06-01" \  -H "Content-Type: application/json" \  -d '{    "model": "llama-3.1-8b",    "max_tokens": 256,    "messages": [{"role": "user", "content": "Hello"}]  }'

What does not carry over

Not served
AnthropicInstead
Claude modelsOpen weight models: GET /v1/models lists what is loaded now.
POST /v1/messages/count_tokensNo token counting route. The usage block of each answer has the counts.
POST /v1/messages/batchesThe Batch API at /v1/batches, with chat completions lines (see Files and batches).
Server tools that run on Anthropic's side (web search, code execution)Define your own tools; the model calls them and you run them.
The Models API answer shapeGET /v1/models answers in the OpenAI list shape.

Fields not in the list above (under What changes) are not documented for this route. Test anything else your app sends before you move traffic.

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/messages.
Map each model nameEvery model in your code or config is in GET /v1/models, or is fast or best.
Remove what does not carry overNo token counting, Message Batches or Anthropic server tools.
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›Claude Messages54 items