{"openapi":"3.1.0","info":{"title":"ERPC x402 Solana RPC","version":"1.0.0","description":"Stablecoin-gated Solana JSON-RPC proxy. Paid endpoint POST /v1/solana-mainnet charges per JSON-RPC method via the x402 protocol on Solana mainnet, settled in USDC through the Coinbase CDP facilitator."},"servers":[{"url":"https://x402.erpc.global"}],"paths":{"/v1/solana-mainnet":{"post":{"operationId":"solanaJsonRpc","summary":"Solana JSON-RPC (paid)","description":"Pay-per-request Solana JSON-RPC proxy. Accepts single or batch JSON-RPC 2.0 bodies. Pricing follows the canonical ERPC token model: standard JSON-RPC methods cost a flat 42 tokens, getProgramAccounts 4200, getTokenLargestAccounts 2400, and getMultipleAccounts 420 × the number of pubkeys in params[0] (min 1). Unknown methods default to 42 tokens. Every payment is floored to a minimum charge of 1000 atomic USDC = $0.001 (the Coinbase CDP facilitator minimum settlement amount), so standard methods that would otherwise be 42 atomic ($0.000042) are charged $0.001. The first call returns 402 with an x402 payment challenge whose amount is max(summed token weight, 1000) times the base token price (1 token = $0.000001 = 1 atomic USDC, i.e. $1 per 1,000,000 tokens). The same body retried with X-Payment is settled in USDC on Solana mainnet and proxied to the upstream Solana RPC.","x-pay-pricing":{"model":"per_method_weight","base_token_price_usd":0.000001,"min_charge_atomic":1000,"min_charge_usd":0.001,"currency":"USDC","network":"solana"},"parameters":[{"name":"X-Payment","in":"header","required":false,"description":"x402 payment payload (base64-encoded). Omitted on the first call, which returns 402 with an x402 challenge. On the retry the client re-sends the same JSON-RPC body with this header carrying the signed Solana USDC payment for the challenged amount; the worker verifies and settles it before proxying upstream. The legacy header name Payment-Signature is also accepted as a fallback. Each settled payment signature is single-use within the settlement TTL — replaying it returns 409 duplicate_payment.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/JsonRpcRequest"},{"type":"array","items":{"$ref":"#/components/schemas/JsonRpcRequest"},"minItems":1,"maxItems":100}]},"examples":{"getBalance":{"summary":"Single getBalance (42 canonical tokens, floored to $0.001)","value":{"jsonrpc":"2.0","id":1,"method":"getBalance","params":["11111111111111111111111111111111"]}},"batch":{"summary":"Batch (getSlot 42 + getBlockHeight 42 = 84 tokens, floored to $0.001)","value":[{"jsonrpc":"2.0","id":1,"method":"getSlot"},{"jsonrpc":"2.0","id":2,"method":"getBlockHeight"}]},"getMultipleAccounts":{"summary":"getMultipleAccounts (420 × pubkey count; 2 pubkeys = 840 tokens, floored to $0.001)","value":{"jsonrpc":"2.0","id":1,"method":"getMultipleAccounts","params":[["vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg","4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"]]}}}}}},"responses":{"200":{"description":"Upstream JSON-RPC response. Includes X-Payment-Response header from the facilitator.","headers":{"X-Payment-Response":{"schema":{"type":"string"},"description":"Base64-encoded x402 settlement receipt for the X-Payment submitted on this request. Also mirrored as the Payment-Response header."},"Payment-Response":{"schema":{"type":"string"},"description":"Human-readable mirror of X-Payment-Response."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}},"400":{"description":"Invalid JSON-RPC body."},"402":{"description":"Payment Required. Returned (a) before payment with x402 challenge headers, and (b) when a submitted payment is invalid/rejected by the facilitator. The error.code is payment_required, payment_invalid, price_mismatch, or payment_amount_too_low (amount below the 1000-atomic / $0.001 facilitator minimum). Facilitator verify/settle errors are surfaced here as a descriptive 402 rather than an HTTP 500. A replayed (already-used) payment signature is rejected separately as 409 duplicate_payment, not 402.","headers":{"X-Payment-Required":{"schema":{"type":"string"},"description":"x402 challenge (base64) describing accepted scheme/network/asset/amount/recipient"},"Payment-Required":{"schema":{"type":"string"},"description":"Human-readable challenge mirror"},"X-Rpc-Weight":{"schema":{"type":"integer"},"description":"Charged token weight of the JSON-RPC body: max(summed canonical weight, 1000-atomic minimum). Standard methods report 1000 after the floor. See x-pay-pricing."},"X-Rpc-Price-Usd":{"schema":{"type":"string"},"description":"Computed (floored) price in USD for this request; minimum $0.001"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredBody"}}}},"409":{"description":"Duplicate payment. The payment signature has already been used within the settlement TTL (replay / double-spend protection enforced by the SettlementCache). error.code is duplicate_payment; the client must obtain a fresh payment before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicatePaymentBody"}}}},"413":{"description":"Batch size exceeds MAX_BATCH_SIZE (100)."}}}},"/health":{"get":{"operationId":"health","summary":"Public health probe (free)","responses":{"200":{"description":"Health status","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"version":{"type":"string"},"network":{"type":"string"},"region":{"type":"string"}}}}}}}}},"/pricing":{"get":{"operationId":"pricing","summary":"Public weight + USD price table (free)","responses":{"200":{"description":"Per-method weight and price","content":{"application/json":{"schema":{"type":"object","properties":{"tokenPriceUsd":{"type":"number"},"minChargeAtomic":{"type":"integer","description":"Minimum charge per payment in atomic USDC (CDP facilitator floor); 1000 = $0.001"},"minChargeUsd":{"type":"number","description":"Minimum charge in USD ($0.001)"},"defaultUnknownMethodWeight":{"type":"integer","description":"Charged (floored) weight for unknown methods"},"defaultUnknownMethodRawWeight":{"type":"integer","description":"Canonical pre-floor weight for unknown methods (42)"},"defaultUnknownMethodPriceUsd":{"type":"number"},"methods":{"type":"array","items":{"type":"object","properties":{"method":{"type":"string"},"weight":{"type":"integer","description":"Charged token weight after the minimum-charge floor"},"rawWeight":{"type":"integer","description":"Canonical token weight before the floor"},"floored":{"type":"boolean","description":"True when the floor raised this method above its canonical weight"},"price_usd":{"type":"number"},"price":{"type":"string"},"dynamic":{"type":"boolean","description":"True when the weight scales with request params (e.g. getMultipleAccounts)"},"perPubkeyWeight":{"type":"integer","description":"Token weight charged per pubkey for dynamic methods"},"note":{"type":"string"}}}}}}}}}}}},"/.well-known/x402":{"get":{"operationId":"wellKnownX402","summary":"x402 scheme and network metadata (free)","responses":{"200":{"description":"x402 capabilities","content":{"application/json":{"schema":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"asset":{"type":"string"},"recipient":{"type":"string"}}}}}}}}}},"components":{"schemas":{"JsonRpcRequest":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"method":{"type":"string"},"params":{}}},"JsonRpcResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"null"}]},"result":{},"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}}}}},"PaymentRequiredBody":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["payment_required","payment_invalid","price_mismatch","payment_amount_too_low"]},"message":{"type":"string"},"request_id":{"type":"string"}}},"pricing":{"type":"object","description":"Computed pricing for the submitted JSON-RPC body.","properties":{"weight":{"type":"integer","description":"Charged (floored) token weight"},"rawWeight":{"type":"integer","description":"Canonical pre-floor token weight"},"floored":{"type":"boolean"},"minChargeAtomic":{"type":"integer","description":"1000 ($0.001)"},"priceUsd":{"type":"number"},"price":{"type":"string"}}}}},"DuplicatePaymentBody":{"type":"object","description":"Returned at HTTP 409 when a payment signature is replayed within the settlement TTL.","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["duplicate_payment"]},"message":{"type":"string"},"request_id":{"type":"string"}}}}}}}}