Public specOpenAI 1.0 compatible
The wire protocol is OpenAI. The settlement is Solana.
A curated tour of the pieces builders integrate against. The full reference lives in wattz-inference-gateway.
Quickstart
Point any OpenAI client at the Wattz gateway. Response envelope and SSE contract are identical to OpenAI 1.0.
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.WATTZ_API_KEY,
baseURL: 'https://api.wattz.fi/v1',
});
const stream = await client.chat.completions.create({
model: 'llama-3-8b-instruct',
messages: [{ role: 'user', content: 'Explain Solana Token-2022 hooks.' }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}Model registry
Registry entries live as PDAs seeded with model_id. Each entry stores license, checksum, and version. Publishing a model reserves the PDA and pays a small $WATTZ registration fee.
#[account]
pub struct ModelRegistry {
pub authority: Pubkey,
pub model_id: String, // 'llama-3-8b-instruct'
pub license: LicenseClass, // Apache | Llama | MIT | OpenRAIL | Commercial
pub weights_checksum: [u8; 32],
pub version: u16,
pub published_at: i64,
pub kyc_gated: bool,
}Compute attestation
Every inference response carries an attestation quote. Clients that need extra assurance may request a Risc0 or SP1 receipt for the tokenizer + sampler path.
POST /v1/chat/completions
{
"model": "mistral-7b-instruct-v0.3",
"messages": [...],
"wattz": {
"attestation": "sgx",
"zk_receipt": "risc0"
}
}
// response tail
data: {"type":"attestation","attestation":{
"proofHash":"9ab5...",
"attestationType":"sgx",
"verifier":"wattz-compute-verifier v0.9.4",
"timestamp":1735689600000
}}Streaming settlement
Callers pre-authorize a $WATTZ escrow. Each token triggers a Token-2022 transfer hook, splitting revenue between node, host, and treasury. Anchor bulk-settles hourly.
SPLIT node: 68% // GPU operator host: 22% // Model publisher treasury: 10% // Buyback + burn, grants, audits
Operator CLI
npm i -g wattz-cli. The CLI wraps node runtime, key management, and Anchor calls.
wattz node init --region us-east wattz node stake 25000 wattz node start --models llama-3-8b,mistral-7b wattz infer --model llama-3-8b --prompt 'Hello' wattz payouts --last 7d