메인 콘텐츠로 건너뛰기
POST
/
crypto
/
rpc
/
{network}
curl --request POST \
  --url https://api.venice.ai/api/v1/crypto/rpc/{network} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "eth_chainId",
  "params": [],
  "id": 1
}
'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1"
}
JSON-RPC 2.0 요청(단일 또는 배치)을 지원되는 블록체인 노드로 전달합니다. API 키와 x402 지갑 인증 모두를 지원합니다. 청구는 크레딧 단위이며 Venice 잔액으로 표시됩니다 — 하나의 자격 증명, 하나의 청구서로 아래 모든 체인을 사용합니다.

인증

이 엔드포인트는 두 가지 인증 방법을 지원합니다:
  • API Key: Authorization: Bearer <key> 헤더를 통한 표준 Bearer 토큰 인증.
  • x402 Wallet: Base 또는 Solana의 지갑에서 USDC 크레딧으로 종량제 결제. Venice 계정이 필요하지 않습니다. 설정은 x402 가이드를 참조하세요.
두 방법 모두 동일한 속도 제한과 청구(Venice 크레딧)를 공유합니다.

지원되는 네트워크

실시간 권위 목록은 GET /crypto/rpc/networks를 참조하세요. 현재 커버리지:
FamilyMainnetTestnets
Ethereumethereum-mainnetethereum-sepolia, ethereum-holesky
Polygonpolygon-mainnetpolygon-amoy
Arbitrumarbitrum-mainnetarbitrum-sepolia
Optimismoptimism-mainnetoptimism-sepolia
Basebase-mainnetbase-sepolia
Linealinea-mainnetlinea-sepolia
Avalanche C-Chainavalanche-mainnetavalanche-fuji
BNB Smart Chainbsc-mainnetbsc-testnet
Blastblast-mainnetblast-sepolia
zkSync Erazksync-mainnetzksync-sepolia
Starknetstarknet-mainnetstarknet-sepolia

요청 형태

단일 요청

{
  "jsonrpc": "2.0",
  "method": "eth_chainId",
  "params": [],
  "id": 1
}

배치 요청

