Docs

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

  1. GET /v1/compute/offers?workload=&priority= lists offers ranked cheapest, fastest or balanced. Each names its provider, region and price, and when it was checked. Capacity, latency and throughput appear only when the provider reports them.
  2. GET /v1/compute/templates lists 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.
  3. POST /v1/compute/instances starts one from an offer. Send an idempotency_key: sending it again returns the same instance. Set max_runtime_seconds and max_spend_usd: the instance is stopped at either. fallback: true tries the next compatible offers when the first cannot start.
  4. GET /v1/compute/instances/{id}/logs?after= reads its output and POST /v1/compute/instances/{id}/terminate stops 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:read to list and read instances and logs, compute:launch to start and stop them, inference for 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.compute in the siliconnetwork package, which also installs the silicon command.
  • TypeScript: client.compute in @siliconnetwork/sdk.
  • Terraform: the silicon_compute_instance resource and the offers and templates data sources, in integrations/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
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.

curl
# 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.

curl
# 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.

curl
# 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.

curl
# 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.

curl
# 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.
Silicon Network›Docs›Guides›Compute API50 items