Complete guide to using the pokt.ai RPC Gateway API
Get started with pokt.ai in minutes
Sign up at pokt.ai and create an endpoint in your dashboard.
curl -X POST "https://pokt.ai/api/gateway?endpoint=YOUR_ENDPOINT_ID" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'Use your actual endpoint ID from the dashboard. Example: eth_1760726811471_1760726811479
The main gateway endpoint for all RPC requests
https://pokt.ai/api/gateway?endpoint=YOUR_ENDPOINT_IDAll requests use standard JSON-RPC 2.0 format:
{
"jsonrpc": "2.0",
"method": "METHOD_NAME",
"params": [...],
"id": 1
}Successful responses follow JSON-RPC 2.0 specification:
{
"jsonrpc": "2.0",
"id": 1,
"result": "..."
}27+ blockchain networks available
All chains support standard Ethereum JSON-RPC methods. Solana uses its own RPC methods (e.g., getSlot).
Common use cases and code samples
Fetch the latest block number from Ethereum
curl -X POST "https://pokt.ai/api/gateway?endpoint=YOUR_ENDPOINT_ID" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1234567"
}Check the balance of an Ethereum address
curl -X POST "https://pokt.ai/api/gateway?endpoint=YOUR_ENDPOINT_ID" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", "latest"],
"id": 1
}'{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1bc16d674ec80000"
}Execute a read-only contract call
curl -X POST "https://pokt.ai/api/gateway?endpoint=YOUR_ENDPOINT_ID" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0x...",
"data": "0x..."
}, "latest"],
"id": 1
}'{
"jsonrpc": "2.0",
"id": 1,
"result": "0x..."
}Standard Ethereum JSON-RPC methods
eth_blockNumber - Get latest block numbereth_getBlockByNumber - Get block by numbereth_getBlockByHash - Get block by hasheth_getBalance - Get account balanceeth_getTransactionCount - Get nonceeth_getCode - Get contract codeeth_call - Execute contract calleth_sendTransaction - Send transactioneth_getTransactionReceipt - Get receipteth_gasPrice - Get gas priceeth_estimateGas - Estimate gasnet_version - Get network IDAll standard Ethereum JSON-RPC methods are supported. For a complete list, see the Ethereum JSON-RPC specification.
Secure your endpoints and API access
Each endpoint has a unique ID that serves as your authentication token. Include it in the query parameter:
?endpoint=YOUR_ENDPOINT_IDRate limits are configurable per endpoint. Default limits are generous, but can be adjusted in your dashboard.
All API requests must use HTTPS. HTTP requests are automatically redirected to HTTPS.
Simple, transparent pay-as-you-go pricing
That's just $0.000001 per request. No hidden fees, no monthly commitments.
All requests are automatically tracked and counted. View your usage in real-time in the dashboard.
Understanding error responses
Errors follow the JSON-RPC 2.0 error format:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "Error message here"
}
}200 - Success400 - Bad Request401 - Unauthorized429 - Rate Limit Exceeded500 - Internal Server ErrorWe're here to help you succeed
Have questions or need assistance? We're here to help.