---
title: "Perp Withdraw"
method: POST
path: "/v1/perp/withdraw"
tags: ["perp"]
---

# Perp Withdraw

`POST /v1/perp/withdraw`

## Request

- Base URL: `https://api.fereai.xyz`
- URL: `https://api.fereai.xyz/v1/perp/withdraw`
- Auth: none declared

Withdraw perp collateral.

Pass ``destination_chain_id`` (+ token) to land it in the agent's own
wallet, or ``to_address`` to have Hyperliquid pay USDC on Arbitrum
straight to an outside address.

## Query parameters

- `wait` boolean: Block until task completes
- `timeout` integer: Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).

## Request body

- PerpWithdrawRequest: Withdraw perp collateral. Two ways out: ``destination_chain_id`` (+ token) lands the funds in the agent's own wallet on that chain, or ``to_address`` has Hyperliquid pay USDC on Arbitrum straight to an outside address. One of the two is required.
  - `amount_usd` number, required: USD notional of perp collateral (USDC) to withdraw. Hyperliquid deducts a flat $1 fee; minimum $6.
  - `destination_chain_id` integer, nullable: Target chain for the withdrawn token, landing in the agent's own wallet. Required unless `to_address` is set; with `to_address` omit it or pass 42161 (Arbitrum).
  - `destination_token` string, nullable: ERC-20 on destination chain, Solana mint, or null for the native token. With `to_address` omit it or pass Arbitrum USDC.
  - `to_address` string, nullable: Outside EVM address. Hyperliquid pays USDC on Arbitrum straight there (amount minus the $1 fee); it never passes through the agent's wallet. Must accept USDC on Arbitrum One; the agent's own wallets are refused.

## Response `200`

Successful Response

- TaskResponse
  - `task_id` string, required: Celery task ID for tracking the async operation.
  - `status` string: Current task status: queued, pending, started.
  - `poll_url` string, nullable: Relative URL to poll for task status.
  - `notification_stream` string, nullable: SSE stream URL for real-time task updates.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/fereai/apis/fereai-gateway.md) - [All operations](https://skmtc.dev/fereai/apis/fereai-gateway/llms.txt) - [OpenAPI document](https://skmtc.dev/fereai/apis/fereai-gateway/revisions/ad211f8e2f30?raw)
