Guides
- Quickstart
- 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
- 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
- Compute API
- Architecture
- Changelog
- Glossary
API reference
API guide
Compute API
One base URL and one key for inference and compute: https://api.siliconnetwork.io. List offers for a workload, start an instance from one with a template and spending caps, read its logs and stop it.
Not connected yet
No compute provider is connected, so offers, instances and logs answer 404 Not Found today. The workload templates answer. The examples show the calls as they will work once a provider is connected; until then the SDKs raise ComputeUnavailable and the CLI says so.
How a run works
GET /v1/compute/offers?workload=&priority=lists offers rankedcheapest,fastestorbalanced. Each names its provider, region and price, and when it was checked. Capacity, latency and throughput appear only when the provider reports them.GET /v1/compute/templateslists the templates and their parameters. No template takes a secret: a workload that needs a key gets it from the provider's own secret store.POST /v1/compute/instancesstarts one from an offer. Send anidempotency_key: sending it again returns the same instance. Setmax_runtime_secondsandmax_spend_usd: the instance is stopped at either.fallback: truetries the next compatible offers when the first cannot start.GET /v1/compute/instances/{id}/logs?after=reads its output andPOST /v1/compute/instances/{id}/terminatestops it. The spend shown is only what the provider reported, never an estimate.
Keys and scopes
- Create a key on the API keys page with only the scopes it needs:
compute:readto list and read instances and logs,compute:launchto start and stop them,inferencefor chat. - Give a key that launches a compute spend limit. Past it, the key cannot start instances and the ones it started are stopped.
- Offers and templates need no key. A key held to an IP allowlist cannot use the compute routes yet.
- Console links open from the dashboard only: an API key is refused with
403.
Tools
- Python:
client.computein thesiliconnetworkpackage, which also installs thesiliconcommand. - TypeScript:
client.computein@siliconnetwork/sdk. - Terraform: the
silicon_compute_instanceresource and the offers and templates data sources, inintegrations/terraform-provider-silicon. - MCP: a server for AI assistants that lists offers, launches with confirmed caps, reads logs, stops instances and chats, in
integrations/mcp. - Bruno: a request collection for inference and compute, in
sdks/collections/bruno.
None of these is published to a package registry yet: install them from the repository. Each reads SILICON_API_KEY.
Examples by workload
Replace the provider and offer ids with ones from the offers list. Parameter values are examples, not working values.
AI inference
Inference does not start compute instances: call chat completions with the same key and base URL. Chat completions
curl -s https://api.siliconnetwork.io/v1/chat/completions \
-H "Authorization: Bearer $SILICON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "silicon/auto", "messages": [{"role": "user", "content": "Hello"}]}'AI training
A fine-tuning job from the fine-tune template.
# 1. Offers for ai-training, balanced first
curl -s "https://api.siliconnetwork.io/v1/compute/offers?workload=ai-training&priority=balanced" \
-H "Authorization: Bearer $SILICON_API_KEY"
# 2. Start the fine-tune template on one of them (stops at the caps)
curl -s https://api.siliconnetwork.io/v1/compute/instances \
-H "Authorization: Bearer $SILICON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider_id": "<provider_id from the offer>",
"offer_id": "<offer_id from the offer>",
"workload": "ai-training",
"idempotency_key": "ai-training-run-0001",
"template_id": "fine-tune",
"params": {
"base_model": "org/model-name",
"dataset_url": "https://example.com/data.jsonl",
"method": "lora",
"epochs": 3
},
"max_runtime_seconds": 14400,
"max_spend_usd": "40"
}'
# 3. Follow its logs, then stop it
curl -s "https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/logs?after=0" \
-H "Authorization: Bearer $SILICON_API_KEY"
curl -s -X POST https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/terminate \
-H "Authorization: Bearer $SILICON_API_KEY"Rendering
A frame range of a Blender scene from the render-job template.
# 1. Offers for rendering, fastest first
curl -s "https://api.siliconnetwork.io/v1/compute/offers?workload=rendering&priority=fastest" \
-H "Authorization: Bearer $SILICON_API_KEY"
# 2. Start the render-job template on one of them (stops at the caps)
curl -s https://api.siliconnetwork.io/v1/compute/instances \
-H "Authorization: Bearer $SILICON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider_id": "<provider_id from the offer>",
"offer_id": "<offer_id from the offer>",
"workload": "rendering",
"idempotency_key": "rendering-run-0001",
"template_id": "render-job",
"params": {
"scene_url": "https://example.com/scene.blend",
"frame_start": 1,
"frame_end": 240,
"output_format": "png"
},
"max_runtime_seconds": 7200,
"max_spend_usd": "20"
}'
# 3. Follow its logs, then stop it
curl -s "https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/logs?after=0" \
-H "Authorization: Bearer $SILICON_API_KEY"
curl -s -X POST https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/terminate \
-H "Authorization: Bearer $SILICON_API_KEY"Mining
A miner pointed at your pool and wallet from the miner template.
# 1. Offers for mining, cheapest first
curl -s "https://api.siliconnetwork.io/v1/compute/offers?workload=mining&priority=cheapest" \
-H "Authorization: Bearer $SILICON_API_KEY"
# 2. Start the miner template on one of them (stops at the caps)
curl -s https://api.siliconnetwork.io/v1/compute/instances \
-H "Authorization: Bearer $SILICON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider_id": "<provider_id from the offer>",
"offer_id": "<offer_id from the offer>",
"workload": "mining",
"idempotency_key": "mining-run-0001",
"template_id": "miner",
"params": {
"pool_url": "stratum+ssl://pool.example.com:3333",
"wallet_address": "your wallet address",
"gpu_count": 1
},
"max_runtime_seconds": 86400,
"max_spend_usd": "10"
}'
# 3. Follow its logs, then stop it
curl -s "https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/logs?after=0" \
-H "Authorization: Bearer $SILICON_API_KEY"
curl -s -X POST https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/terminate \
-H "Authorization: Bearer $SILICON_API_KEY"Trading bots
Your bot's container image from the sniping-bot template. Its keys stay in the provider's secret store.
# 1. Offers for trading-bots, fastest first
curl -s "https://api.siliconnetwork.io/v1/compute/offers?workload=trading-bots&priority=fastest" \
-H "Authorization: Bearer $SILICON_API_KEY"
# 2. Start the sniping-bot template on one of them (stops at the caps)
curl -s https://api.siliconnetwork.io/v1/compute/instances \
-H "Authorization: Bearer $SILICON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider_id": "<provider_id from the offer>",
"offer_id": "<offer_id from the offer>",
"workload": "trading-bots",
"idempotency_key": "trading-bots-run-0001",
"template_id": "sniping-bot",
"params": {
"image": "ghcr.io/you/your-bot:1.0",
"restart": "on-failure"
},
"max_runtime_seconds": 86400,
"max_spend_usd": "5"
}'
# 3. Follow its logs, then stop it
curl -s "https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/logs?after=0" \
-H "Authorization: Bearer $SILICON_API_KEY"
curl -s -X POST https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/terminate \
-H "Authorization: Bearer $SILICON_API_KEY"Servers
A plain machine from the plain-server template.
# 1. Offers for servers, balanced first
curl -s "https://api.siliconnetwork.io/v1/compute/offers?workload=servers&priority=balanced" \
-H "Authorization: Bearer $SILICON_API_KEY"
# 2. Start the plain-server template on one of them (stops at the caps)
curl -s https://api.siliconnetwork.io/v1/compute/instances \
-H "Authorization: Bearer $SILICON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider_id": "<provider_id from the offer>",
"offer_id": "<offer_id from the offer>",
"workload": "servers",
"idempotency_key": "servers-run-0001",
"template_id": "plain-server",
"params": {
"image": "ubuntu:24.04",
"ports": "22,443"
},
"max_runtime_seconds": 604800,
"max_spend_usd": "25"
}'
# 3. Follow its logs, then stop it
curl -s "https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/logs?after=0" \
-H "Authorization: Bearer $SILICON_API_KEY"
curl -s -X POST https://api.siliconnetwork.io/v1/compute/instances/$INSTANCE_ID/terminate \
-H "Authorization: Bearer $SILICON_API_KEY"Errors
404 Not Found: no compute provider is connected.402: not enough credits, a spend cap reached, or the key's compute spend limit (refused (key_compute_limit)).403: the key lacks the scope, the organization's compute access is suspended, or the key has an IP allowlist.409: the offer is gone or stale, or the idempotency key was used for another offer.422: an unknown workload, a template parameter that is not valid (named, never echoed), or a workload the provider may not run.503: the provider did not answer. Try again with the same idempotency key.