Venice Authentication
Every Venice endpoint accepts one of two auth schemes, declared in the OpenAPI spec as BearerAuth and siwx. Both are first-class — pick whichever fits the deployment.
Use when
- You're making your first call to
api.venice.ai. - You're building a server-side integration (usually Bearer) or an agent / no-account wallet flow (x402).
- You hit
401 Authentication failedand need to check header format. - You're implementing SIWE signing manually instead of using the SDK.
Option A — Bearer API key
Authorization: Bearer <VENICE_API_KEY>
- Create keys at <https://venice.ai/settings/api> or via
venice-api-keys. - Keys carry
consumptionLimits(USD and/or DIEM caps) andapiKeyType(ADMINorINFERENCE). - Billing draws from DIEM (staked), USD balance, and bundled credits in order.
- Key types determine which endpoints are reachable — only
ADMINkeys can manage other keys.
curl https://api.venice.ai/api/v1/chat/completions \
-H "Authorization: Bearer $VENICE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zai-org-glm-5-1",
"messages": [{"role":"user","content":"hello"}]
}'
Use the Bearer scheme when you have a Venice account, want usage analytics (/billing/usage-analytics), want to issue scoped child keys, or need DIEM / bundled credit priority.
Option B — x402 wallet (SIWE)
Authenticate with an Ethereum wallet. No account needed. Pay per request in USDC on Base (chain ID 8453). Balance lives under your wallet address and is consumed automatically.
Header
X-Sign-In-With-X: <base64(json)>
Where the decoded JSON is:
{
"address": "0x... (checksummed)",
"message": "<SIWE message string from SiweMessage.prepareMessage()>",
"signature": "0x... (hex)",
"timestamp": 1712659200000,
"chainId": 8453
}
SIWE message fields (EIP-4361)
| Field | Value |
|