Skip to main content

How It Works

1

Initial Request

Your code sends the API request to the Corbits proxy endpoint without payment.
curl -X POST https://helius.api.corbits.dev \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getBlockHeight"}'
This request will receive an HTTP 402 response (shown in the next step) since payment is required.
2

Payment Required (402)

The proxy responds with HTTP 402 and payment requirements:
{
  "accepts": [{
    "network": "solana-mainnet-beta",
    "maxAmountRequired": 1000,
    "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "payTo": "corzHctjX9Wtcrkfxz3Se8zdXqJYCaamWcQA7vwKF7Q"
  }]
}
This response tells the payment handler:
  • Which network is accepted (solana-mainnet-beta)
  • How much to pay (1000 base units = 0.001 USDC with 6 decimals, or 10000 = 0.01 USDC)
  • Which token is accepted (EPjF... is the USDC mint address)
  • Where to send payment (corzH... is the recipient address)
3

Automatic Payment

Using Faremeter’s payment-enabled fetch wrapper, the payment is handled automatically:
import { wrap as wrapFetch } from "@faremeter/fetch";

const fetchWithPayer = wrapFetch(fetch, {
  handlers: [createPaymentHandler(wallet, mint, connection)]
});

const paywalled_rpc_url = "https://helius.api.corbits.dev";

const response = await fetchWithPayer(paywalled_rpc_url, {
  method: "POST",
  body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "getBlockHeight" })
});
The wrapped fetch automatically:
  • Creates a Solana transaction
  • Transfers 0.001 USDC to the specified address
  • Retries the request with payment proof
4

Success Response

The proxy validates your payment and returns the API result:
{
  "jsonrpc": "2.0",
  "result": 348510722,
  "id": 1
}
All of this happens automatically - you don’t need to manually handle the payment flow!

Benefits

No API Keys

No need to manage API keys or authenticate directly with partners

Pay Per Use

Only pay for what you use at 0.01perrequest(Nansen:0.01 per request (Nansen: 0.001)

Instant Access

No sign-up or approval process required

Web3 Native

Payment via cryptocurrency using any wallet

Try with our partners

Solana RPC Infrastructure

Blockchain Analytics & Data

Trading & Swaps

Web3 Infrastructure

Authentication

No traditional API keys required. The x402 payment protocol handles authentication:
  1. For you: Provide a funded Solana wallet
  2. For the proxy: Validates your payment proof
  3. For the partner: Proxy injects authentication credentials

Support

For questions or issues: