Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt

Use this file to discover all available pages before exploring further.

Copy prompt

https://mintcdn.com/goldsky-38/ZGItD__kHOxygOLb/images/logos/icon-claude.svg?fit=max&auto=format&n=ZGItD__kHOxygOLb&q=85&s=03d140b3922818ce4710109268b60b7f

Open in Claude

https://mintcdn.com/goldsky-38/ZGItD__kHOxygOLb/images/logos/icon-chatgpt.svg?fit=max&auto=format&n=ZGItD__kHOxygOLb&q=85&s=34f8245d14a73b48e649eed7a232c718

Open in ChatGPT

https://mintcdn.com/goldsky-38/ZGItD__kHOxygOLb/images/logos/icon-perplexity.svg?fit=max&auto=format&n=ZGItD__kHOxygOLb&q=85&s=bad0886723c9e2c2bc2bfb3485cfea3d

Open in Perplexity

Edge RPC accepts pay-per-request payments over the x402 protocol, settled through Circle Gateway. Fund a USDC balance once with Circle and pay per call against any supported chain, with no Goldsky account, no API key, and no invoice. x402 is designed for autonomous agents. SDK clients handle the full handshake transparently.

Pricing

$5 per million requests, all methods, all chains. Each call debits 5 atomic USDC ($0.000005) from your Circle Gateway balance. Settlement is gasless on your side, and Circle batches settlements on Goldsky’s side.

Endpoint

Edge RPC endpoints follow a single URL pattern, with the chain ID in the path:
https://edge.goldsky.com/standard/evm/{chainId}
To discover every chain Edge serves, hit edge.goldsky.com with no path. It returns a JSON list of every supported network, with CAIP id, alias, block time, and health status:
curl https://edge.goldsky.com | jq '.standard[] | {id, alias, state}'
# {"id": "evm:1",     "alias": "ethereum-mainnet", "state": "OK"}
# {"id": "evm:8453",  "alias": "base",             "state": "OK"}
# {"id": "evm:42161", "alias": "arbitrum",         "state": "OK"}
# ...

Supported chains for x402 payments

You can pay over x402 on any chain Circle Gateway currently advertises. The 11 networks below mirror the live list at https://gateway-api.circle.com/v1/x402/supported; Edge serves additional chains that aren’t yet in this list, and those still require a regular API key.
NetworkCAIP idUSDC contract
Ethereumeip155:10xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Baseeip155:84530x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Arbitrum Oneeip155:421610xaf88d065e77c8cC2239327C5EDb3A432268e5831
Optimismeip155:100x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
Polygoneip155:1370x3c499c542cEF5E3811e1192ce70d8cC03d5c3359
Avalanche C-Chaineip155:431140xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E
Unichaineip155:1300x078D782b760474a361dDA0AF3839290b0EF57AD6
Soniceip155:1460x29219dd400f2Bf60E5a23d13Be72B486D4038894
World Chaineip155:4800x79A02482A880bCE3F13e09Da970dC34db4CD24d1
Sei EVMeip155:13290xe15fC38F6D8c56aF07bbCBe3BAf5708A2Bf42392
HyperEVMeip155:9990xb88339CB7199b77E23DB6E890353E22632Ba630f
You only need a Circle Gateway USDC deposit on one of these chains. The endpoint advertises every chain in its 402 response, and SDK clients pick whichever you’re funded on.

Quickstart

1. Fund a Circle Gateway deposit

Use the Circle Gateway dashboard, or do it directly via the SDK:
import { GatewayClient } from "@circle-fin/x402-batching/client";

const gateway = new GatewayClient({
  chain: "base",                     // any supported chain
  privateKey: process.env.PK as `0x${string}`,
});

await gateway.deposit("1");          // 1 USDC = 200,000 Edge requests
Your deposit takes a few minutes to reflect in Circle’s /v1/balances API after the on-chain transaction confirms.

2. Pay for an Edge request

pay() handles the full 402 → sign → retry flow for you:
const { data, formattedAmount, transaction } = await gateway.pay(
  "https://edge.goldsky.com/standard/evm/1",
  {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: { jsonrpc: "2.0", id: 1, method: "eth_chainId", params: [] },
  },
);

console.log("paid", formattedAmount, "USDC →", JSON.stringify(data));
// paid 0.000005 USDC → {"jsonrpc":"2.0","id":1,"result":"0x1"}
That’s it. No Goldsky account, no secret query parameter, no invoice. Your wallet address becomes your identity for rate limiting and metrics.

How it works

x402 is an HTTP protocol layered on top of standard requests. The full handshake:
1

Initial request returns 402

Your client sends an unauthenticated request. Edge responds with HTTP 402 and a body listing every accepted (chain, asset) option:
{
  "x402Version": 2,
  "error": "Payment required for this resource",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "5",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x87aB362fEF2106d24762289410a18e7c42304C68",
      "maxTimeoutSeconds": 604800,
      "extra": {
        "name": "GatewayWalletBatched",
        "version": "1",
        "verifyingContract": "0x77777777dcc4d5a8b6e418fd04d8997ef11000ee"
      }
    }
    // ...one entry per supported chain
  ]
}
2

Sign an EIP-712 authorization

Your client picks an accepts entry it can satisfy (typically the chain your Gateway deposit lives on) and signs an EIP-712 TransferWithAuthorization message against the GatewayWalletBatched contract from the extra block.
3

Retry with Payment-Signature header

Your client base64-encodes the signed payload and resends the original request with one extra header:
POST /standard/evm/1
Content-Type: application/json
Payment-Signature: <base64(payment payload)>
Edge forwards the payment to Circle’s facilitator for settlement, then proxies the RPC request to upstream providers and returns the response with HTTP 200.
A successful settlement debits your Circle Gateway balance and emits a settlement receipt back in the response headers. Failed settlements (insufficient balance, expired authorization, etc.) return a 402 again so you can pick a different chain or top up.

Limits and operational notes

  • Authorization validity window: Circle Gateway requires the signed authorization’s validBefore to be at least ~4 days in the future. Edge advertises maxTimeoutSeconds: 604800 (7 days) so SDK defaults work out of the box.

See also

Can’t find what you’re looking for? Reach out to us at support@goldsky.com for help.