X Layer RPC Endpoint
Flat-rate X Layer RPC provider and X Layer RPC node access: free tier, no KYC, HTTP & WebSocket. X Layer mainnet chain ID 196.
https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEYwss://rpc.swiftnodes.io/ws/xlayer?key=YOUR_API_KEYX Layer is OKX's Ethereum layer 2, with OKB as its gas token. Originally built on Polygon CDK as a zkEVM, it migrated to the OP Stack in 2025 and connects to Polygon's AggLayer for cross-chain bridging.
xlayerX Layer on the SwiftNodes fleet, right now
10 of 12 probed RPC methods supported (archive, debug_traceCall, trace_transaction, trace_filter). The gaps are listed per chain in the method support matrix.
Status and latency from our health checks, refreshed about every 5 minutes. Uptime history. Method support probed automatically on 2026-10-04. Network status
X Layer developer facts, measured
- Block time:
- ~1 s (average of the last 1,000 blocks)
- Finality:
- the finalized tag trails the head by ~1,223 blocks (~20 min)
- Historical state:
- readable at least 1,000,000 blocks back
Measured 2026-10-04 through this page's endpoint, re-measured weekly. Limits can differ between the upstream nodes behind it. All chains: measured chain facts.
About X Layer
X Layer's public mainnet launched in April 2024 on Polygon CDK. In 2025 OKX rebuilt it on the OP Stack, keeping AggLayer as its shared bridge with pessimistic proofs, and OKB became its sole gas token after supply was capped at 21 million. In June 2026 it activated an OP Succinct Lite dispute game that uses ZK proofs to resolve state challenges.
Since the migration X Layer offers EVM equivalence and OP Stack RPC behavior, so standard Ethereum tooling works. Fees are paid in OKB rather than ETH, which matters for wallets, gas estimation and relayers. The chain is closely tied to OKX exchange and OKX Wallet users.
Common Use Cases on X Layer
- Deposits and withdrawals from OKX
- DEX trading and DeFi
- Stablecoin payments
- OKX Wallet dapps
X Layer Mainnet RPC URL (HTTP)
https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEYX Layer WebSocket RPC URL
wss://rpc.swiftnodes.io/ws/xlayer?key=YOUR_API_KEYQuick Start: Connect to X Layer
cURL
curl -X POST https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'ethers.js
import { JsonRpcProvider } from "ethers";
const provider = new JsonRpcProvider(
"https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY"
);
const blockNumber = await provider.getBlockNumber();
console.log("X Layer block:", blockNumber);viem
import { createPublicClient, http } from "viem";
const client = createPublicClient({
transport: http("https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY"),
});
const blockNumber = await client.getBlockNumber();web3.py
from web3 import Web3
w3 = Web3(Web3.HTTPProvider("https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY"))
print("X Layer block:", w3.eth.block_number)Add X Layer to MetaMask
https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEYwss://rpc.swiftnodes.io/ws/xlayer?key=YOUR_API_KEYFeatures of SwiftNodes for X Layer
- Load-balanced across multiple upstream nodes wherever a chain has more than one, with automatic failover
- Health-checked every 2 minutes with automatic failover
- Free tier available — no credit card or KYC required
- Flat-rate monthly pricing with no per-request fees
- HTTP and WebSocket support
- One API key works across all 75+ supported chains, including X Layer
Rate Limits
| Plan | Price | HTTP req/s | WS msg/s |
|---|---|---|---|
| Free | $0/mo | 2 | 1 |
| Starter | $49/mo | 50 | 25 |
| Growth | $89/mo | 150 | 75 |
| Scale | $149/mo | 300 | 150 |
| Pro | $249/mo | 500 | 250 |
Frequently Asked Questions: X Layer
What is the X Layer chain ID?
X Layer mainnet uses chain ID 196 (hex 0xc4).
What is the gas token on X Layer?
OKB. X Layer uses OKB for transaction fees, not ETH.
Is X Layer still a Polygon zkEVM chain?
No. X Layer migrated from Polygon CDK to the OP Stack in 2025. It remains connected to Polygon's AggLayer for cross-chain bridging.
X Layer RPC methods
Measured weekly through this endpoint: what each method returns on X Layer, its limits, and an example request.
- eth_getLogssupported
- eth_getBlockReceiptssupported
- eth_feeHistorysupported
- eth_getProofsupported
- eth_createAccessListsupported
- debug_traceCallsupported
- trace_blocksupported
- trace_transactionsupported
Related L2 & rollup chains
Explore RPC endpoints for other L2 & rollup networks on SwiftNodes:
Ready to start building on X Layer? Connect your wallet and get a free API key in 30 seconds. No email or KYC required.