Guides
- Quickstart
- Quickstarts by language
- Migration guides
- Authentication and keys
- Key protection
- Models, aliases and fallbacks
- Automatic model choice (silicon/auto)
- Chat completions
- Streaming
- Structured outputs and tools
- Logprobs
- Vision
- Responses, Claude and Ollama
- Embeddings, rerank, audio, images
- Files and batches
- Documents and search
- LoRA adapters
- Project tags and costs
- Prefix caching
- Headers, rate limits and spend caps
- Errors
- Versioning and the sandbox
- Privacy and retention
- Verifiable receipts
- Data residency
- Pricing
- Billing
- Pay per request (x402)
- On-chain oracle
- Agent credit (backed compute lines)
- Status
- SDKs
- Swift SDK
- Integrations
- Run a node
- Linux agent
- Mac mini fleets
- Compute API
- Architecture
- Changelog
- Glossary
API reference
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
| Anthropic | Silicon Network | |
|---|---|---|
| Base URL | https://api.anthropic.com (the default) | https://api.siliconnetwork.io (no /v1: the SDK adds /v1/messages) |
| Key | sk-ant-..., sent as x-api-key | sn_live_..., sent as x-api-key or Authorization: Bearer |
| Models | Claude model ids | llama-3.1-8b, glm-4.7, gpt-oss-120b, fast, best, ... |
| Client | anthropic (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
| Anthropic | Instead |
|---|---|
| Claude models | Open weight models: GET /v1/models lists what is loaded now. |
| POST /v1/messages/count_tokens | No token counting route. The usage block of each answer has the counts. |
| POST /v1/messages/batches | The 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 shape | GET /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
| Step | Done when |
|---|---|
| Create a key and add balance | A key from the API Keys page; balance on the Billing page. |
| Change the base URL and key | The client sends to https://api.siliconnetwork.io/v1/messages. |
| Map each model name | Every model in your code or config is in GET /v1/models, or is fast or best. |
| Remove what does not carry over | No token counting, Message Batches or Anthropic server tools. |
| Handle 402 and 429 | Out of credits and rate limits are caught and logged with Silicon-Request-Id. |
| Compare answers | Your own prompts give acceptable answers on the new models. |
Silicon Network›Docs›Guides›Migration guides›Claude Messages54 items