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

# Authentication

> API keys, short lived access tokens and scopes.

## API keys

Create keys in the [partner console](https://dashboard.flyskye.ai).

| Key | Mode | What it does |
| - | - | - |
| `pk_test_...` | Test | Dummy fares, simulated payments, test PNRs. Never billed. |
| `pk_live_...` | Live | Real fares, real payments, real tickets. |

Console keys carry both scopes:

| Scope | Allows |
| - | - |
| `search` | `POST /search` and `GET /bookings/{ref}` |
| `book` | Booking sessions, travellers, payment, cancel and change |

> [!WARNING]
>
> Keys are secrets. Call the API from your server only, never from a browser or an app bundle.

## Access tokens

REST calls use a short lived access token. Exchange the key for one, then send the token as the bearer on every other call.
When it expires, call `/token` again.

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

```json Response theme={"system"}
{
  "access_token": "sat_...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "expires_at": "2026-11-19T18:00:00.000Z",
  "mode": "live",
  "scope": "search book"
}
```

> [!TIP]
>
> Cache the token and refresh it a minute before `expires_at`, rather than minting one per request.

## MCP

The [MCP server](https://docs.flyskye.ai/mcp.md) is the exception: it takes the API key itself as the bearer, with no token exchange.


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