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

# API quickstart

> Authenticate, list launches, quote a swap, and submit wallet calldata.

## 1. Create a key

Open [Developers](https://launch.o1.exchange/developers), connect the wallet that will own the key, choose scopes, and sign the off-chain management message.

The plaintext key is displayed once:

```text theme={null}
o1_launch_a1b2c3d4_<secret>
```

Store backend keys in a secret manager. For a browser integration, use a dedicated key with only the scopes it needs and add a website restriction when appropriate.

## 2. List Base launches

```bash theme={null}
curl "https://api.launch.o1.exchange/v1/tokens?chain_id=8453&market=all&sort=trending&limit=25" \
  -H "x-api-key: $O1_API_KEY"
```

Use `pagination.next_cursor` as the next request's `cursor`. Cursors are opaque, short-lived, and bound to the original filters. Ranked results remain live, so a token can move between pages; de-duplicate by `(chain_id, token.address)` and restart if the API returns `409 cursor_stale`.

## 3. Quote an exact-input buy

```bash theme={null}
curl "https://api.launch.o1.exchange/v1/swaps/quote" \
  -X POST \
  -H "content-type: application/json" \
  -H "x-api-key: $O1_API_KEY" \
  -d '{
    "chain_id": 8453,
    "wallet": "0x1111111111111111111111111111111111111111",
    "token_address": "0x2222222222222222222222222222222222222201",
    "side": "buy",
    "amount_in_raw": "10000000000000000",
    "slippage_bps": 300
  }'
```

The response contains:

* `quote_id`, signed and short-lived
* expected and minimum output in base units
* an `issues` array for balance or approval prerequisites
* ERC-20 approval transaction steps when required
* Permit2 typed data when an off-chain Permit2 signature is required

## 4. Prepare the swap

After completing any ERC-20 approval and signing any returned Permit2 typed data:

```bash theme={null}
curl "https://api.launch.o1.exchange/v1/swaps/prepare" \
  -X POST \
  -H "content-type: application/json" \
  -H "x-api-key: $O1_API_KEY" \
  -d '{
    "quote_id": "<quote_id>",
    "wallet": "0x1111111111111111111111111111111111111111"
  }'
```

Include `permit2_signature` only when the quote returned a Permit2 typed-data step. The API requotes, preserves the reviewed slippage floor, builds Universal Router calldata, and simulates it. Submit the returned transaction unchanged from the specified wallet.

## 5. Check indexing status

After confirmation:

```bash theme={null}
curl "https://api.launch.o1.exchange/v1/transactions/8453/0x<transaction-hash>" \
  -H "x-api-key: $O1_API_KEY"
```

This is the indexed public view, not a live RPC receipt endpoint. Normal chain workers discover wallet-broadcast transactions without a notification call. Use your chain provider for immediate receipt status; this endpoint may return `data: null` until the transaction is observed, then reports indexed chain and launchpad operation state.