최대 100개의 JSON-RPC 2.0 객체 배열. 각 항목은 독립적으로 유효성 검사됩니다; 지원되지 않는 메서드가 있으면 전체 배치가 400으로 거부되고 모든 위반 메서드 이름이 오류 메시지에 나열됩니다.
[
  { "jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1 },
  { "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 2 }
]

지원되는 메서드 및 가격 등급

메서드는 세 가지 크레딧 등급으로 분류됩니다. 호출당 소비되는 크레딧 = baseCredits[chain] × methodTier.
등급배수예제 메서드
Standardeth_call, eth_getBalance, eth_blockNumber, eth_sendRawTransaction, eth_getLogs, eth_getTransactionReceipt, eth_estimateGas, net_version, web3_clientVersion, ERC-4337 bundler methods (eth_sendUserOperation, eth_estimateUserOperationGas, etc.), chain-family extensions (zks_*, linea_*, bor_*, starknet_*)
Advancedtrace_block, trace_call, trace_transaction, debug_traceCall, debug_traceTransaction, debug_traceBlockByHash, txpool_inspect, txpool_status, arbtrace_*
Largetrace_replayBlockTransactions, trace_replayTransaction, txpool_content, arbtrace_replayTransaction, arbtrace_replayBlockTransactions

체인별 기본 크레딧

baseCreditsChains
20Ethereum + 위의 모든 EVM L2(Base, Optimism, Arbitrum, Polygon, Linea, Avalanche, BSC, Blast) 및 Starknet
30zkSync 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 탐색” 실수에 대한 작은 양보입니다.
// Batch request:
[
  { "jsonrpc": "2.0", "method": "eth_chainId",   "params": [],         "id": 1 },
  { "jsonrpc": "2.0", "method": "eth_getBalance","params": ["bad"],    "id": 2 }
]

// Response (HTTP 200, X-Venice-RPC-Credits: 25):
[
  { "jsonrpc": "2.0", "id": 1, "result": "0x1" },
  { "jsonrpc": "2.0", "id": 2, "error": { "code": -32602, "message": "invalid params" } }
]
첫 번째 항목(성공)은 20 크레딧이 청구되고, 두 번째 항목(RPC 수준 오류)은 5 크레딧이 청구되어 총 = 25입니다.

속도 제한

인증된 호출자당 분당 요청 제한:
등급요청/분
Standard100
Staff1,000
제한을 초과하면 엔드포인트는 customMessage 및 표준 X-RateLimit-* 응답 헤더와 함께 429를 반환합니다.

멱등성

안전한 재시도를 활성화하려면 Idempotency-Key 요청 헤더를 [A-Za-z0-9_-]{1,255}와 일치하는 문자열로 설정하세요. 응답은 (user, idempotency-key)를 키로 24시간 동안 캐시됩니다:
  • 동일한 본문과 함께 동일한 키를 재생하면 캐시된 응답과 Idempotent-Replayed: true 응답 헤더가 반환됩니다. 업스트림은 건드리지 않으며 새 크레딧이 청구되지 않습니다.
  • 다른 본문과 함께 동일한 키를 재생하면 무음 상태 손상을 방지하기 위해 400을 반환합니다. 별개의 요청에는 새 키를 선택하세요.

응답 헤더

HeaderDescription
X-Venice-RPC-Credits이 요청에 청구된 크레딧. 배치 요청의 경우 항목 전체의 합계입니다.
X-Venice-RPC-Cost-USD소수점 8자리까지의 달러 비용. X-Venice-RPC-Credits × 크레딧당 가격과 동일합니다.
X-Request-ID32자 상관 ID. 모든 지원 문의에 포함하세요.
Idempotent-Replayed응답이 멱등성 캐시에서 온 경우 "true" 값과 함께 표시됩니다.
X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset429 응답에만 설정됩니다.

트랜잭션 릴레이를 위한 포렌식 로깅

eth_sendRawTransaction에 대한 모든 호출은 tx 해시(원시 바이트의 keccak256), 네트워크 슬러그, 요청 ID 및 호출 사용자 ID와 함께 서버 측에 기록됩니다. 서명된 페이로드 자체는 보존하지 않습니다 — 해시는 온체인 영수증에서 복구할 수 있습니다. 이 감사 추적은 고객의 API 키가 손상되어 인프라를 통해 불법 트랜잭션을 중계하는 데 사용되는 경우 온체인 활동을 책임 있는 계정과 연관시킬 수 있도록 존재합니다.

예제

curl https://api.venice.ai/api/v1/crypto/rpc/ethereum-mainnet \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_chainId",
    "params": [],
    "id": 1
  }'
{ "jsonrpc": "2.0", "id": 1, "result": "0x1" }
응답 헤더: X-Venice-RPC-Credits: 20, X-Venice-RPC-Cost-USD: 0.00001250, X-Request-ID: <nanoid>.

Postman 컬렉션

27개의 예제 요청(검색, 표준/고급/대규모 호출, 다중 체인, 배치, 멱등성, 오류 사례)이 포함된 즉시 가져올 수 있는 Postman 컬렉션이 공개 워크스페이스에서 제공됩니다: Venice Crypto RPC — Postman Collection apiKey 컬렉션 변수를 Venice API 키로 설정하고 즉시 요청을 보내기 시작하세요.

인증

Authorization
string
header
필수

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

헤더

Idempotency-Key
string

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.

Pattern: ^[A-Za-z0-9_-]{1,255}$
예시:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

경로 매개변수

network
string
필수

Venice-side network slug. Call GET /api/v1/crypto/rpc/networks for the current list.

예시:

"ethereum-mainnet"

본문

application/json
method
string
필수

JSON-RPC method name. See the "Supported methods" section of the endpoint description for the classification into 1×/2×/4× pricing tiers.

예시:

"eth_chainId"

jsonrpc
enum<string>
사용 가능한 옵션:
2.0
예시:

"2.0"

params
any[]

Method parameters. Shape depends on the method; see the upstream chain documentation.

예시:
[]
id

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.

jsonrpc
string
예시:

"2.0"

id
result
any

Method-dependent result. Present on success.

error
object

JSON-RPC error object. Present on per-request failure (HTTP status is still 200 in that case).