๐Ÿ”Œ API & Developers

Hyperliquid approveAgent Action: Approve an API Wallet via POST /exchange

โš ๏ธ Disclosure: Some links on this page are affiliate links. If you sign up through them, I may earn a commission โ€” at no extra cost to you.
To approve an API walletโ€”also called an agent walletโ€”send a signed POST request to https://api.hyperliquid.xyz/exchange with action.type set to approveAgent. The documented successful response is:

{
  "status": "ok",
  "response": {
    "type": "default"
  }
}

The following is based on the Hyperliquid exchange endpoint documentation available on 2026-11-17.

Endpoint and header

ItemValue
MethodPOST
URLhttps://api.hyperliquid.xyz/exchange
Required headerContent-Type: application/json

Required approveAgent fields

FieldTypeDescription
action.typeStringMust be approveAgent.
action.hyperliquidChainStringUse Mainnet on mainnet, or Testnet on testnet.
action.signatureChainIdStringChain ID used when signing, in hexadecimal format. The documentation gives 0xa4b1 as the Arbitrum example.
action.agentAddressStringAPI wallet address in 42-character hexadecimal format.
action.agentNameString, optionalOptional name for the API wallet. A custom expiration can be appended as valid_until {timestamp} after the name.
action.nonceNumberCurrent timestamp in milliseconds. It must match the outer nonce.
nonceNumberOuter request nonce. The documentation recommends using the current timestamp in milliseconds.
signatureObjectRequired signature object. The exchange endpoint documentation points to the Python SDK for code to generate signatures for these requests.

agentName slot limits and expiration

The documentation states the following limits:

Example name syntax shown by the documentation:

bot valid_until <timestamp>

Example payload

This is a reference payload structure, not a live-tested request. Replace the placeholder values and generate the required signature object with your signing implementation.

๐Ÿ’ก Hyperliquid

Like what you're reading? Try it yourself โ€” this link supports ChartedTrader at no cost to you.

Open a Hyperliquid account โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime

payload = {
    "action": {
        "type": "approveAgent",
        "hyperliquidChain": "Mainnet",
        "signatureChainId": "0xa4b1",
        "agentAddress": "0x0000000000000000000000000000000000000000",
        "agentName": "bot valid_until <timestamp>",
        "nonce": 1763376000000,
    },
    "nonce": 1763376000000,
    "signature": generated_signature_object,
}

The inner action.nonce and outer nonce must match.

Expected response

The documented 200 response is:

{
  "status": "ok",
  "response": {
    "type": "default"
  }
}

Affiliate note

Open a Hyperliquid account โ€” The Hyperliquid link is an affiliate link and may earn a commission. Referred accounts receive a 4% fee discount on the first $25M of volume, excluding Vaults and sub-accounts.

Continue with Hyperliquid

Browse the Hyperliquid guide hub for the complete user journey.

๐Ÿงฎ Free Hyperliquid calculators

Fee Calculator โ†’
Hyperliquid vs centralized exchange fee comparison
PnL & Liquidation โ†’
Perp PnL + liquidation price
Position Size โ†’
Risk-aware position sizing for HL perps
Hyperliquid

Ready to get started? Use the link below โ€” it helps support ChartedTrader at no cost to you.

Open a Hyperliquid account โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime
๐Ÿ“ˆ

About the author

I'm a systematic trader running live strategies on IB (USDJPY momentum) and Hyperliquid (crypto perps). Questions? Reach out.

๐Ÿ“š Related Articles

๐Ÿ“–
Guides

Hyperliquid Builder Codes: Approve and Revoke a Per-Builder Max Fee Rate

How Hyperliquid builder codes work: the main-wallet ApproveBuilderFee action, per-order fee units, info queries, and that docs say permissions can be revoked at any time.

July 8, 2026 โฑ 5 min read
๐Ÿ”Œ
API & Developers

Hyperliquid cDeposit and tokenDelegate API: Deposit Native Tokens into Staking and Delegate to Validators

Use POST /exchange cDeposit and tokenDelegate to move native tokens into staking and delegate them to validators. Fields, agent cDeposit2, 1-day lockup, and responses.

November 16, 2026 โฑ 4 min read
๐Ÿ”Œ
API & Developers

Hyperliquid API Agent Wallet: Revoke & Fix (2026)

Learn how to safely revoke and reset API agent wallet permissions on Hyperliquid. Troubleshoot stale permissions, SDK errors, and vault deposit rejections step-by-step.

August 4, 2026 โฑ 11 min read