What Is a Hyperliquid API Wallet? How Agent Wallets Work
How Hyperliquid API (agent) wallets work: they only sign, how many an account can have, expiry, pruning, and why to use one per bot or sub-account.
Direct answer
A Hyperliquid API wallet, also called an agent wallet, is a separate key that a master account approves to sign on its behalf, including for sub-accounts. The docs say API wallets are only used to sign: to read account data you must query the real master or sub-account address, not the agent's. An account can name up to a few agents, set an expiry, and should use a fresh agent per trading process rather than reusing addresses.
In short
- 1An API wallet signs; it is not the account you query for balances.
- 2Use a separate API wallet per trading process or sub-account to avoid nonce collisions.
- 3Do not reuse a deregistered agent address, because pruned nonce state can allow replay.
What is an API wallet?
The docs use the terms API wallet and agent wallet interchangeably. A master account approves one with an approveAgent action, and the approved key can then sign orders on behalf of the master account or any of its sub-accounts. This lets a bot or a mobile app trade without holding your main key for every action.
The docs add a warning that explains a common beginner error. API wallets are only used to sign. If you query balances or positions with the agent's address, you get an empty result, because the account data lives under the master or sub-account address.
How many can you have, and do they expire?
The exchange endpoint docs say an account can have one unnamed approved wallet and up to three named ones, with two additional named agents allowed per sub-account. You can set an expiry by appending valid_until and a timestamp to the name. The sub-accounts page describes the count a little differently, starting at 3 and adding 2 per sub-account, so check the current wording before you plan around a number.
When is an API wallet pruned, and why does it matter?
The docs list three triggers. The wallet is deregistered, which happens when you register a new unnamed wallet or reuse a name. The wallet expires. Or the registering account no longer has funds. After pruning, its used nonce state can be removed.
The docs strongly suggest not reusing the address of a deregistered agent, because previously signed actions can be replayed once the nonce set is pruned. For anyone running automation, the rule is simple: generate a new agent wallet for each new use.
Why use one API wallet per process or sub-account?
Hyperliquid stores the 100 highest nonces per signer, and nonces must be larger than the smallest stored one, never reused, and within a two-day-back, one-day-forward window of the block time. Nonces are tracked per signer, so one API wallet signing for several sub-accounts shares a single tracker.
The docs therefore recommend a separate API wallet for each trading process and each sub-account to avoid collisions.
Example: a bot and a manual trader sharing one key
Say you run a grid bot on one sub-account and trade by hand on another, and both sign with the same API wallet. Both streams of orders draw nonces from the same set. If the bot sends thousands of orders and cancels, your manual order can collide or be rejected.
Splitting them into two API wallets, one per sub-account, gives each its own nonce tracker and also lets you revoke the bot's access without touching your manual key.
Common mistakes
These show up repeatedly in the docs' own warnings.
- Querying account data with the agent address and concluding the account is empty.
- Reusing an agent address after it was deregistered.
- Using one API wallet for several sub-accounts and hitting nonce collisions.
- Signing a builder-fee approval with an agent, which the docs say must come from the main wallet.
Practical next steps
Make a short list of every API wallet you have approved, what it is for, and when it should expire. Prefer named wallets with an expiry over open-ended ones. Retire an agent when you stop using the tool it belonged to, and create a new one if you start again. Pair this with the wallet-safety guide and the builder-fee checker, because approvals and agents together describe what third parties can do with your account.
Sources
3 references · ExpandCollapse
- Hyperliquid Docs: Nonces and API walletsAccessed 2026-11-20Supports: API (agent) wallets signing for a master account or sub-accounts, pruning rules, nonce storage per signer, and the guidance to use a separate API wallet per trading process or sub-account.
- Hyperliquid Docs: Exchange endpointAccessed 2026-11-20Supports: The approveAgent and approveBuilderFee actions, API wallet naming and expiry, agent-signed asset transfers whose destination must match the source, and the withdrawal flow and fee note.
- Hyperliquid Docs: Sub-accountsAccessed 2026-11-20Supports: Sub-account creation thresholds, shared fee tiers with the master account, no referral discount on sub-accounts, and the number of API wallets available.