The wire protocol is OpenAI. The settlement is Solana.
A tour of what builders integrate against. The full reference lives in wattz-compute/wattz.
- 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" }.
GUDVbE4Jgmtu8jgxUVtq2wUmjdLxJzPqT3zET2EdTLiURead straight from devnet
GUDVbE4Jgmtu8jgxUVtq2wUmjdLxJzPqT3zET2EdTLiUPoint 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
}'Surface the gateway exposes
/v1/models/v1/chat/completions/v1/embeddings/v1/images/generations/healthz/metrics/v1/network/statsRaw 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]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
}}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
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,
}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 CPIRun 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