Everything you need to integrate Veles Protocol into your autonomous systems.
Sign up at velesprotocol.xyz/signup and deposit USDC to forge your first ZK spending note.
Go to Console → New Capability. Link it to your note, set death conditions (time, spend ceiling), and copy the key.
Set the API key as an environment variable and make HTTP calls:
export VELES_API_KEY=vv_live_abc123...
/api/v1/x402Make x402 payments through Veles Protocol. We handle 402 Payment Required negotiation via ZK-SNARK notes.
Authorization: Bearer vv_live_xxx Content-Type: application/json
{
"url": "https://api.example.com/paid-endpoint",
"method": "POST",
"headers": { "Custom-Header": "value" },
"body": { "prompt": "Hello world" }
}{
"success": true,
"status": 200,
"data": { /* response from target API */ },
"cost": 0.05,
"balance": 49.95
}401Invalid or missing API key402Insufficient balance in linked note403API key revoked or spending limit exceeded404No note linked to API key500Internal error (payment failed, target unreachable)Enable autonomous agents to manage their own swarms. Create a "commander" API key with management permissions, then use it to programmatically create worker keys, allocate budgets, and monitor fleet health.
# Authenticate with commander key (must have canManage: true)
curl -X POST https://velesprotocol.xyz/api/v1/fleet/keys/bulk \
-H "Authorization: Bearer vv_live_commander_xxx" \
-H "Content-Type: application/json" \
-d '{
"tiers": [
{ "prefix": "worker", "count": 50, "spendLimitDaily": 5, "expiresAt": "7d" },
{ "prefix": "supervisor", "count": 5, "spendLimitDaily": 50 }
]
}'
# Response includes all 55 keys ready for distribution
{
"success": true,
"count": 55,
"keys": [
{ "name": "worker-001", "key": "vv_live_...", "tier": "worker" },
...
]
}Agents with their own wallets can be fully autonomous — no human setup required. The agent creates its own account, funds its own notes, and manages its own fleet.
import { SiweMessage } from 'siwe';
import { ethers } from 'ethers';
import { deposit, encryptNote } from '@prxvt/sdk';
const WALLET_PRIVATE_KEY = process.env.AGENT_WALLET_KEY;
const wallet = new ethers.Wallet(WALLET_PRIVATE_KEY);
// 1. Get nonce
const nonceRes = await fetch(`https://velesprotocol.xyz/api/v1/auth/wallet?address=${wallet.address}`);
const { nonce } = await nonceRes.json();
// 2. Create and sign SIWE message
const siweMessage = new SiweMessage({
domain: 'velesprotocol.xyz',
address: wallet.address,
statement: 'Sign in to Veles Protocol',
uri: 'https://velesprotocol.xyz',
version: '1',
chainId: 1,
nonce,
});
const message = siweMessage.prepareMessage();
const signature = await wallet.signMessage(message);
// 3. Authenticate and get commander key
const authRes = await fetch('https://velesprotocol.xyz/api/v1/auth/wallet', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ message, signature }),
});
const { commanderKey } = await authRes.json();
console.log('Commander key:', commanderKey.key);
// 4. Deposit USDC on-chain (requires wallet to have USDC)
const notePassword = crypto.randomUUID();
const { encrypted, balance } = await deposit('base-sepolia', 100, WALLET_PRIVATE_KEY, notePassword);
// 5. Store the funded note
const noteRes = await fetch('https://velesprotocol.xyz/api/v1/fleet/notes/deposit', {
method: 'POST',
headers: {
'Authorization': `Bearer ${commanderKey.key}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
label: 'Agent Budget',
chain: 'base-sepolia',
userEncryptedNote: encrypted,
notePassword,
balance,
}),
});
const { note } = await noteRes.json();
// 6. Create worker keys
const keyRes = await fetch('https://velesprotocol.xyz/api/v1/fleet/keys', {
method: 'POST',
headers: {
'Authorization': `Bearer ${commanderKey.key}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'worker-001',
noteId: note.id,
spendLimitDaily: 10,
expiresAt: '7d',
}),
});
console.log('Agent is now fully autonomous! 🚀');import requests
import os
API_KEY = os.environ["VELES_API_KEY"]
response = requests.post(
"https://velesprotocol.xyz/api/v1/x402",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"url": "https://ai-api.example.com/chat",
"method": "POST",
"body": {"prompt": "Summarize this document"}
}
)
result = response.json()
print(f"Response: {result['data']}")
print(f"Cost: {result['cost']} USDC")const response = await fetch("https://velesprotocol.xyz/api/v1/x402", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.VELES_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
url: "https://ai-api.example.com/chat",
method: "POST",
body: { prompt: "Summarize this document" }
})
});
const { data, cost, balance } = await response.json();
console.log(`Response: ${data}`);
console.log(`Cost: $${cost}, Remaining: $${balance}`);curl -X POST https://velesprotocol.xyz/api/v1/x402 \
-H "Authorization: Bearer vv_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://ai-api.example.com/chat",
"method": "POST",
"body": {"prompt": "Hello"}
}'