> For the complete documentation index, see [llms.txt](https://svpchain.gitbook.io/svpchain-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://svpchain.gitbook.io/svpchain-docs/build/api-overview.md).

# API overview

How to talk to SVPChain programmatically — EVM JSON-RPC, WebSocket, and Cosmos REST/gRPC.

SVPChain exposes two parallel API surfaces because it has two execution layers.

| Surface           | Use for                                                                         | Default port (own node)               | Public endpoint                                                                     |
| ----------------- | ------------------------------------------------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------- |
| **EVM JSON-RPC**  | Solidity contracts, MetaMask, ethers/viem, indexers — the standard `eth_*` API. | `8545`                                | RPC URLs in [Networks](https://svpchain.gitbook.io/svpchain-docs/chain/networks.md) |
| **EVM WebSocket** | Subscriptions: new heads, logs, pending tx.                                     | `8546` (mounted under `/ws` publicly) | WS URLs in [Networks](https://svpchain.gitbook.io/svpchain-docs/chain/networks.md)  |
| **Cosmos REST**   | Staking, governance, bank, native CLOB module queries.                          | `1317`                                | TODO (no public REST gateway yet)                                                   |
| **Cosmos gRPC**   | Same as REST, lower-overhead binary protocol.                                   | `9090`                                | TODO                                                                                |
| **CometBFT RPC**  | Block / consensus / mempool primitives, validator set, vote extensions.         | `26657`                               | TODO                                                                                |

For application-layer integration (wallets, dApps, indexers) the EVM JSON-RPC and WebSocket are usually all you need. Reach for the Cosmos surfaces when you need staking, governance, or CLOB-module data that isn't reflected in EVM events.

### Choose your interface

<table data-view="cards"><thead><tr><th>Interface</th><th data-card-target data-type="content-ref">Docs</th></tr></thead><tbody><tr><td>EVM JSON-RPC — methods and examples</td><td><a href="https://svpchain.gitbook.io/svpchain-docs/build/json-rpc.md">JSON-RPC</a></td></tr><tr><td>EVM WebSocket — subscriptions</td><td><a href="https://svpchain.gitbook.io/svpchain-docs/build/websocket.md">WebSocket</a></td></tr><tr><td>Indexing patterns</td><td><a href="https://svpchain.gitbook.io/svpchain-docs/build/indexing-and-events.md">Indexing &amp; events</a></td></tr></tbody></table>

### Auth and rate limits

Public RPC endpoints are open and require no authentication, but they are rate-limited and offered on a best-effort basis. For production traffic — sustained reads, indexing, market-making — [run your own node](https://svpchain.gitbook.io/svpchain-docs/chain/run-a-node.md).

{% hint style="info" %}
If you're seeing intermittent `429` responses or dropped WebSocket connections from public endpoints, that's the rate limiter. Retry with backoff, or run your own node.
{% endhint %}

### Quick health check

```sh
# EVM JSON-RPC
curl -s -X POST https://svp-dataseeds-testnet.svpchain.org \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

# WebSocket — using websocat
echo '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  | websocat wss://svp-dataseeds-testnet.svpchain.org/ws
```

Both should return a hex-encoded current block height.
