> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trydocent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API for agents

> Let your AI agents and bots trade through Docent programmatically.

Docent exposes a REST API that lets AI agents, trading bots, and developers trade on Hyperliquid and Polymarket without the mobile app. Each API account gets a dedicated non-custodial wallet, and you authenticate every request with an API key.

## What you can do

* **Trade perpetuals** on Hyperliquid
* **Trade spot tokens** like PURR and HFUN on Hyperliquid
* **Trade prediction markets** on Polymarket
* **Check balances and positions** across venues in one API
* **Move funds** between venues without manual bridging
* **Poll order and transfer status** as workflows complete

All of this is available through simple HTTP requests.

## How it works

<CardGroup cols={2}>
  <Card title="Register" icon="key">
    Create an API agent. You get a one-time API key right away.
  </Card>

  <Card title="Fund" icon="wallet">
    Send USDC to your wallet on Arbitrum or Base. Docent handles venue-to-venue moves for you.
  </Card>

  <Card title="Trade" icon="arrow-trend-up">
    Place orders through the API. Docent auto-funds from your unified balance when a venue needs cash.
  </Card>

  <Card title="Poll" icon="rotate">
    Orders and transfers execute asynchronously. Poll the actions or transfers endpoint for status.
  </Card>
</CardGroup>

## Unified balance

Your API account has one balance view across the trading venues Docent supports. When you place a trade, Docent can move funds to the right venue before execution.

| Venue                  | What it holds                               |
| ---------------------- | ------------------------------------------- |
| EVM                    | USDC in your wallet on supported EVM chains |
| Hyperliquid spot       | Spot token balances and transferable USDC   |
| Hyperliquid perpetuals | Perpetual margin and P\&L                   |
| Polymarket Safe        | Prediction market collateral                |

## Non-custodial by default

Every API account is backed by a dedicated [Privy](https://www.privy.io/) server wallet. The API supports trading and venue-to-venue transfers only. It does not support external withdrawals to arbitrary addresses.

* Your wallet is created and managed by Privy
* Private keys stay inside Privy's Trusted Execution Environments
* API keys can be rotated or revoked at any time

## Rate limits and permissions

Each API key includes `read`, `trade`, `transfer`, and `strategies` scopes.

| Tier     | Limit                   |
| -------- | ----------------------- |
| Standard | 60 requests per minute  |
| Premium  | 300 requests per minute |

The `strategies` scope is reserved for strategy endpoints that are coming soon.

## Example: long BTC in four lines

```bash theme={null}
curl -X POST https://api.trydocent.com/v1/orders/perp \
  -H "Authorization: Bearer dk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"symbol":"BTC","side":"long","size":"0.001","orderType":"market"}'
```

## Get started

<Card title="API quickstart" icon="rocket" href="/api-reference/quickstart">
  Create an API agent, fund its wallet, and place your first trade.
</Card>
