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

# Quickstart

> Create an API key, get a quote, and submit a market order.

## 1. Create an API key

Open [API Key Settings](https://fundingperpetuals.com/settings?section=api-keys),
name the key, and copy the secret when it appears. Funding Perpetuals stores
only its cryptographic hash, so the secret cannot be shown again.

```bash theme={null}
export FP_API_KEY="fp_live_..."
```

## 2. List your accounts

```bash theme={null}
curl https://developers.fundingperpetuals.com/v1/accounts \
  -H "Authorization: Bearer $FP_API_KEY"
```

Copy the `id` of the challenge account you want to trade.

## 3. Find a market and request a quote

```bash theme={null}
curl https://developers.fundingperpetuals.com/v1/markets
```

Market IDs contain a pipe character. URL-encode it when it appears in a path:

```bash theme={null}
curl "https://developers.fundingperpetuals.com/v1/markets/binance%7CBTCUSDT/quote" \
  -H "Authorization: Bearer $FP_API_KEY"
```

## 4. Place a market order

Use the quote's `mid` as `expected_price`. This value records what your client
observed; the server still prices and validates the order from a fresh,
authoritative book.

```bash theme={null}
curl https://developers.fundingperpetuals.com/v1/orders \
  -X POST \
  -H "Authorization: Bearer $FP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-$(date +%s)" \
  -d '{
    "account_id": "YOUR_ACCOUNT_ID",
    "market_id": "binance|BTCUSDT",
    "side": "buy",
    "size": 0.001,
    "expected_price": 118000,
    "leverage": 2,
    "margin_mode": "cross"
  }'
```

An accepted order begins as `pending`. Read the order endpoint until it becomes
`filled` or `rejected`; use a sensible backoff and observe the documented rate
limits.

## 5. Place advanced orders

The same `/v1/orders` endpoint also accepts limit, chase, stop, take, and
external conditional orders. TWAP, VWAP, and scaled ladders use their own
parent resources. Continue with [Trading with the API](/trading-with-api) for
request shapes and lifecycle operations.
