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

# Quickstart

> From an API key to a booked ticket in three calls.

> [!TIP]
>
> Want to see it work first? The **Playground** in the [partner console](https://dashboard.flyskye.ai) runs a sandbox search and
> opens a test checkout with no key and no code.

**1. Create a test key**

Sign in to the [partner console](https://dashboard.flyskye.ai) and create a key. Test keys start with `pk_test_`, are
never billed, and return dummy fares with simulated payments.

**2. Swap the key for an access token**

```bash theme={"system"}
curl -X POST https://api.flyskye.ai/v1/token \
  -H "Authorization: Bearer pk_test_your_key"
```

The response carries `access_token` (`sat_...`). Send it as the bearer on every other call. It lasts an hour.

**3. Search flights**

```bash theme={"system"}
curl -X POST https://api.flyskye.ai/v1/search \
  -H "Authorization: Bearer sat_your_access_token" \
  -H "Content-Type: application/json" \
  -d '{"origin":"BLR","destination":"DEL","departDate":"2026-12-24","adults":1}'
```

Show the offers to your user and let them pick one. Keep its `offerId`.

**4. Open a booking session**

```bash theme={"system"}
curl -X POST https://api.flyskye.ai/v1/bookings/session \
  -H "Authorization: Bearer sat_your_access_token" \
  -H "Content-Type: application/json" \
  -d '{"offerId":"off_test_..."}'
```

The response carries a `checkoutUrl` and a `quote` with the exact amount the traveller pays.

**5. Hand off to Skye checkout**

Open `checkoutUrl` for the user. They add travellers and pay by UPI, card or netbanking, and the e-ticket is emailed to
them.

**6. Follow the result**

Listen for a [webhook](https://docs.flyskye.ai/webhooks.md), or poll [`GET /bookings/session/{id}/payment`](https://docs.flyskye.ai/booking-status) until
`booking.state` is `ticketed`.

## The same flow in code

```js Node.js theme={"system"}
const BASE = "https://api.flyskye.ai/v1";

const { access_token } = await fetch(`${BASE}/token`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.SKYE_API_KEY}` },
}).then((r) => r.json());

const auth = { Authorization: `Bearer ${access_token}`, "Content-Type": "application/json" };

const { offers } = await fetch(`${BASE}/search`, {
  method: "POST",
  headers: auth,
  body: JSON.stringify({ origin: "BLR", destination: "DEL", departDate: "2026-12-24", adults: 1 }),
}).then((r) => r.json());

const session = await fetch(`${BASE}/bookings/session`, {
  method: "POST",
  headers: auth,
  body: JSON.stringify({ offerId: offers[0].offerId }),
}).then((r) => r.json());

console.log(session.checkoutUrl); // hand this to your user
```

```python Python theme={"system"}
import os, requests

BASE = "https://api.flyskye.ai/v1"

token = requests.post(f"{BASE}/token",
    headers={"Authorization": f"Bearer {os.environ['SKYE_API_KEY']}"}).json()["access_token"]
auth = {"Authorization": f"Bearer {token}"}

offers = requests.post(f"{BASE}/search", headers=auth, json={
    "origin": "BLR", "destination": "DEL", "departDate": "2026-12-24", "adults": 1,
}).json()["offers"]

session = requests.post(f"{BASE}/bookings/session", headers=auth,
    json={"offerId": offers[0]["offerId"]}).json()

print(session["checkoutUrl"])  # hand this to your user
```

> [!TIP]
>
> Building an agent? The [MCP server](https://docs.flyskye.ai/mcp.md) gives it the same search and handoff as tools, with no token exchange.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.