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.
身份验证
此端点支持两种身份验证方法:- API 密钥:通过
Authorization: Bearer <key>请求头进行标准 Bearer token 身份验证。 - x402 钱包:使用 Base 或 Solana 钱包中的 USDC 额度按用量付费。无需 Venice 账户。设置请参阅 x402 指南。
支持的网络
请参阅GET /crypto/rpc/networks 查看实时、权威的列表。当前覆盖范围:
| 家族 | Mainnet | Testnets |
|---|---|---|
| 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 |
请求格式
单个请求
批量请求
最多 100 个 JSON-RPC 2.0 对象的数组。每个项目独立验证;如果任何方法不受支持,整个批次将被以400 拒绝,所有不合规的方法名都会列在错误消息中。
支持的方法和额度等级
方法被分为三个额度等级。每次调用消耗的额度 =baseCredits[chain] × methodTier。
| 等级 | 倍数 | 示例方法 |
|---|---|---|
| Standard | 1× | eth_call、eth_getBalance、eth_blockNumber、eth_sendRawTransaction、eth_getLogs、eth_getTransactionReceipt、eth_estimateGas、net_version、web3_clientVersion、ERC-4337 bundler 方法(eth_sendUserOperation、eth_estimateUserOperationGas 等)、链家族扩展(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 |
每条链的基础额度
| baseCredits | 链 |
|---|---|
| 20 | Ethereum + 以上所有 EVM L2(Base、Optimism、Arbitrum、Polygon、Linea、Avalanche、BSC、Blast)以及 Starknet |
| 30 | zkSync Era |
费用示例
按 Venice 的~$6.25 × 10⁻⁷ 每额度计算:
| 调用 | 额度 | USD 费用 |
|---|---|---|
Ethereum 上的 eth_call(20 × 1×) | 20 | $0.0000125 |
Ethereum 上的 trace_transaction(20 × 2×) | 40 | $0.0000250 |
Ethereum 上的 trace_replayTransaction(20 × 4×) | 80 | $0.0000500 |
zkSync 上的 eth_call(30 × 1×) | 30 | $0.0000188 |
不支持
- 仅 WebSocket 方法(
eth_subscribe、eth_unsubscribe)—— 此代理仅支持 HTTP。请改为轮询,或升级到直连的 WebSocket 提供商。 - 有状态过滤器方法(
eth_newFilter、eth_getFilterChanges、eth_getFilterLogs、eth_uninstallFilter、eth_newBlockFilter、eth_newPendingTransactionFilter)—— 过滤器状态绑定到单一上游后端,在负载均衡的 HTTP 代理上会静默失效。请改用eth_getLogs(无状态)。 - 矿工 / 持有密钥方法(
eth_sign、eth_accounts、eth_mining、eth_hashrate、eth_getWork、eth_submitWork)—— 托管的提供商端点不持有用户私钥,因此这些方法总是返回错误。请在客户端签名交易并通过eth_sendRawTransaction提交。 - 未映射的方法 —— 任何未明确加入允许列表的方法都会返回
400。请联系支持以请求新增。
批量按项计费
即使 HTTP 响应为200,批量中的单个项目也可能带有 JSON-RPC error 字段返回(例如参数错误或目标链不支持的方法)。Venice 对这些项目按每个 5 额度计费,而不是完整的方法等级 —— 对正常的”探索 API”错误的小小宽容。
= 25。
速率限制
每个已认证调用方的每分钟请求上限:| 等级 | 请求/分钟 |
|---|---|
| Standard | 100 |
| Staff | 1,000 |
429 返回,并附带 customMessage 和标准的 X-RateLimit-* 响应头。
幂等性
将Idempotency-Key 请求头设置为任何匹配 [A-Za-z0-9_-]{1,255} 的字符串,可启用安全重试。响应以 (user, idempotency-key) 为键缓存 24 小时:
- 使用相同的键和相同的请求体重放,将返回缓存的响应并附带
Idempotent-Replayed: true响应头。不会请求上游,也不会扣除新的额度。 - 使用相同的键但不同的请求体重放,将返回
400,以防止静默的状态损坏。请为不同请求选择新键。
响应头
| 请求头 | 说明 |
|---|---|
X-Venice-RPC-Credits | 此请求扣除的额度。批量请求时,这是所有项目的总和。 |
X-Venice-RPC-Cost-USD | 精确到 8 位小数的美元费用。等于 X-Venice-RPC-Credits × 每额度价格。 |
X-Request-ID | 32 字符的关联 ID。请在任何支持沟通中附带。 |
Idempotent-Replayed | 当响应来自幂等性缓存时存在,值为 "true"。 |
X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset | 仅在 429 响应中设置。 |
交易转发的取证日志
对eth_sendRawTransaction 的每次调用都会在服务器端记录 tx hash(原始字节的 keccak256)、网络 slug、请求 ID 和调用方用户 ID。我们不保留签名载荷本身 —— 该 hash 可从链上回执中恢复。该审计追踪的存在是为了在客户的 API 密钥被泄露并被用于通过我们的基础设施转发非法交易时,可将链上活动关联到负责账户。
示例
X-Venice-RPC-Credits: 20、X-Venice-RPC-Cost-USD: 0.00001250、X-Request-ID: <nanoid>。
Postman 集合
我们的公开工作区提供了一个可直接导入的 Postman 集合,包含 27 个示例请求(发现、standard/advanced/large 调用、多链、批量、幂等性、错误场景): Venice Crypto RPC — Postman 集合 将集合变量apiKey 设置为您的 Venice API 密钥,即可立即开始发送请求。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求头
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"
路径参数
Venice-side network slug. Call GET /api/v1/crypto/rpc/networks for the current list.
"ethereum-mainnet"
请求体
- 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
响应
JSON-RPC response forwarded from the upstream node. Content-Type is forced to application/json regardless of upstream headers.