krewe

Reference

Three endpoints. That's the whole API.

krewe's orchestrator exposes a deliberately small surface: a public stats feed, a single inference dispatch route, and a worker WebSocket for miners.

GET

/v1/stats

Public. No authentication. Edge-cached for ten seconds. Returns the current network state as JSON. The landing page's live counter strip is fed by this endpoint.

curl https://krewe-orchestrator-production.up.railway.app/v1/stats

{
  "activeNodes": 3,
  "jobsInFlight": 0,
  "pendingRewardsWei": "0",
  "lifetimeRewardsWei": "15000000000000000000",
  "onChainPoolWei": "9999985000000000000000000",
  "ts": 1779046686467
}

POST

/v1/inference

Authenticated. Send an x-api-key header. Body specifies the task kind and a payload whose shape depends on the kind.

Supported kinds today: text.structure, text.embed, web.scrape, agent.step.

curl https://krewe-orchestrator-production.up.railway.app/v1/inference \
  -H "content-type: application/json" \
  -H "x-api-key: $KREWE_API_KEY" \
  -d '{
    "kind": "text.structure",
    "payload": {
      "text": "Email jq@krewe.network or visit https://krewe.network"
    }
  }'

WS

/v1/worker/connect

For miners only. Outbound WebSocket connection from the miner CLI to the orchestrator. The miner sends an HMAC-authenticated authframe using the shared handshake secret, then receives jobframes and replies with result / fail frames.

The protocol is versioned (v: 1); unknown frame types are non-fatal so the orchestrator can ship new kinds without breaking older miners.

Rate limits

Per-key, per-minute

The MVP rate-limits /v1/inference at 60 requests per minute per API key, with no concurrent-request cap. Mainnet will move to per-client signed JWTs so limits can be revoked or rotated without redeploying the orchestrator.