Skip to main content

APIs

Prysm serves three kinds of API. All of them listen on 127.0.0.1 by default. Keep them there, and reach them from other machines through an SSH tunnel or a VPN (see Security checklist).

Operating system
APIServed byDefault addressAuthenticationSpecification
Beacon APIBeacon nodehttp://127.0.0.1:3500Noneethereum.github.io/beacon-APIs
Keymanager APIValidator client, when enabledhttp://127.0.0.1:7500Bearer tokenethereum.github.io/keymanager-APIs
Prysm-only RESTBeacon nodehttp://127.0.0.1:3500/prysm/v1/…NoneThis page
gRPC (legacy)Beacon node127.0.0.1:4000NoneUsed by the Prysm validator client

Beacon API​

The standard REST API every consensus client serves. Validator clients, dashboards, and explorers use it, so tools written for any client work with Prysm. It's always on. Change where it listens with --http-host and --http-port.

Check whether the node is synced:

curl -s http://127.0.0.1:3500/eth/v1/node/syncing
{"data":{"head_slot":"1234567","sync_distance":"0","is_syncing":false,"is_optimistic":false,"el_offline":false}}

is_syncing: false means the node is at the head. el_offline: true means it can't reach the execution client.

Look up one of your validators by index or public key:

curl -s http://127.0.0.1:3500/eth/v1/beacon/states/head/validators/<VALIDATOR_INDEX_OR_PUBKEY>

Other useful requests: GET /eth/v1/node/health (200 when synced), GET /eth/v1/node/version, and GET /eth/v1/node/peer_count.

caution

The Beacon API has no authentication. Some requests are expensive enough to slow the node, and others reveal which validators you run. Don't set --http-host to 0.0.0.0 on a machine reachable from the internet.

Keymanager API​

The standard REST API for managing keys in a running validator client: list, import and delete keystores, and set per-key fee recipient, gas limit and graffiti. It's off by default. Turn it on with --rpc:

--rpc

Every request needs a bearer token, which Prysm stores in <WALLET_DIR>/auth-token (<WALLET_DIR> being your wallet directory) and creates if it doesn't exist. To put it elsewhere, set --keymanager-token-file.

List the loaded keys:

TOKEN=$(cat <WALLET_DIR>/auth-token)
curl -s \
-H "Authorization: Bearer $TOKEN" \
http://127.0.0.1:7500/eth/v1/keystores

A 200 with your keys means the API is up and the token is accepted. 401 means the header is missing; 403 means the token is wrong. For step-by-step key workflows, see Use the Keymanager API.

danger

Anyone with the token can delete your keys or sign exits. Keep --http-host on 127.0.0.1, make the token file readable only by the validator's user, and never expose port 7500.

Prysm-only endpoints​

The beacon node also serves a few REST endpoints under /prysm/v1/ that other clients don't have, on the same port as the Beacon API. For example, validator counts by status:

curl -s "http://127.0.0.1:3500/prysm/v1/beacon/states/head/validator_count?status=active,pending"

All Prysm-only endpoints:

MethodPathWhat it does
GET/prysm/v1/beacon/chain_headHead, justified and finalized checkpoints, as this node sees them.
GET/prysm/v1/beacon/weak_subjectivityCheckpoint (epoch, block root, state root) to start a checkpoint sync from.
GET/prysm/v1/beacon/states/{state_id}/validator_countNumber of validators, optionally filtered by status.
POST/prysm/v1/beacon/individual_votesVote status of chosen validators in a given epoch.
POST/prysm/v1/beacon/states/{state_id}/queryReads part of a state by SSZ path. Returns SSZ bytes.
POST/prysm/v1/beacon/blocks/{block_id}/queryReads part of a block by SSZ path. Returns SSZ bytes.
POST/prysm/v1/beacon/blobsPublishes blob sidecars for a block. Not supported from Fulu on.
GET/prysm/v1/node/custodyData column custody: custody groups and columns, earliest available slot, supernode status and backfill progress.
GET/prysm/v1/node/trusted_peersLists trusted peers.
POST/prysm/v1/node/trusted_peersAdds a trusted peer by multiaddr.
DELETE/prysm/v1/node/trusted_peers/{peer_id}Removes a trusted peer, without closing the connection.
POST/prysm/v1/validators/performanceBalances and vote correctness of chosen validators.
GET/prysm/v1/validators/{state_id}/participationShare of the active balance that voted in a given epoch.
GET/prysm/v1/validators/{state_id}/active_set_changesValidators activated, exited, slashed or ejected in a given epoch.

Tools that must work with every client should stick to the Beacon API.

gRPC​

The Prysm validator client talks to the beacon node over gRPC on port 4000 by default (--beacon-rpc-provider). It can use the Beacon API instead: set --beacon-rest-api-provider=http://127.0.0.1:3500. Prysm's flag help says gRPC stays the default and is fully supported through v8, and will eventually be removed in favor of REST. Don't build new tools on it.