Skip to main content
The Hubra Agent API is an HTTP surface that does what the Hubra app does, by JSON.
Partners — building an integration that brings liquidity to Hubra? Get a referral code at partner.hubra.app and pass it on your stake calls to attribute the liquidity you bring in and track it on your dashboard. See Referral attribution.
Reads are public. Writes return unsigned Solana transactions that the caller signs locally with their own keypair, then submits via /broadcast. Hubra never holds a key.
No API key. No sign-up. No database. The on-chain signature on the actual transaction is what authorizes the user’s intent.

What it is

A thin REST layer over the same server actions that power the human Hubra app. There is no second source of truth: when an agent stakes 1 SOL via POST /api/v1/stake, the underlying mechanism is identical to a human clicking “Stake” in the UI.

Auth model

There is no API key. There is no sign-up. Every endpoint accepts requests from any caller. Authorization comes from the on-chain signature on the actual stake transaction. If the wallet that signed the transaction does not own the assets being staked, the chain rejects the transaction. The HTTP layer adds nothing beyond that. If you want to attribute requests to a wallet for future loyalty/points, send X-Hubra-Wallet: <pubkey> as a header. It is optional and currently informational only.

Base URL and versioning

All endpoints under /api/v1. Breaking changes ship as /api/v2. Every response includes the header:

Conventions

For the full conventions reference, see Conventions.

Strategy keys

The four canonical paths: For the full strategy reference (intros, steps, on-chain handles), see Strategies or call GET /api/v1/strategies.

Postman collection

Import the full Agent API into Postman to try every endpoint without writing code.

Download Postman collection

hubra-agent-api.postman_collection.json — all read and write endpoints, pre-configured.

End-to-end flow


The hubra_token gate

/stake and /unstake responses include a hubra_token (an HMAC over the unsigned transaction’s message bytes). /broadcast requires this token; without a matching token, it rejects the request. This prevents /broadcast from being used as a free Solana RPC for arbitrary transactions. Tokens are valid for ~2 minutes (matching Solana’s blockhash window). Rebuild via /stake or /unstake if expired. For Sanctum-routed flows, you also need to forward sanctumKind and sanctum_order from the build response to /broadcast. See Hubra token for the full mechanics.

What’s next

Quickstart

First request to first stake transaction.

Conventions

JSON, errors, decimals, CORS.

Strategies

The strategy registry.

Stake

POST /api/v1/stake reference.