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.
المصادقة
تدعم هذه الـ endpoint طريقتين للمصادقة:- مفتاح API: مصادقة Bearer token القياسية عبر header
Authorization: Bearer <key>. - محفظة x402: ادفع حسب الاستخدام بـ USDC من محفظة على Base أو Solana. لا يلزم حساب 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 L2s أعلاه (Base، Optimism، Arbitrum، Polygon، Linea، Avalanche، BSC، Blast) و Starknet |
| 30 | zkSync Era |
أمثلة على التكلفة
بسعر Venice~$6.25 × 10⁻⁷ لكل credit:
| الاستدعاء | الاعتمادات | التكلفة بالدولار |
|---|---|---|
eth_call على Ethereum (20 × 1×) | 20 | $0.0000125 |
trace_transaction على Ethereum (20 × 2×) | 40 | $0.0000250 |
trace_replayTransaction على Ethereum (20 × 4×) | 80 | $0.0000500 |
eth_call على zkSync (30 × 1×) | 30 | $0.0000188 |
غير مدعوم
- الطرق التي تعمل فقط عبر WebSocket (
eth_subscribe,eth_unsubscribe) — هذا الوكيل يعمل عبر HTTP فقط. قم بالاستعلام بدلًا من ذلك، أو ارتقِ إلى موفّر WebSocket مباشر. - طرق المرشحات ذات الحالة (
eth_newFilter,eth_getFilterChanges,eth_getFilterLogs,eth_uninstallFilter,eth_newBlockFilter,eth_newPendingTransactionFilter) — حالة المرشح مثبّتة على backend واحد upstream وتتعطل بصمت على وكيل HTTP موزّع الحمل. استخدمeth_getLogs(بدون حالة) بدلًا من ذلك. - طرق التعدين / حمل المفاتيح (
eth_sign,eth_accounts,eth_mining,eth_hashrate,eth_getWork,eth_submitWork) — لا تحتفظ endpoints الموفّر المُستضاف بمفاتيح المستخدم الخاصة، لذا فهي دائمًا ترجع خطأ. وقّع المعاملات من جانب العميل وأرسلها عبرeth_sendRawTransaction. - الطرق غير المُعيَّنة — أي شيء غير مُدرَج صراحة في القائمة المسموحة يُرجع
400. تواصل مع الدعم لطلب إضافات.
فوترة الدفعات لكل عنصر
حتى عندما تكون استجابة HTTP هي200، يمكن أن تُعيد عناصر الدفعة الفردية حقل error بصيغة JSON-RPC (على سبيل المثال، خطأ في المعاملات السيئة أو طريقة غير مدعومة على السلسلة المستهدفة). تُفوتر Venice هذه العناصر بمقدار 5 اعتمادات لكل عنصر بدلًا من المستوى الكامل للطريقة — تنازل صغير لأخطاء “استكشاف الـ API” العادية.
= 25.
حدود المعدل
سقف الطلبات في الدقيقة لكل مستدعي مُصادَق عليه:| المستوى | الطلبات/الدقيقة |
|---|---|
| Standard | 100 |
| Staff | 1,000 |
429 مع customMessage ورؤوس استجابة X-RateLimit-* القياسية.
Idempotency
عيّن header الطلبIdempotency-Key إلى أي سلسلة تطابق [A-Za-z0-9_-]{1,255} لتفعيل إعادة المحاولة الآمنة. يتم تخزين الاستجابة مؤقتًا لمدة 24 ساعة بمفتاح (user, idempotency-key):
- إعادة تشغيل المفتاح نفسه بالجسم نفسه تُعيد الاستجابة المخزّنة مؤقتًا و header استجابة
Idempotent-Replayed: true. لا يتم لمس upstream ولا يتم احتساب اعتمادات جديدة. - إعادة تشغيل المفتاح نفسه بجسم مختلف تُعيد
400لمنع تلف الحالة الصامت. اختر مفتاحًا جديدًا للطلبات المميزة.
رؤوس الاستجابة
| Header | الوصف |
|---|---|
X-Venice-RPC-Credits | الاعتمادات المُحتسَبة لهذا الطلب. في طلبات الدفعة، هذا هو المجموع عبر العناصر. |
X-Venice-RPC-Cost-USD | التكلفة بالدولار حتى 8 منازل عشرية. تساوي X-Venice-RPC-Credits × السعر لكل credit. |
X-Request-ID | معرّف ترابط من 32 حرفًا. أدرجه في أي مراسلات دعم. |
Idempotent-Replayed | موجود بقيمة "true" عندما تأتي الاستجابة من ذاكرة التخزين المؤقت لـ idempotency. |
X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset | يتم تعيينها فقط في استجابات 429. |
التسجيل الجنائي لمرحّلات المعاملات
كل استدعاء لـeth_sendRawTransaction يُسجَّل على جانب الخادم مع hash المعاملة (keccak256 للبايتات الخام)، ومعرّف الشبكة، ومعرّف الطلب، ومعرّف المستخدم المُستدعي. لا نحتفظ بالحمولة الموقّعة نفسها — يمكن استرداد الـ hash من إيصال السلسلة. يوجد سجل المراجعة هذا حتى إذا تم اختراق مفتاح API لعميل واستُخدم لتمرير معاملات غير مشروعة عبر بنيتنا التحتية، يمكننا ربط النشاط على السلسلة بالحساب المسؤول.
مثال
X-Venice-RPC-Credits: 20, X-Venice-RPC-Cost-USD: 0.00001250, X-Request-ID: <nanoid>.
مجموعة Postman
تتوفر مجموعة Postman جاهزة للاستيراد مع 27 طلب مثال (الاكتشاف، الاستدعاءات Standard/Advanced/Large، متعددة السلاسل، التجميع، Idempotency، حالات الأخطاء) في مساحة عملنا العامة: Venice Crypto RPC — Postman Collection عيّن متغير المجموعة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.