One credential, two superpowers
A single API key (or wallet) for both LLM inference and JSON-RPC calls.
11 chains supported
Ethereum, Base, Arbitrum, Optimism, Polygon, Linea, Avalanche, BSC, Blast, zkSync Era, and Starknet (mainnet plus testnets).
Stake VVV for headless funding
Stake VVV on Base to earn daily DIEM, the only fully headless funding path for a minted API key. USD and crypto top-ups are also available through the dashboard.
Keyless auth via x402
Agents can authenticate with a wallet signature and pay in USDC on Base.
Why Venice for on-chain agents?
| Capability | What your agent gets |
|---|---|
| Inference | 230+ text, image, video, audio, and embedding models through one OpenAI-compatible endpoint |
| Crypto RPC | JSON-RPC 2.0 proxy to 10 EVM chains plus Starknet (mainnet and testnets) |
| Authentication | Standard API key or x402 wallet auth (no Venice account required) |
| Funding | Autonomous: VVV staking for daily DIEM. Browser: USD or crypto top-ups via the dashboard |
| Batching | Up to 100 JSON-RPC calls per request, multi-chain in parallel |
| Idempotency | Safe retries with Idempotency-Key header |
Authentication
Pick the auth method that matches how your agent runs.| Method | Best for | How it works |
|---|---|---|
| API key | Server-side agents, fixed deployments | Authorization: Bearer <key> header. Get a key at venice.ai/settings/api. |
| x402 wallet | Autonomous, crypto-native, or short-lived agents | Wallet signs a SIWE message, pays per request in USDC on Base. No Venice account needed. See the x402 guide. |
Crypto RPC quickstart
Send any JSON-RPC 2.0 method toPOST /crypto/rpc/{network}.
X-Venice-RPC-Credits (credits charged), X-Venice-RPC-Cost-USD (dollar cost), and X-Request-ID (correlation ID).
Supported networks
| Family | Mainnet | Testnets |
|---|---|---|
| Ethereum | ethereum-mainnet | ethereum-sepolia, ethereum-holesky |
| Base | base-mainnet | base-sepolia |
| Arbitrum | arbitrum-mainnet | arbitrum-sepolia |
| Optimism | optimism-mainnet | optimism-sepolia |
| Polygon | polygon-mainnet | polygon-amoy |
| Linea | linea-mainnet | linea-sepolia |
| Avalanche C-Chain | avalanche-mainnet | avalanche-fuji |
| BNB Smart Chain | bsc-mainnet | bsc-testnet |
| Blast | blast-mainnet | blast-sepolia |
| zkSync Era | zksync-mainnet | zksync-sepolia |
| Starknet | starknet-mainnet | starknet-sepolia |
GET /crypto/rpc/networks for the live, authoritative list.
Method tiers
Methods are grouped into three credit tiers. Total cost =baseCredits[chain] × methodTier.
| Tier | Multiplier | Examples |
|---|---|---|
| Standard | 1x | eth_call, eth_getBalance, eth_blockNumber, eth_sendRawTransaction, eth_getLogs, eth_getTransactionReceipt, eth_estimateGas |
| Advanced | 2x | trace_block, trace_call, trace_transaction, debug_traceCall, debug_traceTransaction |
| Large | 4x | trace_replayBlockTransactions, trace_replayTransaction, txpool_content |
Agent recipes
Common patterns for AI agents that need to read and write on-chain.Read a wallet’s native balance
Read ERC-20 token balance
Call thebalanceOf(address) selector with eth_call. The data field is the 4-byte selector (0x70a08231) followed by the wallet address left-padded to 32 bytes. Easiest to let a library encode it:
Send a signed transaction (full lifecycle)
Venice never holds your private keys. The agent gathers tx parameters via RPC reads, signs locally with a library like viem or ethers, then relays the raw hex through Venice.Get gas price
eth_feeHistory to compute maxFeePerGas and maxPriorityFeePerGas.Submit through Venice
Idempotency-Key on relays so a network blip can’t double-broadcast.Every
eth_sendRawTransaction call is logged server-side with the tx hash, network, request ID, and calling user ID. The signed payload itself is not retained. This audit trail exists so compromised keys used for illicit relays can be traced back to the responsible account.Batch multiple calls (multi-chain portfolio check)
Send up to 100 JSON-RPC objects in one request. Each is validated and billed independently.{network} endpoints.
Safe retries with idempotency
Set theIdempotency-Key header to any string matching [A-Za-z0-9_-]{1,255}. Venice caches the response for 24 hours keyed on (user, key). Replays return the cached result with Idempotent-Replayed: true and charge nothing.
Funding the agent’s API key
Once the agent has a Venice API key, it needs spendable balance on the underlying account before paid endpoints will accept the key. There are two ways to put balance there:| Path | Autonomous? | How it works |
|---|---|---|
| DIEM from VVV staking | Yes | Stake VVV in the Venice Staking Smart Contract on Base. The wallet’s daily DIEM allocation is proportional to its share of the staking pool. The account needs at least 0.1 DIEM accrued before any DIEM is spendable. DIEM refreshes at 00:00 UTC. To grow daily spend, stake more VVV. |
| USD or crypto top-up via the dashboard | No (browser) | Sign into venice.ai with the same wallet (Sign-In-With-Ethereum), then add credits in Settings, API. Both Stripe (card) and Coinbase (crypto) live behind that page and require a browser. Credits never expire. |
Autonomous VVV staking and key generation
A truly autonomous agent can manage its own VVV wallet on Base, stake it, and mint its own Venice API key with no human in the loop. The full flow:Stake VVV
approve the staking contract on the VVV token, then stake(amount) on 0x321b7ff75154472B18EDb199033fF4D116F340Ff. The wallet’s sVVV balance updates atomically with the stake.x402 wallet auth in 30 seconds
If your agent already has a Base wallet, skip the API key entirely. Thevenice-x402-client SDK handles SIWE signing, top-ups, and balance tracking.
/crypto/rpc/{network} for blockchain reads and writes. Full protocol details in the x402 guide.
Pricing
Crypto RPC is billed in Venice credits. Each response includesX-Venice-RPC-Credits (credits charged) and X-Venice-RPC-Cost-USD (dollar cost) so your agent can track spend per request.
Base credits per chain
| Base credits | Chains |
|---|---|
| 20 | Ethereum, Base, Optimism, Arbitrum, Polygon, Linea, Avalanche, BSC, Blast, Starknet |
| 30 | zkSync Era |
Cost examples
Observed pricing for standard, advanced, and large method tiers:| Call | Credits | USD cost |
|---|---|---|
eth_call on Ethereum (20 × 1x) | 20 | ~$0.0000140 |
trace_transaction on Ethereum (20 × 2x) | 40 | ~$0.0000280 |
trace_replayTransaction on Ethereum (20 × 4x) | 80 | ~$0.0000560 |
eth_call on zkSync (30 × 1x) | 30 | ~$0.0000210 |
X-Venice-RPC-Cost-USD response header for the authoritative cost. Errored items in batch requests are billed at a flat 5 credits each.
Rate limits
| Tier | Requests per minute |
|---|---|
| Standard | 100 |
| Staff | 1,000 |
429 with standard X-RateLimit-* response headers.
Error handling
Common HTTP responses your agent should handle:| Status | Meaning | What to do |
|---|---|---|
400 | Unsupported or unmapped JSON-RPC method, or malformed batch | Verify the method against the allowlist. The error body names the offending method. |
400 | Replay of an Idempotency-Key with a different body | Use a fresh key for distinct requests. |
402 | No auth header at all (response body includes authOptions listing both supported auth paths), or out of credits with a valid auth header | If no auth: attach Authorization: Bearer ... or the x402 X-Sign-In-With-X header. If out of credits: with a Bearer key, fund the account (DIEM, USD, or dashboard top-up); with x402 auth, call POST /api/v1/x402/top-up directly. |
429 | Rate limit hit (100 req/min standard, 1,000 req/min staff) | Honor X-RateLimit-Reset and back off. Batch up to 100 calls per request to amortize the limit. |
5xx | Upstream RPC node hiccup | Retry with the same Idempotency-Key to avoid double-charging. |
200 OK response with a JSON-RPC error field on the offending item. Those items are billed at a flat 5 credits each.
Not supported
These categories of methods are intentionally rejected:- WebSocket-only (
eth_subscribe,eth_unsubscribe): the proxy is HTTP-only. Poll instead. - Stateful filters (
eth_newFilter,eth_getFilterChanges, etc.): filter state is pinned to a single backend and breaks on a load-balanced proxy. Useeth_getLogsinstead. - Key-holding methods (
eth_sign,eth_accounts,eth_mining): hosted providers don’t hold user keys. Sign client-side and submit viaeth_sendRawTransaction. - Unmapped methods: anything not allowlisted returns
400. Contact support to request additions.
Resources
Crypto RPC API Reference
Full method list, pricing, and response headers
Supported Networks
Live list of supported network slugs
x402 Wallet Auth
Authenticate and pay with a Base wallet
Autonomous Agent API Key
Mint your own key by staking VVV
Postman Collection
27 ready-to-run Crypto RPC examples
Pricing
DIEM, credit pricing, and payment options