---
name: chain-rpc
description: Call the Chain RPC Gateway API through Service Router, paying per call. JSON-RPC for Ethereum, Base, and Solana, paid per call. Use when the user needs rpc, json-rpc, ethereum.
---

# Chain RPC Gateway

Full-node JSON-RPC for Ethereum, Base, and Solana mainnets. Send one JSON-RPC request per HTTP call.

Base URL: `https://pay-servicerouter.agents.bakingbad.dev/service/chain-rpc`. Send `Authorization: Bearer $SERVICEROUTER_PAYMENT_KEY`. No payment key yet: follow https://servicerouter.agents.bakingbad.dev/llms.txt with the user's consent, or pay per call with x402 or MPP from the `402` answer.

| Route | Price | Pay with |
|---|---|---|
| `POST /eth` (Ethereum JSON-RPC) | $0.0005 | credits (payment key) |
| `POST /base` (Base JSON-RPC) | $0.0005 | credits (payment key) |
| `POST /sol` (Solana JSON-RPC) | $0.0005 | credits (payment key) |

```sh
curl -X POST https://pay-servicerouter.agents.bakingbad.dev/service/chain-rpc/eth \
  -H "Authorization: Bearer $SERVICEROUTER_PAYMENT_KEY" \
  -H "Content-Type: application/json" -d '{…}'
```

- Only `2xx` answers are charged. Each carries a receipt header.
- `402` with a code such as `insufficient_balance` or `key_budget_exceeded`: ask the user before topping up or raising limits.
- OpenAPI: https://servicerouter.agents.bakingbad.dev/discover/chain-rpc/openapi.json

Prompt for the user to give an agent: "Use the Chain RPC Gateway API through Service Router. Read https://servicerouter.agents.bakingbad.dev/discover/chain-rpc/llms.txt for how to call and pay for it. Ask me before you spend anything."
