Solana RPC (read-only)
POST /api/solana-rpcRead-only JSON-RPC against Solana mainnet with multi-endpoint failover: one paid call, no node or API key of your own. Send POST /api/solana-rpc with the required field method and pay $0.004 per call over x402 or MPP (there is no free tier). It returns a JSON object with network, method and result.
Allowlisted reads only: getSlot, getBlockHeight, getEpochInfo, getLatestBlockhash, getTransactionCount, getHealth, getVersion, getBalance, getAccountInfo, getTokenAccountBalance, getTokenSupply, getTokenAccountsByOwner, getSignaturesForAddress, getSignatureStatuses, getTransaction, getBlock, isBlockhashValid. getProgramAccounts and every send, simulate, airdrop and subscription method are refused. Heavy reads stay small: getBlock returns signatures (the first 1,000, marked partial past that) or no transaction list (never full bodies) and no rewards unless asked, getAccountInfo reads raw account bytes through a dataSlice of at most 65,536 bytes, or jsonParsed (an account the node cannot parse comes back as base64, held to the result cap below), getTokenAccountsByOwner takes a mint filter, getSignaturesForAddress returns 20 rows by default and 100 at most, getSignatureStatuses takes up to 20 signatures. Results over 200KB serialized return 413; narrow the query (a dataSlice, a mint filter, a smaller limit).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
method | string | yes | An allowlisted read-only Solana JSON-RPC method (e.g. getSlot, getBalance, getAccountInfo, getTransaction). |
params | array | no | JSON-RPC positional parameter array (default []). Max 4 entries, 4KB serialized. Addresses and signatures are base58. |
network | string | no | mainnet (the default and the only network served). |
Example request
curl -i -X POST https://agent402.tools/api/solana-rpc \
-H "Content-Type: application/json" \
-d '{"method":"getSlot","params":[]}'Without payment this returns HTTP 402 Payment Required with the exact price for solana-rpc; any x402 v2 or MPP client pays it and retries.
Watch a call get paid
POST /api/solana-rpc$0.004 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"network": "mainnet",
"method": "getSlot",
"result": 472743760
}| Field | Type | Always present | In the example |
|---|---|---|---|
network | string | yes | mainnet |
method | string | yes | getSlot |
result | number | yes | 472743760 |
From an MCP client
catalog.call {
"slug": "solana-rpc",
"params": {
"method": "getSlot",
"params": []
}
}The hosted connector at https://agent402.tools/mcp needs a payment for solana-rpc; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.15.0.
Errors and behavior
methodis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. Some calls are paid before they run; a failed one can be retried free with the same payment, or is refunded. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/solana-rpc returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.004" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/solana-rpc", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"method": "getSlot",
"params": []
}),
});Related tools
Account nonce
The transaction count of an account, which is the nonce its next transaction must carry.
Read-only JSON-RPC passthrough
Escape hatch for power users: forward an arbitrary read-only JSON-RPC method to the chain.
Multi-chain EVM RPC (read-only)
Read-only JSON-RPC against Ethereum, Base, Polygon, Arbitrum, or Optimism with built-in multi-endpoint failover - one.
Block info
Header-level detail for one block on Ethereum, Base, Polygon, Arbitrum, or Optimism: hash, timestamp (unix + ISO).
Latest block number
The latest block number on Ethereum, Base, Polygon, Arbitrum, or Optimism: returns network, blockNumber (integer).
Calldata decoder (ABI or selector DB)
Decode EVM smart-contract transaction calldata into the function name and typed parameters.