> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myfundedperpetuals.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.

<Warning>
  The developer API is in beta. Breaking changes may be introduced at any time.
</Warning>

See [API capabilities](/api-capabilities) for coverage and features that
still require the website.

## 1. Create an API key

Open [API Key Settings](https://myfundedperpetuals.com/settings?section=api-keys),
name the key, and copy the secret when it appears. MyFundedPerps 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.myfundedperpetuals.com/v1/accounts \
  -H "Authorization: Bearer $FP_API_KEY"
```

`GET /v1/accounts/{account_id}` adds a fresh risk snapshot with equity,
unrealized P\&L, reserved margin, available balance, gross exposure, loss floors,
room above each floor, and remaining profit target. When any open position lacks
a fresh mark, mark-dependent values are `null` and `marks_complete` is false.

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.myfundedperpetuals.com/v1/markets
```

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

```bash theme={null}
curl --get "https://developers.myfundedperpetuals.com/v1/markets/binance%7CBTCUSDT/quote" \
  --data-urlencode "side=buy" \
  --data-urlencode "size=0.001" \
  -H "Authorization: Bearer $FP_API_KEY"
```

Providing both `side` and `size` returns `estimated_fill_price` (the mark
price adjusted by the size-based slippage tier), `slippage_bps`,
`estimated_notional`, and `estimated_fee`. `fillable` is false when the
requested size is not valid at the market's size precision.

## 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.myfundedperpetuals.com/v1/orders \
  -X POST \
  -H "Authorization: Bearer $FP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-$(date +%s)" \
  -d '{
    "client_order_id": "quickstart-entry-1",
    "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. If the placement response is lost, use
`GET /v1/orders?client_order_id=quickstart-entry-1` to recover the server order.

## 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.

For continuous market updates, connect to [market data streaming](/market-streaming)
instead of polling prices. Account and order updates remain available through REST.
