Summary
Kava combines Cosmos SDK and Ethereum Virtual Machine (EVM) compatibility, offering multiple API interfaces: Tendermint RPC, EVM JSON-RPC, REST API, and WebSocket endpoints. This article explains the available endpoint types, how to connect, and what to evaluate when choosing a Kava API provider for production dApps.
Kava API Decision Checklist
Before integrating a Kava API endpoint, evaluate these criteria:
| Criterion | What to Check | Why It Matters |
|---|---|---|
| Endpoint type | Pruning vs. Archive; EVM vs. Tendermint | Pruning endpoints only serve recent data; archive needed for historical queries. EVM for Solidity dApps, Tendermint for Cosmos-native workflows. |
| Transport protocols | HTTP and WebSocket availability | Real-time feeds (e.g., mempool, newHeads) require WebSocket. |
| Rate limits | Requests per second (RPS) and concurrency | High-throughput apps need higher limits; check burst capacity. |
| Uptime & redundancy | Multi-region failover, load balancing | Production apps require minimized risk of single-point failure. |
| Archive support | Full historical state availability | Indexers, analytics, and audit tools depend on archive nodes. |
| Pricing model | Pay-as-you-go vs. dedicated node | Variable workloads may benefit from flexible pricing; predictable load suits dedicated plans. |
| Managed infrastructure | Automatic updates, scaling, monitoring | Reduces DevOps overhead and ensures reliability. |
Understanding Kava’s Dual-Layer Architecture
Kava is a Layer-1 blockchain built on the Cosmos SDK with full Ethereum Virtual Machine (EVM) compatibility. This dual architecture means developers can interact with Kava through two separate interfaces:
- Cosmos-native: Tendermint RPC, gRPC, and REST API for querying Cosmos modules, IBC, staking, governance, and more.
- EVM layer: Standard Ethereum JSON-RPC for deploying and calling Solidity smart contracts, transferring KAVA tokens via EIP-1559, and using MetaMask or similar wallets.
Each interface has its own endpoint and method set. Understanding which one fits your use case is the first step in choosing the right Kava API provider.
Kava API Endpoint Types
Pruning vs. Archive Nodes
- Pruning nodes: Retain only the last ~1000 blocks of state. Suitable for submitting transactions and checking current balances. Lower storage cost and faster sync.
- Archive nodes: Store the complete history of all state changes since genesis. Required for queries like historical token balances, past transaction traces, and full event logs.
Both types are available for mainnet and testnet.
EVM JSON-RPC
Compatible with Ethereum tooling (ethers.js, web3.js, Hardhat, Foundry). Standard JSON-RPC methods and some Kava-specific extensions.
Example: Get the latest block number using curl
curl -X POST https://evm.kava.io \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
Example: Send a transaction using ethers.js
const { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("https://evm.kava.io");
const block = await provider.getBlockNumber();
console.log("Current block:", block);
Tendermint RPC
For Cosmos-native operations: querying validators, governance proposals, IBC transfers, and staking.
Example: Get the latest block using Tendermint RPC
curl https://rpc.kava.io/block?latest
REST API (Cosmos SDK)
RESTful endpoints for bank, staking, distribution, and other modules. Useful for building backend services.
Example: Query account balance
curl https://api.kava.io/cosmos/bank/v1beta1/balances/kava1...
WebSocket
For real-time event subscriptions, such as new blocks, pending transactions, or log filters.
Example: Subscribe to new headers
const { Web3 } = require("web3");
const web3 = new Web3("wss://evm.kava.io/ws");
const subscription = web3.eth.subscribe("newBlockHeaders", (error, block) => {
if (!error) console.log("New block:", block.number);
});
Public vs. Managed Kava API Providers
Public endpoints (like evm.kava.io, rpc.kava.io) are provided by Kava Labs and partners for free, but they come with rate limits that can hinder production use. For reliable access, many developers turn to managed infrastructure services.
| Provider | Endpoint Example | Notes |
|---|---|---|
| Kava Labs | evm.kava.io, rpc.kava.io | Free, rate-limited, no guarantee |
| Chainstack | evm.kava.chainstacklabs.com | Public, limited |
| Ankr | rpc.ankr.com/kava_evm | Public with premium tier |
| Nodies | lb.nodies.app/v1/... | Public with API key |
| Managed services (e.g., OnFinality) | Via dashboard | Adjustable limits, dedicated nodes, archive support |
When you need higher rate limits, WebSocket reliability, or archive access, consider a dedicated node or a managed RPC service. Services like OnFinality's Kava RPC offer scalable endpoints with global infrastructure, request analytics, and dedicated node options.
Common Use Cases for Kava API
- DeFi dApps: Swap, lend, and borrow tokens on Kava's EVM-compatible protocols. Requires both EVM JSON-RPC and potentially Tendermint RPC for querying IBC balances.
- Wallets: Need to fetch KAVA balances, transaction history, and submit signed transactions. Typically use a mix of REST (for balances) and EVM RPC (for token transfers).
- Indexers & Analytics: Require archive nodes to reconstruct full historical state. A managed archive endpoint can save significant storage and sync time.
- Cross-chain relayers: Interact with IBC modules via Tendermint RPC. Need reliable, low-latency connections.
- Bots & Automation: Use WebSocket connections for real-time event monitoring and transaction submission.
Troubleshooting Common Issues
- Rate Limit Errors (429): Public endpoints often throttle aggressive requests. Reduce request frequency or upgrade to a paid provider.
- WebSocket Disconnections: Ensure you handle reconnection logic in your client. Some providers limit WebSocket session duration.
- Incorrect Chain ID: Kava mainnet uses
chain-id: kava_2222-10. Double-check when signing transactions. - EVM vs. Cosmos Confusion: Use the correct endpoint for your operation. EVM RPC does not serve Cosmos queries like
cosmos.staking.v1beta1.Query/Validators.
How to Choose a Kava API Provider
Evaluate based on your workload:
- Low volume / testing: Public endpoints (with caution) or free tier from a managed provider.
- Production dApp: Look for reliability expectations, dedicated nodes, or high-rate-limit plans. Check if the provider offers both EVM and Tendermint RPC, plus WebSocket.
- Historical analysis: Archive support is non-negotiable. Some providers offer archive-only endpoints.
- Multi-chain requirements: If your app also uses other networks (e.g., Ethereum, BNB Chain), a unified provider simplifies integration.
For a side-by-side comparison of RPC providers, see our RPC provider selection guide.
Key Takeaways
- Kava offers four API interfaces: EVM JSON-RPC, Tendermint RPC, REST API, and WebSocket.
- Archive nodes are essential for historical data; pruning nodes suffice for current state.
- Public endpoints are convenient for testing but not production-grade.
- Evaluate rate limits, protocol support, and pricing before committing to a provider.
- Managed infrastructure services like OnFinality can simplify scaling and reduce operational burden.
Frequently Asked Questions
What is the Kava chain ID?
Mainnet: kava_2222-10. Testnet: kava_2221-10.
Can I use MetaMask with Kava?
Yes. Add a custom network with RPC URL: https://evm.kava.io and chain ID 2222.
Does Kava support WebSocket?
Yes, for both EVM (wss://evm.kava.io/ws) and Tendermint (wss://rpc.kava.io/websocket).
How do I get a dedicated Kava node? You can use a managed service like OnFinality, which provides dedicated Kava nodes with customizable specs and guaranteed resources.
What is the difference between Kava EVM and Kava Tendermint RPC? Kava EVM follows the Ethereum JSON-RPC spec for smart contract interaction. Tendermint RPC provides access to the Cosmos SDK's modules, including staking, governance, and IBC.
For a complete list of supported networks and endpoints, visit our networks page. To explore pricing plans for Kava RPC, see RPC pricing.