wattz
Public specOpenAI 1.0 compatibledevnet

The wire protocol is OpenAI. The settlement is Solana.

A tour of what builders integrate against. The full reference lives in wattz-compute/wattz.

Where this stands today
  • Wattz runs on Solana devnet. The settlement program is deployed and live below.
  • Inference is relayed through Groq LPU capacity until the first bare-metal node registers. The wire protocol does not change.
  • Attestation frames ship with native nodes. The bootstrap relay path reports { verified: false, kind: "relay" }.
program idGUDVbE4Jgmtu8jgxUVtq2wUmjdLxJzPqT3zET2EdTLiU
Live program inspector

Read straight from devnet

Open on Explorer
program idGUDVbE4Jgmtu8jgxUVtq2wUmjdLxJzPqT3zET2EdTLiU
querying getAccountInfo...
Quickstart

Point any OpenAI client at the gateway

The response envelope and SSE contract are identical to OpenAI 1.0. Change the base URL and you are done. During the bootstrap phase the Authorization header is optional.

// Option A: your existing OpenAI SDK, one line changed
// npm i openai
import OpenAI from 'openai';

const client = new OpenAI({
  // Keys are optional during the bootstrap phase (see Authentication).
  apiKey: process.env.WATTZ_API_KEY ?? 'not-required-yet',
  baseURL: 'https://api.wattz.fi/v1',
});

const stream = await client.chat.completions.create({
  model: 'llama-3.1-8b-instant',
  messages: [{ role: 'user', content: 'Summarize the Wattz settlement flow.' }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}

// Option B: the native SDK, same call shape, no baseURL to set
// npm i @wattz/sdk
import { WattzClient } from '@wattz/sdk';

const wattz = new WattzClient(); // defaults to https://api.wattz.fi/v1
const res = await wattz.chat.completions.create({
  model: 'llama-3.1-8b-instant',
  messages: [{ role: 'user', content: 'Summarize the Wattz settlement flow.' }],
  stream: true,
});

Or with curl:

curl https://api.wattz.fi/v1/chat/completions \
  -H 'content-type: application/json' \
  -H 'authorization: Bearer $WATTZ_API_KEY' \
  -d '{
    "model": "llama-3.1-8b-instant",
    "messages": [{ "role": "user", "content": "ping" }],
    "stream": true
  }'
Endpoint reference

Surface the gateway exposes

GET/v1/models
Registry snapshot in OpenAI list format. Relay-live models are selectable now; native-only models list as awaiting node.
POST/v1/chat/completions
Chat completions, streaming or blocking. Request and response envelopes are OpenAI-identical.
POST/v1/embeddings
Embedding vectors. OpenAI-compatible request shape; served once an embedding node registers.
POST/v1/images/generations
Image generation. Awaiting a native image node before it accepts traffic.
GET/healthz
Liveness probe. Returns 200 while the process is up.
GET/metrics
Prometheus exposition for the gateway.
GET/v1/network/stats
Live network counters: relay-live model count, catalog size, relay state, external node count.
Streaming format

Raw OpenAI chunks over SSE

Streaming responses are unmodified OpenAI chat completion chunks, one per data: line, terminated by data: [DONE]. No Wattz-specific frames are injected into the stream on the relay path. The final chunk carries the usage block. Below is a trimmed real transcript captured from api.wattz.fi.

data: {"id":"chatcmpl-932aed98","object":"chat.completion.chunk",
       "model":"llama-3.1-8b-instant",
       "choices":[{"index":0,"delta":{"role":"assistant","content":""},
                   "finish_reason":null}]}

data: {"id":"chatcmpl-932aed98","object":"chat.completion.chunk",
       "model":"llama-3.1-8b-instant",
       "choices":[{"index":0,"delta":{"content":"Hello"},
                   "finish_reason":null}]}

data: {"id":"chatcmpl-932aed98","object":"chat.completion.chunk",
       "model":"llama-3.1-8b-instant",
       "choices":[{"index":0,"delta":{},"finish_reason":"stop"}],
       "usage":{"prompt_tokens":42,"completion_tokens":5,"total_tokens":47}}

data: [DONE]
Attestation and metadata

What the gateway stamps on a response

Non-streaming responses carry a wattz metadata block alongside the standard OpenAI fields. On the bootstrap relay path the attestation is honest about its origin: it is not a hardware attestation.

{
  "id": "chatcmpl-497b18ef",
  "object": "chat.completion",
  "model": "llama-3.1-8b-instant",
  "choices": [ /* ...standard OpenAI choices... */ ],
  "usage": { "prompt_tokens": 42, "completion_tokens": 6, "total_tokens": 48 },
  "wattz": {
    "request_id": "f6f101ee-0a06-4b5f-8a25-1da173229ffd",
    "provider": "groq",
    "node": {
      "pubkey": "GroqUsEast11111111111111111111111111111111",
      "region": "us-east",
      "is_bootstrap_fallback": true
    },
    "attestation": { "verified": false, "kind": "relay" },
    "settlement": { "simulated": true, "receipt_pda": "48JHQd9U...", "slot": null },
    "price_lamports": 1
  }
}

The same routing metadata is mirrored onto response headers (and exposed via CORS):

x-wattz-node:        GroqUsEast11111111111111111111111111111111
x-wattz-region:      us-east
x-wattz-attestation: relay
x-wattz-request-id:  f6f101ee-0a06-4b5f-8a25-1da173229ffd

Native Wattz nodes emit an additional streamed attestation frame. It is not present on the bootstrap relay and only appears once a bare-metal node serves the request:

// Emitted only by native Wattz nodes -- not present on the bootstrap
// relay. On the relay path attestation is { "verified": false, "kind": "relay" }.
data: {"type":"attestation","attestation":{
  "verified": true,
  "kind": "sgx"        // sgx | sev-snp | nvidia-cc | risc0 | sp1
}}
Authentication

Open during bootstrap

API keys are not enforced during the bootstrap phase; the gateway is open and rate-limited. Key issuance ships with mainnet settlement. The Authorization header is accepted and ignored today, so you can wire it in now and it will start mattering later.

# Optional today, required at mainnet settlement.
authorization: Bearer $WATTZ_API_KEY
Model registry

Models live as on-chain PDAs

Registry entries live as PDAs seeded with the model id. Each entry stores license, weights checksum, and version. Publishing a model reserves the PDA and, at launch, pays a small $WATTZ registration fee.

#[account]
pub struct ModelRegistry {
    pub authority: Pubkey,
    pub model_id: String,       // 'llama-3.1-8b-instant'
    pub license: LicenseClass,  // Apache | Llama | MIT | OpenRAIL | Commercial
    pub weights_checksum: [u8; 32],
    pub version: u16,
    pub published_at: i64,
    pub kyc_gated: bool,
}
Settlement

Fees split and burn on-chain

Callers pre-authorize an escrow. On settlement the Anchor program splits the fee per constants.rs and burns half of the project fee directly. Token-2022 streaming settlement activates with the $WATTZ mint at launch.

SETTLEMENT SPLIT   // anchor-program constants.rs
  node immediate    80%   // released on settlement
  node pending      10%   // held through the dispute window
  model publisher    5%   // registry royalty
  project fee        5%   // of which half is burned:
                          //   BURN_RATE_BPS = 5000 (50% of project fee) -> 2.5% of price,
                          //   burned via a direct SPL Token Burn CPI
Operator CLI

Run a node from the terminal

The CLI wraps the node runtime, key management, and Anchor calls. Registration is live on devnet now.

npm install -g wattz-cli
wattz node init --region us-east --model llama-3-8b-instruct
wattz node start
wattz node status
wattz stake --amount 100