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

# Authentication

> How to authenticate your requests to the SkyMatch API.

## API keys

All requests to the SkyMatch API require an API key. Pass your key in the request header:

```bash theme={null}
X-API-Key: your_api_key_here
```

## Getting a key

During early access, API keys are provisioned manually. Email [hello@skymatch.uk](mailto:hello@skymatch.uk) with a brief description of your platform and we'll send you a key within 24 hours.

<Note>
  A self-serve key dashboard is coming soon. For now, just email us — we respond quickly.
</Note>

## Example authenticated request

```bash theme={null}
curl 'https://api.skymatch.uk/v1/booking-confidence?lat=51.5074&lng=-0.1278&start_time=2026-04-24T18:30:00Z&duration_minutes=90' \
  -H 'X-API-Key: your_api_key_here'
```

## Key security

<Warning>
  Keep your API key private. Do not expose it in frontend JavaScript, public repos, or client-side code. Always make SkyMatch requests from your backend server.
</Warning>

* Store your key as an environment variable (e.g. `SKYMATCH_API_KEY`)
* Rotate your key immediately if you believe it has been compromised — email us and we'll issue a new one

## Environment variables

We recommend storing your key like this:

```bash .env theme={null}
SKYMATCH_API_KEY=your_api_key_here
```

Then referencing it in your code:

```javascript Node.js theme={null}
const apiKey = process.env.SKYMATCH_API_KEY;

const response = await fetch(
  'https://api.skymatch.uk/v1/booking-confidence?lat=51.5074&lng=-0.1278&start_time=2026-04-24T18:30:00Z&duration_minutes=90',
  {
    headers: { 'X-API-Key': apiKey }
  }
);
```

```python Python theme={null}
import os, requests

api_key = os.environ['SKYMATCH_API_KEY']

response = requests.get(
  'https://api.skymatch.uk/v1/booking-confidence',
  params={
    'lat': 51.5074,
    'lng': -0.1278,
    'start_time': '2026-04-24T18:30:00Z',
    'duration_minutes': 90
  },
  headers={'X-API-Key': api_key}
)
```
