Prerequisites
- An EVM wallet on Base controlled by the agent (private key in an env var or secret manager).
- A small amount of ETH on Base for gas (staking is two transactions:
approvethenstake). - Any non-zero amount of VVV to stake. The minting endpoint requires only that the wallet has a non-zero sVVV balance, so 1 VVV is enough to mint a key. See Paying for inference for what you need to actually call paid endpoints.
Steps
1
2
Stake VVV with Venice
Stake the VVV in the Venice Staking Smart Contract at 
When the second transaction confirms, the wallet’s VVV balance decreases and its sVVV balance increases by the same amount. The minting endpoint reads the sVVV balance to confirm the wallet is staked.
0x321b7ff75154472B18EDb199033fF4D116F340Ff. This is two transactions:approve(spender, amount)on the VVV token, wherespenderis the staking contract.stake(amount)on the staking contract.

3
Request a key request for the wallet
Call The response contains two fields:
GET /api/v1/api_keys/generate_web3_key with the staking wallet’s address. The endpoint is unauthenticated.token, a Venice-signed token bound to that wallet. It expires 15 minutes after issuance, so sign and submit it well before then.message, the readable text the wallet signs. It names the wallet, the key type (INFERENCE), the issuer, the chain, a one-time nonce, and the issue and expiration times:
4
Sign the message with the staking wallet
Sign the exact
message string with the wallet that holds the staked VVV. This is a standard personal_sign (EIP-191). Both ethers.Wallet.signMessage(message) and viem’s account.signMessage({ message }) produce the correct signature. Do not modify the message: Venice rebuilds it from the token, and the signature must match it exactly.5
Mint the API key
POST the address, signature, and token to the same endpoint.address, signature, token, apiKeyType. apiKeyType must be INFERENCE: wallet-signed minting does not create ADMIN keys. Create ADMIN keys from API settings.Optional fields:description,expiresAtconsumptionLimit— the spend cap for this key, denominated inusdordiem(vcuis deprecated; usedieminstead)limitPeriod— the window the cap is measured over:EPOCH(resets every UTC day),MONTH(resets on the 1st of each UTC month), orLIFETIME(never resets, so the cap is permanent)modelPrivacy— which models the key may call, by privacy tier:ALL,PRIVATE_TEXT, orPRIVATE_ONLYipAllowlist— IPv4 or IPv6 addresses and CIDR subnets allowed to use the key (up to 100 entries); an empty list allows any IP address
apiKey string. Store it in the agent’s secret store and use it as a normal Bearer token (Authorization: Bearer <key>).End-to-end example
The example below uses a real wallet from an environment variable rather than a randomly generated one. A random wallet has no staked VVV and the mint will be rejected with aWallet 0x… has no staked VVV on Base error.
Error reference
The endpoint returns specific, actionable error messages. Map these in the agent so it can decide whether to retry, request a new token, or stop.Legacy tokens
Before November 2026 the endpoint issued tokens without a wallet address, and the wallet signed the raw token string. Those tokens still mint keys until December 26, 2026 00:00 UTC, and responses for them carryDeprecation, Sunset, and Link headers. After that date, POST rejects them. Switch to ?address= and sign message before then.
Paying for inference
Minting a key and being able to call paid endpoints with it are two separate things. A freshly minted key authenticates correctly but cannot call paid endpoints (such as/chat/completions) until the wallet’s account has a spendable balance.
The minted key can spend from the user account in this priority order: DIEM, then earned credits, then bundled credits, then USD.
If the agent needs a fully crypto-native, headless funding path, the cleanest options are:
- Stake more VVV so the daily DIEM allocation covers the agent’s spend. The minted key picks this up automatically.
- Use the x402 wallet flow instead of the API key. With x402 the agent signs a Sign-In-With-X message per request, tops up directly with USDC on Base or Solana via
POST /api/v1/x402/top-up, and pays per request. The x402 USDC balance is wallet-bound, not user-bound, so it does not show up as balance for the minted Bearer key, but it does let the same wallet pay for inference programmatically.
Related resources
Crypto and Agents
Use Venice as both the model provider and the blockchain RPC layer for autonomous agents.
x402 Wallet Authentication
Pay per request with USDC on Base or Solana, no API key required.
Generate Web3 API Key Endpoint
Endpoint reference for the mint endpoint.
Standard API Key Guide
For users who prefer to mint a key from the dashboard.