Quickstart
Get a key, make a chat call and read its receipt.
Start / quickstart
You need an EVM wallet. A new account gets a one-time $1.00 credit, and the call on this page costs about 21 micro-USD of it.
1. Sign in and create a key
Open /dashboard, connect your wallet on Robinhood Chain (chain id 4663) and sign the SIWE message. Create a key and copy the secret before you close the dialog. Provn shows it once.
export PROVN_API_KEY="sk-provn-..."2. Set the base URL
The examples in these docs use https://YOUR-PROVN-HOST/v1. Replace YOUR-PROVN-HOST with the host of the Provn deployment you signed in to. The gateway serves its API under /v1 on that host.
3. Make a call
import os
from openai import OpenAI
client = OpenAI(
base_url="https://YOUR-PROVN-HOST/v1",
api_key=os.environ["PROVN_API_KEY"],
)
raw = client.chat.completions.with_raw_response.create(
model="provn",
messages=[{"role": "user", "content": "Name one prime number."}],
)
completion = raw.parse()
print(completion.choices[0].message.content)
print(raw.headers["x-provn-receipt"])
print(raw.headers["x-provn-receipt-sig"])import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://YOUR-PROVN-HOST/v1",
apiKey: process.env.PROVN_API_KEY,
});
const { data, response } = await client.chat.completions
.create({
model: "provn",
messages: [{ role: "user", content: "Name one prime number." }],
})
.withResponse();
console.log(data.choices[0].message.content);
console.log(response.headers.get("x-provn-receipt"));
console.log(response.headers.get("x-provn-receipt-sig"));curl -i https://YOUR-PROVN-HOST/v1/chat/completions \
-H "Authorization: Bearer $PROVN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "provn",
"messages": [{ "role": "user", "content": "Name one prime number." }]
}'4. Read the receipt
The -i flag prints response headers. Provn adds five:
x-provn-request-id: req_4tQ8...
x-provn-cost-micro-usd: 21
x-provn-receipt: eyJ...
x-provn-receipt-sig: 0x...
x-provn-receipt-signer: 0x...The receipt is base64url-encoded JSON. Decode it to see the payload the gateway signed:
node -e 'console.log(Buffer.from(process.argv[1], "base64url").toString())' "$RECEIPT"Paste the receipt and signature into /verify to check the signature in your browser, or follow the Verification page to do it in code.
Next
- Streaming: token-by-token output with the receipt as the last event.
- API keys: cap what each key can spend.
- Sandboxes: run JavaScript on the same key and balance.
- Runs and audit packs: chain an agent session's receipts together.