venice-crypto-rpc
Use Venice as a pay-per-call JSON-RPC proxy to 20+ EVM and Starknet networks. Covers GET /crypto/rpc/networks, POST /crypto/rpc/{network}, the 1×/2×/4× method-tier pricing model, per-minute + 24-hour credit rate limits, idempotency keys for safe retries, single vs batch requests, and the unsupported stateful/WebSocket methods (eth_subscribe, eth_newFilter, etc.).
git clone --depth 1 https://github.com/veniceai/skills /tmp/venice-crypto-rpc && cp -r /tmp/venice-crypto-rpc/skills/venice-crypto-rpc ~/.claude/skills/venice-crypto-rpcSKILL.md
# Venice Crypto RPC (JSON-RPC proxy)
Venice exposes a **multi-chain JSON-RPC proxy** billed per call. Same request shape as Alchemy / Infura — just change the base URL and pay per credit.
| Endpoint | Auth | Notes |
|---|---|---|
| `GET /crypto/rpc/networks` | Bearer or SIWE | Returns `{ "networks": [...] }` (sorted). |
| `POST /crypto/rpc/{network}` | Bearer or SIWE (x402) | Forward a JSON-RPC 2.0 request (single or batch). |
## Supported networks
Call `GET /crypto/rpc/networks` for the current list. It currently returns 23 slugs (always verify — the catalog grows):
```
arbitrum-mainnet arbitrum-sepolia
avalanche-mainnet avalanche-fuji
base-mainnet base-sepolia
blast-mainnet blast-sepolia
bsc-mainnet bsc-testnet
ethereum-mainnet ethereum-sepolia ethereum-holesky
linea-mainnet linea-sepolia
optimism-mainnet optimism-sepolia
polygon-mainnet polygon-amoy
starknet-mainnet starknet-sepolia
zksync-mainnet zksync-sepolia
```
Use the slug as `:network` in the proxy path.
## Send a JSON-RPC request
### Single call
```bash
curl -X POST 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}'
```
```json
{ "jsonrpc": "2.0", "id": 1, "result": "0x1" }
```
### Batch (up to 100 calls)
```bash
curl -X POST https://api.venice.ai/api/v1/crypto/rpc/base-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","method":"eth_blockNumber","params":[],"id":2}
]'
```
A single unsupported method in a batch ⇒ the **entire batch** fails with `400`.
### Drop-in with `viem` / `ethers`
```ts
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
const client = createPublicClient({
chain: mainnet,
transport: http('https://api.venice.ai/api/v1/crypto/rpc/ethereum-mainnet', {
fetchOptions: { headers: { Authorization: `Bearer ${process.env.VENICE_API_KEY}` } },
}),
})
```
## Pricing
Credits per call = `baseCredits[chain] × methodTier`.
| Base credits | Chains |
|---|---|
| `20` | Ethereum, Base, Optimism, Arbitrum, Polygon, Linea, Avalanche, BSC, Blast, Starknet. |
| `30` | zkSync Era. |
| Tier | Multiplier | Methods |
|---|---|---|
| **Standard** | `1×` | `eth_call`, `eth_getBalance`, `eth_blockNumber`, `eth_sendRawTransaction`, `eth_getLogs`, `net_version`, `web3_clientVersion`, ERC-4337 bundler (`eth_sendUserOperation`, …), 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*`. |
At `~$7e-7` per credit:
- Standard EVM call (20 × 1) ≈ **$0.000014**
- Advanced trace on Ethereum (20 × 2) ≈ **$0.000028**
- Large trace replay (20 × 4) ≈ **$0.000056**
- zkSync standard call (30 × 1) ≈ **$0.000021**
RPC-level errors (HTTP 200 with `error` object inside — e.g. method unsupported on that chain, bad params) are billed at a flat **5 credits** regardless of tier.
Response headers on `200`:
| Header | Meaning |
|---|---|
| `X-Venice-RPC-Credits` | Total credits charged (sum over batch). |
| `X-Venice-RPC-Cost-USD` | Dollar cost to 8 decimal places. |
| `X-Balance-Remaining` | Remaining x402 USD — set on routes whose middleware refreshes balance headers. The `/crypto/rpc/*` handler currently emits credits/cost/request headers; treat `X-Balance-Remaining` here as best-effort (may be absent on RPC). Use `GET /x402/balance/{walletAddress}` for an authoritative read. |
| `X-Request-ID` | 32-char correlation ID — include in support tickets. |
| `Idempotent-Replayed` | `"true"` when served from the idempotency cache. |
## Unsupported methods
These always return `400`:
- **Stateful filter methods** — `eth_newFilter`, `eth_newBlockFilter`, `eth_getFilterChanges`, `eth_getFilterLogs`, `eth_uninstallFilter`. Filter state is pinned to a single backend and a load-balanced HTTP proxy can't maintain it. Use `eth_getLogs` instead.
- **WebSocket-only methods** — `eth_subscribe`, `eth_unsubscribe`. This proxy is HTTP only. Run your own WS endpoint for subscriptions.
- **Cross-family methods** — calling `starknet_*` on an EVM chain (or vice versa) ⇒ `400`.
- **Unmapped methods** — anything not in the Standard/Advanced/Large lists.
## Idempotency
Set the `Idempotency-Key` header to any `[A-Za-z0-9_-]{1,255}` string for safe retries:
```bash
curl -X POST https://api.venice.ai/api/v1/crypto/rpc/ethereum-mainnet \
-H "Authorization: Bearer $VENICE_API_KEY" \
-H "Idempotency-Key: send-tx-2026-04-21-nonce-42" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0x..."] ,"id":1}'
```
- Cached for **24 hours** keyed on `(user, idempotency-key)`.
- Replay returns the cached response with `Idempotent-Replayed: true` and is **not billed again**.
- Same key + **different body** ⇒ `400` (prevents silent corruption).
Use this for any state-mutating method (`eth_sendRawTransaction`, `eth_sendUserOperation`) to survive flaky networks without double-broadcasting.
## Rate limits
Two caps per caller, both enforced independently:
| Tier | Per-minute requests | Credits / rolling 24h |
|---|---|---|
| Paid | 100 | 10,000,000 |
| Staff | 1,000 | 100,000,000 |
`429` response `customMessage` identifies which cap tripped. Per-minute cap also sets `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` headers.
Concurrent-call collisions on the per-user mutex also return `429`. Retry with jitter.
## Errors
| Status | Typical cause |
|---|---|
| `400` | Unsupported network slug, empty body, batch > 100, unsupported/WebSocket/filter method, cross-family call,Manage Venice API keys. Covers GET/POST/PATCH/DELETE /api_keys, GET /api_keys/{id}, GET /api_keys/rate_limits, GET /api_keys/rate_limits/log, the two-step /api_keys/generate_web3_key wallet flow, INFERENCE vs ADMIN key types, and per-key consumption limits (USD / DIEM).
High-level map of the Venice.ai API - base URL, authentication modes, endpoint categories, response headers, pricing model, error shape, and versioning. Load this first when starting any Venice integration.
Async music / audio-track generation via Venice. Covers the /audio/quote + /audio/queue + /audio/retrieve + /audio/complete lifecycle, lyrics vs instrumental, voice selection, duration, language, speed, model capability probing, and webhook-free polling.
Generate speech from text via POST /audio/speech. Covers TTS models (Kokoro, Qwen 3, xAI, Inworld, Chatterbox, Orpheus, ElevenLabs Turbo, MiniMax, Gemini Flash), voices per family, output formats (mp3/opus/aac/flac/wav/pcm), streaming, prompt/emotion styling, temperature/top_p, and language hints.
Transcribe audio files to text via POST /audio/transcriptions. Covers supported models (Parakeet, Whisper, Wizper, Scribe, xAI STT), supported formats (wav/flac/m4a/aac/mp4/mp3/ogg/webm), response formats (json/text), timestamps, and language hints. OpenAI-compatible multipart.
Venice augmentation endpoints for agent pipelines. Covers POST /augment/text-parser (extract text from PDF/DOCX/XLSX/plain text, multipart, up to 25MB, JSON or plain text response), POST /augment/scrape (fetch a URL and return markdown; blocks X/Reddit), and POST /augment/search (Brave ZDR or anonymized Google; structured title/url/content/date results, up to 20 per query). Privacy (zero data retention), rate limits, and error shapes.
Authenticate to the Venice API with a Bearer API key or with an x402 / SIWE wallet. Covers header formats, the SIWE message fields, TTL and nonce rules, the venice-x402-client SDK, and how to choose between the two modes.
Venice billing and usage analytics - GET /billing/balance, GET /billing/usage (paginated per-request ledger, JSON or CSV), and GET /billing/usage-analytics (aggregated by date/model/key). Covers the DIEM/USD/BUNDLED_CREDITS consumption priority and building dashboards. (Beta)