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
Quickstart
curl quickstart
No package at all: the API is plain HTTPS and JSON. These work from any terminal, and translate directly to any HTTP client.
1. Set the key and send one request
chat - curl
export SILICON_API_KEY=sn_live_... curl https://api.siliconnetwork.io/v1/chat/completions \ -H "Authorization: Bearer $SILICON_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "llama-3.2-3b", "messages": [{"role": "user", "content": "Say hello in one line."}] }'Create the key on the API Keys page. The answer is an OpenAI chat completion; the text is in choices[0].message.content. Add -i to see the gateway's headers: Silicon-Request-Id, Silicon-Model, Silicon-Node and the rate-limit budget.
2. Stream the answer
stream - curl
curl -N https://api.siliconnetwork.io/v1/chat/completions \ -H "Authorization: Bearer $SILICON_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "llama-3.2-3b", "stream": true, "messages": [{"role": "user", "content": "Write a haiku about silicon."}] }'-N turns off curl's buffering. The answer is server sent events: one data: line per chunk, each with choices[0].delta.content, ending with data: [DONE].
3. List the models
models - curl
curl https://api.siliconnetwork.io/v1/models \ -H "Authorization: Bearer $SILICON_API_KEY"The list is what the network is serving now, with each model's aliases. Any id or alias in it works as model.
4. Read an error
errors - curl
status=$(curl -sS -o response.json -w "%{http_code}" https://api.siliconnetwork.io/v1/chat/completions \ -H "Authorization: Bearer $SILICON_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "llama-3.2-3b", "messages": [{"role": "user", "content": "Hi"}]}') if [ "$status" = "200" ]; then cat response.jsonelse echo "HTTP $status" cat response.json # the message, and Silicon-Request-Id is in the headers (-i)fiStatuses worth handling
| Status | Meaning |
|---|---|
| 401 | No key, or a revoked or unknown one. |
| 402 | Insufficient credits, or a spend cap reached. Add balance or raise the cap. |
| 403 | The key may not use this model, route or IP. |
| 429 | Rate limited. Wait the Retry-After seconds, then retry. |
| 5xx | The gateway or the serving node failed. 502, 503 and 504 are refused before any work is done or billed, so retrying them is safe. |
Next: Streaming, Headers, rate limits and spend caps, and Errors.
Silicon Network›Docs›Guides›Quickstarts by language›curl54 items