Grid · API Reference

Grid APIs. Payment is auth.

One base URL, OpenAI-style request shapes. Authenticate with an API key, or pay each request with x402.

Start here

Base URL
https://grid.x402compute.cc
JSON APIs
Option 1 · API key and credits
Best for apps and agents

Create a key, top up credits once, send X-API-Key.

Option 2 · x402
No setup
Call without a key and the first answer is a 402 quote. Pay it from your wallet and resend with X-Payment.

Chat quickstart

The same call in three languages, billed to your credits.

curl -X POST https://grid.x402compute.cc/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $SGL_API_KEY" \
  -d '{
    "model": "llama-3.2-3b",
    "messages": [{"role": "user", "content": "Explain TEEs in one sentence."}]
  }'

Inference

Send work to the Grid. Pay per request with x402, or bill prepaid credits with an API key.

POST/v1/chat/completions

OpenAI-compatible chat, streaming supported.

POST/v1/embeddings

Text embeddings in the OpenAI shape.

POST/v1/audio/transcriptions

Speech to text (whisper-1). Sealed JSON contract, not multipart upload.

POST/v1/audio/speech

Text to speech. Sealed JSON contract.

POST/v1/systemone

Decision models: typed questions in, typed answers out.

Models and capacity

Public, read-only. No auth needed.

GET/v1/models

Models currently served by active attested nodes.

GET/grid/models

Served models with per-request pricing and node count.

GET/grid/capacity

Live capacity: active nodes, TEE types, models.

Jobs

History and status for work you have sent.

GET/grid/jobs

Your job history, looked up by wallet address.

GET/grid/jobs/:id

One job: status and result.

Decision models

Singularity xMESH 0.8B answers typed questions about a state: noul, choice or score, up to 16 per request.

LivePOST /v1/systemone
curl https://grid.x402compute.cc/v1/systemone \
  -H "X-API-Key: $SGL_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"singularity-layer/Singularity-xMESH-0.8B",
       "state":"Summarize a transcript and store the brief. Budget $0.05.",
       "questions":{
         "need_enrich":{"type":"noul","instructions":"Does the request need outside data?"},
         "pick_store":{"type":"choice","instructions":"Choose by capability, then price.",
           "criteria":{"storage_1":"cap=object storage; price=0.010","email_1":"cap=email; price=0.001"}}}}'

Errors

Failures use standard status codes with a JSON error body.

CodeMeaningWhat to do
402Payment requiredFirst response of an x402 call. Resend with the X-Payment header.
402Insufficient creditsThe key has no prepaid credits. Top up in Settings, Credits.
401Invalid API keyX-API-Key is unknown or revoked.
403Missing scopeThe key lacks the grid:write scope.
404Model not foundThe model id does not match any active node.
429Rate limitedToo many requests for this wallet. Back off and retry.
503No nodes availableEvery attested node for this model is busy. Try again shortly.