Crypto RPC
Proxy a JSON-RPC request to a supported blockchain node and bill per credit.
Request shapes
- Single request: a JSON-RPC 2.0 object (
{ "jsonrpc":"2.0", "method":"…", "params":[…], "id":1 }). - Batch: an array of up to 100 JSON-RPC 2.0 objects. If any item references an unsupported method, the entire batch is rejected with 400 and the offending methods are listed.
Supported methods
Methods are classified into three pricing tiers:
- Standard (1×):
eth_call,eth_getBalance,eth_blockNumber,eth_sendRawTransaction,eth_getLogs,net_version,web3_clientVersion, ERC-4337 bundler methods (eth_sendUserOperation, etc.), and chain-family extensions (zks_*,linea_*,bor_*,starknet_*). - Advanced (2×):
trace_*,debug_*,txpool_inspect,txpool_status,arbtrace_*. - Large (4×):
trace_replayBlockTransactions,trace_replayTransaction,txpool_content,arbtrace_replay*.
Stateful filter methods (eth_newFilter, eth_getFilterChanges, eth_uninstallFilter, etc.) are not supported — they break on a load-balanced HTTP proxy because filter state is pinned to a single upstream backend. Use eth_getLogs instead.
WebSocket-only methods (eth_subscribe, eth_unsubscribe) return 400 because this proxy is HTTP-only.
Pricing
Credits consumed per call = baseCredits[chain] × methodTier. baseCredits is 20 for most EVM chains (Ethereum, Base, Optimism, Arbitrum, Polygon, Linea, Avalanche, BSC, Blast) and Starknet; 30 for zkSync Era. The USD price per credit is ~7e-7 — a single standard EVM call costs ≈ 0.000056.
Per-request errors at the JSON-RPC layer (HTTP 200 with an error field in a response item) are billed at 5 credits instead of the full method tier — a small concession for methods not supported on a given chain or bad-parameter responses.
Rate limits
Two caps apply per caller:
- Requests per minute: 100 on the paid tier, 1000 on the staff tier.
- Credits per rolling 24 hours: 10,000,000 on the paid tier, 100,000,000 on the staff tier.
When either cap is exceeded, the request returns 429 with a
customMessageidentifying which cap tripped. The per-minute cap also sets theX-RateLimit-*response headers.
Idempotency
Set the Idempotency-Key request header to any string matching [A-Za-z0-9_-]{1,255} to enable safe retries. The response is cached for 24 hours keyed on (user, idempotency-key); replaying the same key with the same body returns the cached response with Idempotent-Replayed: true. Reusing the same key with a different body returns 400 to prevent silent corruption.
Authentication: This endpoint accepts either a Bearer API key or a SIGN-IN-WITH-X header for x402 wallet-based authentication. The legacy X-Sign-In-With-X header is also accepted during migration. When using x402, a 402 Payment Required response indicates insufficient balance and includes top-up instructions.
Autenticazione
Questo endpoint supporta due metodi di autenticazione:- API key: autenticazione Bearer standard tramite l’header
Authorization: Bearer <key>. - Wallet x402: paga al consumo con crediti USDC da un wallet su Base o Solana. Nessun account Venice richiesto. Consulta la guida x402 per la configurazione.
Reti supportate
ConsultaGET /crypto/rpc/networks per l’elenco live e autorevole. Copertura attuale:
| Famiglia | Mainnet | Testnet |
|---|---|---|
| Ethereum | ethereum-mainnet | ethereum-sepolia, ethereum-holesky |
| Polygon | polygon-mainnet | polygon-amoy |
| Arbitrum | arbitrum-mainnet | arbitrum-sepolia |
| Optimism | optimism-mainnet | optimism-sepolia |
| Base | base-mainnet | base-sepolia |
| 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 |
Forme della richiesta
Richiesta singola
Richiesta batch
Un array di fino a 100 oggetti JSON-RPC 2.0. Ogni elemento viene validato indipendentemente; se un metodo non è supportato, l’intero batch viene rifiutato con400 e ogni nome di metodo offensivo è elencato nel messaggio di errore.
Metodi supportati e tier di prezzo
I metodi sono classificati in tre tier di credito. Crediti consumati per chiamata =baseCredits[chain] × methodTier.
| Tier | Moltiplicatore | Metodi di esempio |
|---|---|---|
| Standard | 1× | eth_call, eth_getBalance, eth_blockNumber, eth_sendRawTransaction, eth_getLogs, eth_getTransactionReceipt, eth_estimateGas, net_version, web3_clientVersion, metodi bundler ERC-4337 (eth_sendUserOperation, eth_estimateUserOperationGas, ecc.), estensioni di chain-family (zks_*, linea_*, bor_*, starknet_*) |
| Advanced | 2× | trace_block, trace_call, trace_transaction, debug_traceCall, debug_traceTransaction, debug_traceBlockByHash, txpool_inspect, txpool_status, arbtrace_* |
| Large | 4× | trace_replayBlockTransactions, trace_replayTransaction, txpool_content, arbtrace_replayTransaction, arbtrace_replayBlockTransactions |
Crediti base per chain
| baseCredits | Chain |
|---|---|
| 20 | Ethereum + tutte le L2 EVM sopra (Base, Optimism, Arbitrum, Polygon, Linea, Avalanche, BSC, Blast) e Starknet |
| 30 | zkSync Era |
Esempi di costo
Al prezzo Venice di~$6,25 × 10⁻⁷ per credito:
| Chiamata | Crediti | Costo USD |
|---|---|---|
eth_call su Ethereum (20 × 1×) | 20 | $0,0000125 |
trace_transaction su Ethereum (20 × 2×) | 40 | $0,0000250 |
trace_replayTransaction su Ethereum (20 × 4×) | 80 | $0,0000500 |
eth_call su zkSync (30 × 1×) | 30 | $0,0000188 |
Non supportati
- Metodi solo WebSocket (
eth_subscribe,eth_unsubscribe) — questo proxy è solo HTTP. Esegui invece il polling o passa a un provider WebSocket diretto. - Metodi filter con stato (
eth_newFilter,eth_getFilterChanges,eth_getFilterLogs,eth_uninstallFilter,eth_newBlockFilter,eth_newPendingTransactionFilter) — lo stato del filter è fissato a un singolo backend upstream e si interrompe silenziosamente su un proxy HTTP con load balancing. Usa inveceeth_getLogs(stateless). - Metodi miner / detentori di chiavi (
eth_sign,eth_accounts,eth_mining,eth_hashrate,eth_getWork,eth_submitWork) — gli endpoint dei provider hosted non detengono le chiavi private degli utenti, quindi questi danno sempre errore. Firma le transazioni lato client e invia tramiteeth_sendRawTransaction. - Metodi non mappati — tutto ciò che non è esplicitamente in allowlist restituisce
400. Contatta il supporto per richiedere aggiunte.
Fatturazione per voce di batch
Anche quando la risposta HTTP è200, le singole voci di batch possono tornare con un campo error JSON-RPC (ad esempio un errore di bad-params o un metodo non supportato sulla chain di destinazione). Venice fattura queste voci a 5 crediti ciascuna anziché all’intero tier del metodo — una piccola concessione per i normali errori di “esplorazione dell’API”.
= 25.
Rate limit
Limite di richieste al minuto per chiamante autenticato:| Tier | Richieste/minuto |
|---|---|
| Standard | 100 |
| Staff | 1.000 |
429 con un customMessage e gli header di risposta X-RateLimit-* standard.
Idempotenza
Imposta l’header di richiestaIdempotency-Key su qualsiasi stringa che corrisponda a [A-Za-z0-9_-]{1,255} per abilitare retry sicuri. La risposta viene memorizzata in cache per 24 ore con chiave (user, idempotency-key):
- Riprodurre la stessa chiave con lo stesso body restituisce la risposta in cache e un header di risposta
Idempotent-Replayed: true. L’upstream non viene contattato e nessun nuovo credito viene addebitato. - Riprodurre la stessa chiave con un body diverso restituisce
400per prevenire una corruzione silenziosa dello stato. Scegli una chiave nuova per richieste distinte.
Header di risposta
| Header | Descrizione |
|---|---|
X-Venice-RPC-Credits | Crediti addebitati per questa richiesta. Per le richieste batch è la somma sulle voci. |
X-Venice-RPC-Cost-USD | Costo in dollari fino a 8 decimali. Pari a X-Venice-RPC-Credits × prezzo per credito. |
X-Request-ID | ID di correlazione di 32 caratteri. Includilo in qualsiasi corrispondenza con il supporto. |
Idempotent-Replayed | Presente con valore "true" quando la risposta proviene dalla cache di idempotenza. |
X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset | Impostati solo sulle risposte 429. |
Logging forense per i relay di transazioni
Ogni chiamata aeth_sendRawTransaction viene loggata lato server con l’hash della tx (keccak256 dei byte raw), lo slug della rete, l’ID di richiesta e l’ID utente chiamante. Non conserviamo il payload firmato stesso — l’hash è recuperabile dalla receipt on-chain. Questo audit trail esiste in modo che, se la API key di un cliente viene compromessa e usata per inoltrare transazioni illecite tramite la nostra infrastruttura, possiamo correlare l’attività on-chain all’account responsabile.
Esempio
X-Venice-RPC-Credits: 20, X-Venice-RPC-Cost-USD: 0.00001250, X-Request-ID: <nanoid>.
Postman collection
Una Postman collection pronta da importare con 27 richieste di esempio (discovery, chiamate standard/advanced/large, multi-chain, batching, idempotenza, casi di errore) è disponibile nel nostro workspace pubblico: Venice Crypto RPC — Postman Collection Imposta la variabile di collectionapiKey sulla tua API key Venice e inizia a inviare richieste immediatamente.Autorizzazioni
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Intestazioni
Optional idempotency key for safe retries. Pattern: [A-Za-z0-9_-]{1,255}. Retrying within 24 hours with the same key + same body replays the cached response with Idempotent-Replayed: true. Same key + different body returns 400.
^[A-Za-z0-9_-]{1,255}$"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Parametri del percorso
Venice-side network slug. Call GET /api/v1/crypto/rpc/networks for the current list.
"ethereum-mainnet"
Corpo
- object
- object[]
JSON-RPC method name. See the "Supported methods" section of the endpoint description for the classification into 1×/2×/4× pricing tiers.
"eth_chainId"
2.0 "2.0"
Method parameters. Shape depends on the method; see the upstream chain documentation.
[]Caller-supplied request ID echoed back in the response. Required for batch request correlation.
1
Risposta
JSON-RPC response forwarded from the upstream node. Content-Type is forced to application/json regardless of upstream headers.