Docs

Getting Started

Create an API key and make your first blockchain RPC request with Dwellir in minutes. Includes cURL, Web3.js, Ethers.js, and WebSocket quickstart examples.

This guide helps you create an API key and make your first request in minutes.

1. Sign Up and Get Your API Key

  1. Go to dashboard.dwellir.com and sign up
  2. Your first API key is created automatically -- find it in the API Keys section
  3. Copy your API key (format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

Need additional keys? Create them from the dashboard or the Dwellir CLI:

Bash
curl -fsSL https://raw.githubusercontent.com/dwellir-public/cli/main/scripts/install.sh | sh
dwellir auth login
dwellir keys create --name my-key

2. Choose a Network

Select from 140+ supported networks. Popular choices include:

  • Ethereum: ethereum-mainnet
  • Base: base-mainnet
  • Arbitrum: arbitrum-one
  • Polygon: polygon-mainnet
  • Polkadot: polkadot

See the full list in Supported Chains, or use the CLI to browse all endpoints:

Bash
dwellir endpoints search ethereum
dwellir endpoints list --ecosystem evm --network mainnet

3. Make Your First Request

The API key goes directly in the URL. No Authorization header needed.

Using cURL

Bash
curl -X POST \
  -H "Content-Type: application/json" \
  https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }'

Endpoint URL Format

Text
https://api-{network}.n.dwellir.com/{YOUR_API_KEY}
wss://api-{network}.n.dwellir.com/{YOUR_API_KEY}

For example, to query Ethereum mainnet:

Bash
curl -X POST \
  -H "Content-Type: application/json" \
  https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

4. Use an SDK

Web3.js

JavaScript
const Web3 = require('web3');

// API key is in the URL, no auth header needed
const web3 = new Web3('https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY');

// Make requests
const blockNumber = await web3.eth.getBlockNumber();
console.log('Latest block:', blockNumber);

// Get balance
const balance = await web3.eth.getBalance('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb');
console.log('Balance:', web3.utils.fromWei(balance, 'ether'), 'ETH');

Ethers.js

JavaScript
import { JsonRpcProvider } from 'ethers';

// API key is in the URL, no auth header needed
const provider = new JsonRpcProvider(
  'https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY'
);

// Make requests
const blockNumber = await provider.getBlockNumber();
console.log('Latest block:', blockNumber);

// Get balance
const balance = await provider.getBalance('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb');
console.log('Balance:', ethers.formatEther(balance), 'ETH');

WebSocket Connection

JavaScript
const WebSocket = require('ws');

const ws = new WebSocket('wss://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY');

ws.on('open', () => {
  // Subscribe to new blocks
  ws.send(JSON.stringify({
    jsonrpc: '2.0',
    method: 'eth_subscribe',
    params: ['newHeads'],
    id: 1
  }));
});

ws.on('message', (data) => {
  const response = JSON.parse(data);
  console.log('New block:', response);
});

5. Configure API Quotas

Protect yourself from unexpected usage by setting quotas on your API keys:

  1. Go to dashboard.dwellir.com/api-keys
  2. Click the edit icon next to your API key
  3. In the Edit API key dialog:
    • Name: Give your key a descriptive name
    • Daily quota: Toggle and set daily request limit
    • Monthly quota: Toggle and set monthly request limit
  4. Click "Update API Key" to save changes

Or set quotas from the CLI:

Bash
dwellir keys create --name production --daily-quota 100000 --monthly-quota 3000000

When a quota is reached, the API returns a 429 error until the quota resets.

6. Monitor Your Usage

Track your API usage in real-time:

  1. Go to dashboard.dwellir.com/usage
  2. View metrics: total requests, requests by method/network, response times, and error rates

Or use the CLI for programmatic access:

Bash
dwellir usage summary
dwellir usage history --interval day
dwellir logs errors --status-code 429

7. Best Practices

Error Handling

JavaScript
async function makeRequest() {
  try {
    const blockNumber = await web3.eth.getBlockNumber();
    return blockNumber;
  } catch (error) {
    if (error.code === 429) {
      console.log('Rate limit exceeded, retry after delay');
      // Implement exponential backoff
    } else {
      console.error('Request failed:', error);
    }
  }
}

Connection Pooling

JavaScript
// Reuse provider instances
const providers = {
  ethereum: new Web3('https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY'),
  polygon: new Web3('https://api-polygon-mainnet.n.dwellir.com/YOUR_API_KEY'),
  arbitrum: new Web3('https://api-arbitrum-one.n.dwellir.com/YOUR_API_KEY')
};

// Use the same provider for multiple requests
async function getMultiChainData() {
  const ethBlock = await providers.ethereum.eth.getBlockNumber();
  const polyBlock = await providers.polygon.eth.getBlockNumber();
  const arbBlock = await providers.arbitrum.eth.getBlockNumber();

  return { ethBlock, polyBlock, arbBlock };
}

Batch Requests

JavaScript
// Batch multiple calls into one request
const batch = new web3.BatchRequest();

batch.add(web3.eth.getBlockNumber.request((err, res) => {
  console.log('Block number:', res);
}));

