# Agent Wallet

## Get agent wallet status

> Check if an agent wallet exists for the authenticated user and retrieve its status. Agent wallets are used to execute trades on Hyperliquid Exchange on behalf of users and are valid for 180 days with automatic 30-day rotations.

```json
{"openapi":"3.0.0","info":{"title":"Pear Protocol Trading API","version":"1.0.0"},"servers":[{"url":"https://hl-v2.pearprotocol.io","description":"Production (Mainnet)"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"GetAgentWalletResponseDto":{"type":"object","properties":{"agentWalletAddress":{"type":"string","description":"Agent wallet address for Hyperliquid operations"}},"required":["agentWalletAddress"]}}},"paths":{"/agentWallet":{"get":{"description":"Check if an agent wallet exists for the authenticated user and retrieve its status. Agent wallets are used to execute trades on Hyperliquid Exchange on behalf of users and are valid for 180 days with automatic 30-day rotations.","operationId":"AgentWalletController_getAgentWallet","parameters":[],"responses":{"200":{"description":"Agent wallet found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAgentWalletResponseDto"}}}},"404":{"description":"Agent wallet not found"}},"summary":"Get agent wallet status","tags":["Agent Wallet"]}}}}
```

## Create a new agent wallet

> Create a new agent wallet for the authenticated user. The wallet private key is securely stored and encrypted within Pear Protocol. After creation, the user must approve the wallet through Hyperliquid's agent wallet approval process.

```json
{"openapi":"3.0.0","info":{"title":"Pear Protocol Trading API","version":"1.0.0"},"servers":[{"url":"https://hl-v2.pearprotocol.io","description":"Production (Mainnet)"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"CreateAgentWalletResponseDto":{"type":"object","properties":{"agentWalletAddress":{"type":"string","description":"Newly created agent wallet address - user must approve this on Hyperliquid"},"message":{"type":"string","description":"Next steps instruction for user"}},"required":["agentWalletAddress","message"]}}},"paths":{"/agentWallet":{"post":{"description":"Create a new agent wallet for the authenticated user. The wallet private key is securely stored and encrypted within Pear Protocol. After creation, the user must approve the wallet through Hyperliquid's agent wallet approval process.","operationId":"AgentWalletController_createAgentWallet","parameters":[],"responses":{"201":{"description":"Agent wallet created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentWalletResponseDto"}}}}},"summary":"Create a new agent wallet","tags":["Agent Wallet"]}}}}
```


---

# 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.pearprotocol.io/api-integration/api-specification/agent-wallet.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.
