§ P.01 · Inference

OpenAI-compatible completions.
Receipt on every response.

/v1/chat/completions is a drop-in replacement for OpenAI's endpoint — same request shape, same streamed and non-streamed response shapes. The difference is the X-Plumb-Receipt response header: every completion is signed with ed25519 over a canonical payload covering the request hash, response hash, model id, and cost. The signature is verifiable client-side against a public key registry; the receipt itself is queryable at explorer.plumbtech.xyz.

Plumb's routing layer sits in front of your provider keys (OpenAI, Anthropic, your own vLLM / llama.cpp). Cost is debited from an on-chain PLMB credit balance in the same transaction as the receipt — no race between debit and sign. If the upstream errors, no debit, no receipt.

Batches of receipts are checkpointed on Base Sepolia nightly viaSettlement.checkpointReceipts(root, merkleBatch). The root is recoverable from the batcher logs; inclusion proofs let a caller verify that a receipt was settled on-chain without trusting the operator.

EX.01

Drop-in with the OpenAI Python SDK

example · python · openai client
from openai import OpenAI

client = OpenAI(
    base_url="https://api.plumbtech.xyz/v1",
    api_key="plumb_live_...",  # session token or API key
)

resp = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "explain ed25519 briefly"}],
)

# The receipt id rides in the response headers.
receipt_id = resp._request_id  # or read X-Plumb-Receipt
print(resp.choices[0].message.content)
print("receipt →", receipt_id)
GUIDE

5-minute Python SDK quickstart
Full SDK reference
Per-model pricing in micro-PLMB