batch.add(web3.eth.getGasPrice.request((err, res) => {
  console.log('Gas price:', res);
}));

batch.execute();

Migrating from Another Provider

Switching from Alchemy, Infura, QuickNode, or another RPC provider? Use the migration prompt below with your AI coding agent to automate the process. It scans your codebase for existing RPC endpoints, matches them against Dwellir's catalog, and replaces the URLs.

Text
Migrate this project's blockchain RPC endpoints to Dwellir. Follow the phases below in order. Use subagents and background processes to parallelize work wherever your tooling supports it.

## Phase 1 — Environment & Endpoint Discovery

1. Check whether the Dwellir CLI is installed by running `dwellir --version`. If the command is not found, suggest the user install it:
   curl -fsSL https://raw.githubusercontent.com/dwellir-public/cli/main/scripts/install.sh | sh
2. Obtain the full list of Dwellir-supported chains, networks, and node types (full vs archive). Try one of these approaches in order until one succeeds:
   a. **CLI** (preferred): Run `dwellir endpoints list` to get the complete endpoint catalog.
   b. **Documentation**: If the CLI is unavailable or the user declines to install it, fetch https://www.dwellir.com/docs.md or https://www.dwellir.com/networks.md for the supported endpoint list.
   c. **Dashboard export**: As a last resort, ask the user to go to dashboard.dwellir.com/endpoints and press the Export button (top-left) to export all endpoints as CSV, Markdown, or JSON, then share the file with you.
3. Check whether the project uses separate configurations per environment (production, staging, development, etc.). If it does, ask the user to provide a Dwellir API key for each environment. If there is only one environment, ask for a single key.

## Phase 2 — Codebase Discovery

Scan the entire codebase in parallel where possible:

1. Find every RPC endpoint URL (look for domains like infura.io, alchemy.com, quicknode.com, chainstack.com, ankr.com, blast.io, drpc.org, and any other known RPC providers, as well as raw IP/port patterns and chain-specific gateway URLs).
2. Identify each endpoint's chain, network, and authentication method (API key in URL path, header, query param, or none).
3. Determine whether the code requires an archive node or a full node for each endpoint (look for calls to historical state such as eth_getBalance at old block heights, debug_*/trace_* namespaces, or large block-range log filters).
4. Check if the codebase interacts with Hyperliquid. If it does, suggest that the user install Dwellir's Hyperliquid Skills: npx skills add https://github.com/dwellir-public/hyperliquid-skills

## Phase 3 — Compatibility Matching

For each discovered endpoint:

1. Compare the chain + network against the Dwellir endpoints list from Phase 1. Note that some providers (especially for EVM chains) use chain ID-based naming in their URLs rather than chain + network names — resolve any ambiguity by calling the endpoint's RPC method for chain ID (e.g., eth_chainId) and comparing the result against the chain ID returned by the corresponding Dwellir endpoint to confirm they serve the same network.
2. If the code requires an archive node and Dwellir only offers a full node for that chain, mark the endpoint as unsupported and do NOT migrate it.
3. For EVM chains, check whether the codebase depends on client-specific response shapes (e.g., Geth/Erigon trace formats vs Reth, differences in debug_traceTransaction output, or Parity-style trace_* responses). Use web search if needed to understand current client-level differences. Flag any potential incompatibilities.

## Phase 4 — Migration

1. Create a new branch (e.g., chore/migrate-to-dwellir) — NEVER commit directly to main.
2. For each supported endpoint, replace the provider URL with the equivalent Dwellir endpoint URL and update the authentication to use the correct Dwellir API key for each environment. Preserve the existing configuration pattern (env var, config file, etc.).
3. If any endpoints, chains, or networks in the codebase are NOT supported by Dwellir, do not touch them.

## Phase 5 — Summary

Present a clear summary with:

- Migrated: list of endpoints successfully switched to Dwellir (chain, network, full/archive).
- Flagged: any EVM client compatibility concerns the user should verify.
- Not supported: list of endpoints/chains/networks Dwellir does not currently support, along with whether each requires a full or archive node and the estimated monthly request volume if determinable from the code. Ask the user to reach out to support@dwellir.com or the team on https://t.me/dwellir with this list so Dwellir can evaluate adding support.

If there are any questions about supported RPC methods or Dwellir services, consult https://www.dwellir.com/docs/llms.txt and https://www.dwellir.com/docs.md for authoritative reference.

Commit the changes and ask the user whether you should push the branch to origin and open a pull request.

See Agent Tooling for more tools and documentation endpoints built for AI coding agents.

Quick Reference

Endpoint Format

Text
https://api-{network}.n.dwellir.com/{YOUR_API_KEY}
wss://api-{network}.n.dwellir.com/{YOUR_API_KEY}

Common Networks

  • Ethereum: api-ethereum-mainnet
  • Base: api-base-mainnet
  • Arbitrum: api-arbitrum-one
  • Optimism: api-optimism-mainnet
  • Polygon: api-polygon-mainnet
  • BSC: api-bsc-mainnet
  • Avalanche: api-avalanche-c-chain

Need Help?

Ready to scale? Upgrade your plan for higher rate limits and additional features.