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

# Quickstart

> Create an account, get an API key and list the catalogue.

**1. Create an account**

Sign up at [datachad.xyz/signup](https://datachad.xyz/signup), or call the API:

```bash
curl -X POST https://api.datachad.xyz/v1/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@lab.example",
    "password": "a password of 10+ characters",
    "name": "Ada Lovelace",
    "organization": "Example Lab"
  }'
```

The response contains a `token`. It is a JWT that stays valid for 7 days.

**2. Create an API key**

Create a key on your [account page](https://datachad.xyz/account), or with the token from the previous step:

```bash
curl -X POST https://api.datachad.xyz/v1/keys \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "training cluster"}'
```

> [!WARNING]
>
> The full key is returned once. Store it in your secret manager before you close the response.

**3. List the catalogue**

```bash
curl https://api.datachad.xyz/v1/datasets \
  -H "X-API-Key: $DATACHAD_API_KEY"
```

Each dataset comes back with its `slug`, description, formats and a `summary` of hours, clips, contributors and size.

**4. Look at one dataset**

```bash
curl https://api.datachad.xyz/v1/datasets/sea-helmet-cam \
  -H "X-API-Key: $DATACHAD_API_KEY"

curl "https://api.datachad.xyz/v1/datasets/sea-helmet-cam/sample?limit=5" \
  -H "X-API-Key: $DATACHAD_API_KEY"
```

## In Python

```python
import os
import requests

api = "https://api.datachad.xyz/v1"
headers = {"X-API-Key": os.environ["DATACHAD_API_KEY"]}

for dataset in requests.get(f"{api}/datasets", headers=headers).json():
    print(dataset["slug"], dataset["summary"]["hours"])
```
