Skip to content

Solana RPC (read-only)

$0.004 per callUSDC via x402POST /api/solana-rpc

Read-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).

Category: Crypto & onchain dataTags: crypto solana rpc json-rpc svm spl account transactionAlso found as: sol-rpc solana-json-rpc

Try in playground →

Parameters

NameTypeRequiredDescription
methodstringyesAn allowlisted read-only Solana JSON-RPC method (e.g. getSlot, getBalance, getAccountInfo, getTransaction).
paramsarraynoJSON-RPC positional parameter array (default []). Max 4 entries, 4KB serialized. Addresses and signatures are base58.
networkstringnomainnet (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

RequestPOST /api/solana-rpc
402$0.004 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "network": "mainnet",
  "method": "getSlot",
  "result": 472743760
}
FieldTypeAlways presentIn the example
networkstringyesmainnet
methodstringyesgetSlot
resultnumberyes472743760

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

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

$0.001GET /api/chain/nonce

The transaction count of an account, which is the nonce its next transaction must carry.

Read-only JSON-RPC passthrough

$0.002POST /api/eth-call

Escape hatch for power users: forward an arbitrary read-only JSON-RPC method to the chain.

Multi-chain EVM RPC (read-only)

$0.004POST /api/evm-rpc

Read-only JSON-RPC against Ethereum, Base, Polygon, Arbitrum, or Optimism with built-in multi-endpoint failover - one.

Block info

$0.001GET /api/block-info

Header-level detail for one block on Ethereum, Base, Polygon, Arbitrum, or Optimism: hash, timestamp (unix + ISO).

Latest block number

$0.001GET /api/block-number

The latest block number on Ethereum, Base, Polygon, Arbitrum, or Optimism: returns network, blockNumber (integer).

Calldata decoder (ABI or selector DB)

$0.002POST /api/calldata-decode

Decode EVM smart-contract transaction calldata into the function name and typed parameters.