# Quickstart

From zero to a downloaded film in six steps. You need an API key with the scopes `catalog:read`, `films:write`,
`events:read` and `files:read`.

### 1. Create an API key

A company admin creates an API access in mint under *Settings → API access*, chooses the scopes and copies the key.
The key is shown only once. Keep it on your server, for example in an environment variable:

```sh
export MINT_API_KEY="mint_sk_live_…"
```

### 2. Check the key

`GET /me` shows the access, its company, scopes and limits. A `401` means the key is wrong, revoked or expired.

### 3. Pick a template

`GET /templates` lists the briefing templates of your company. A template fixes the style, brand, voice and further
settings, so the order itself stays short. Use its `key` as `template`.

### 4. Order the film

`POST /films` with a title, the narration text, the e-mail address of the responsible mint user and your own
`video_key` + `version`. With `automation: "storyboard"` (the default) mint plans and produces the storyboard and then
waits for review. Sending the same order again returns the same film, so retries are safe.

### 5. Follow the progress

Poll the [event feed](/api/event-feed), for example every few minutes, or read `GET /films/{id}/progress` while a person
is watching. `film.storyboard_ready` tells you that the storyboard can be reviewed in mint; `film.approved` that the film
is final.

### 6. Download the approved film

`GET /films/{id}/file` returns the MP4. Its `ETag` is the SHA-256 of the file; compare it after the download.

```sh 2. Check the key
curl https://api.cream-ai.de/api/v1/me \
  -H "Authorization: Bearer $MINT_API_KEY"
```

```sh 4. Order the film
curl -X POST https://api.cream-ai.de/api/v1/films \
  -H "Authorization: Bearer $MINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Lesson 3: Market segmentation",
    "narration_text": "Not every customer wants the same thing. …",
    "user_email": "anna.schmidt@example.edu",
    "template": "lesson-standard",
    "video_key": "MKT101-lesson-03",
    "version": "1.0"
  }'
```

```sh 5. Follow the progress
curl "https://api.cream-ai.de/api/v1/events?after=0&types=film.storyboard_ready,film.approved" \
  -H "Authorization: Bearer $MINT_API_KEY"
```

```sh 6. Download the approved film
curl https://api.cream-ai.de/api/v1/films/k7m2xq9v4t8n1b5r3c6d0wza/file \
  -H "Authorization: Bearer $MINT_API_KEY" \
  -o film.mp4 -D headers.txt
shasum -a 256 film.mp4   # compare with the ETag
```
