Docs / Keys and caps
Keys and caps
API keys with spend caps, windows, model lists, expiry, rate limits and sub-keys.
Keys are minted in the portal after a wallet sign-in. A key looks like vn_YOUR_KEY, is shown once, and is stored only as a sha256 hash.
Limits on a key
| Setting | What it does |
|---|---|
cap_usd + window | A hard spend cap that refills per day, week or month, or none for a one-off budget. |
models | An allowlist of model ids. Empty means every model. |
expires_at | After this time the key stops working. |
rpm | Requests a minute (default 60, at most 600). |
| Freeze | A key that spends over four times its cap rate within ten minutes freezes itself until you unfreeze it. |
Sub-keys
A key can make a sub-key for an agent with POST /v1/keys/delegate. A sub-key can never cap higher than what its parent has left in its window, use a longer window, call a model its parent cannot, or outlive its parent. Spending is charged up the chain. Revoking a key revokes every key made from it.
curl -X POST https://veilnetwork.app/v1/keys/delegate \
-H "Authorization: Bearer $API_KEY" -H "content-type: application/json" \
-d '{"name":"worker-1","cap_usd":0.5,"window":"day","models":["anthropic/claude-haiku-5.5"]}'
# -> { "key": "vn_YOUR_KEY", "id": "key_…", "info": { ... } }
Check a key
GET /v1/me with the key returns its limits and the wallet's allowance for today.