# Autopilot

Delta-neutral autopilot controls. Require Privy JWT and Pro subscription.

## Get autopilot status

> Returns the user's autopilot configuration, USDC balances, open positions,\
> and lifetime statistics.\
> \
> The \`agent\_approved\` field indicates whether the user has signed \`approveAgent\`\
> on Hyperliquid. Autopilot cannot be enabled without agent approval.<br>

```json
{"openapi":"3.1.0","info":{"title":"Zirodelta API","version":"1.0.0"},"tags":[{"name":"Autopilot","description":"Delta-neutral autopilot controls. Require Privy JWT and Pro subscription."}],"servers":[{"url":"https://api.dex.zirodelta.xyz","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com."}},"headers":{"X-RateLimit-Limit":{"description":"Maximum requests allowed in the current rate limit window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current rate limit window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp (seconds) when the current rate limit window resets.","schema":{"type":"integer"}}},"schemas":{"AutopilotStatus":{"type":"object","required":["enabled","hl_account","agent_approved","balance","positions","stats"],"properties":{"enabled":{"type":"boolean","description":"Whether autopilot is currently active for this user."},"hl_account":{"type":"string","description":"User's Hyperliquid account address linked to the agent wallet. Empty string if not set up."},"agent_approved":{"type":"boolean","description":"Whether the user has approved the agent wallet via approveAgent on Hyperliquid."},"max_usdc":{"type":"number","format":"double","nullable":true,"description":"Maximum USDC the autopilot is allowed to deploy. Null means no cap."},"balance":{"$ref":"#/components/schemas/AutopilotBalance"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/AutopilotPositionEntry"}},"stats":{"$ref":"#/components/schemas/AutopilotStats"}}},"AutopilotBalance":{"type":"object","required":["perp_withdrawable","spot_usdc","total"],"properties":{"perp_withdrawable":{"type":"number","format":"double","description":"Withdrawable USDC balance in the perpetuals account."},"spot_usdc":{"type":"number","format":"double","description":"USDC balance in the spot account."},"total":{"type":"number","format":"double","description":"Sum of perp_withdrawable and spot_usdc."}}},"AutopilotPositionEntry":{"type":"object","required":["id","coin","size_usd","spot_px","spot_sz","perp_px","perp_sz","opened_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Autopilot position record UUID."},"coin":{"type":"string"},"size_usd":{"type":"number","format":"double","description":"Total USD notional of the position."},"spot_px":{"type":"number","format":"double","description":"Spot leg entry price in USD."},"spot_sz":{"type":"number","format":"double","description":"Spot leg size in coin units."},"perp_px":{"type":"number","format":"double","description":"Perp leg entry price in USD."},"perp_sz":{"type":"number","format":"double","description":"Perp leg size in coin units."},"opened_at":{"type":"string","format":"date-time","description":"Timestamp when the position was opened."}}},"AutopilotStats":{"type":"object","required":["open_count","closed_count"],"properties":{"open_count":{"type":"integer","description":"Number of currently open autopilot positions."},"closed_count":{"type":"integer","description":"Total number of closed autopilot positions across all time."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error description."},"retry_after":{"type":"integer","description":"Seconds to wait before retrying. Present only on 429 responses."}}}},"responses":{"Unauthorized":{"description":"Missing or invalid JWT.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"Rate limit exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"Internal server error.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/autopilot":{"get":{"operationId":"getAutopilotStatus","summary":"Get autopilot status","description":"Returns the user's autopilot configuration, USDC balances, open positions,\nand lifetime statistics.\n\nThe `agent_approved` field indicates whether the user has signed `approveAgent`\non Hyperliquid. Autopilot cannot be enabled without agent approval.\n","tags":["Autopilot"],"responses":{"200":{"description":"Autopilot status.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutopilotStatus"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"Database unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Enable or disable autopilot

> Enables or disables autopilot for the authenticated user.\
> Requires an active Pro subscription and an approved agent wallet.<br>

```json
{"openapi":"3.1.0","info":{"title":"Zirodelta API","version":"1.0.0"},"tags":[{"name":"Autopilot","description":"Delta-neutral autopilot controls. Require Privy JWT and Pro subscription."}],"servers":[{"url":"https://api.dex.zirodelta.xyz","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com."}},"headers":{"X-RateLimit-Limit":{"description":"Maximum requests allowed in the current rate limit window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current rate limit window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp (seconds) when the current rate limit window resets.","schema":{"type":"integer"}}},"responses":{"BadRequest":{"description":"Invalid request parameters or body.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid JWT.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"Rate limit exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"Internal server error.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error description."},"retry_after":{"type":"integer","description":"Seconds to wait before retrying. Present only on 429 responses."}}}}},"paths":{"/api/autopilot/toggle":{"post":{"operationId":"toggleAutopilot","summary":"Enable or disable autopilot","description":"Enables or disables autopilot for the authenticated user.\nRequires an active Pro subscription and an approved agent wallet.\n","tags":["Autopilot"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean","description":"Set to true to enable autopilot, false to disable."}}}}}},"responses":{"200":{"description":"Autopilot state updated.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"Pro subscription required or agent wallet not yet approved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Update autopilot settings

> Updates autopilot configuration. Currently supports setting a maximum USDC\
> deployment cap. Set \`max\_usdc\` to null to remove the cap (no limit).<br>

```json
{"openapi":"3.1.0","info":{"title":"Zirodelta API","version":"1.0.0"},"tags":[{"name":"Autopilot","description":"Delta-neutral autopilot controls. Require Privy JWT and Pro subscription."}],"servers":[{"url":"https://api.dex.zirodelta.xyz","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com."}},"headers":{"X-RateLimit-Limit":{"description":"Maximum requests allowed in the current rate limit window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current rate limit window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp (seconds) when the current rate limit window resets.","schema":{"type":"integer"}}},"responses":{"BadRequest":{"description":"Invalid request parameters or body.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid JWT.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"Rate limit exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"Internal server error.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error description."},"retry_after":{"type":"integer","description":"Seconds to wait before retrying. Present only on 429 responses."}}}}},"paths":{"/api/autopilot/settings":{"patch":{"operationId":"updateAutopilotSettings","summary":"Update autopilot settings","description":"Updates autopilot configuration. Currently supports setting a maximum USDC\ndeployment cap. Set `max_usdc` to null to remove the cap (no limit).\n","tags":["Autopilot"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"max_usdc":{"type":"number","format":"double","nullable":true,"description":"Maximum USDC autopilot is allowed to deploy. Set to null to remove the cap."}}}}}},"responses":{"200":{"description":"Settings updated.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","required":["max_usdc"],"properties":{"max_usdc":{"type":"number","format":"double","nullable":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zirodelta.com/api-reference/autopilot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
