# Quickstart

> A vertical video in three requests: start a job from a video URL, wait for it, download the result.

You need an API key (`rmk_...`) from the [Redge Media Cloud console](https://console.cloud.redge.media/api-keys). New organizations get free minutes, so you can try it without paying. A test key (`rmk_test_...`) costs nothing at all: it processes the first 10 seconds of the video (see [Billing and limits](billing.md#test-keys)).

```bash
KEY=rmk_...
VAPI=https://vapi.cloud.redge.media
```

## 1. Start a job

Give the video's address. It must be reachable over the internet (http or https):

```bash
curl -s -X POST $VAPI/v1/reframe \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"input": {"url": "https://example.com/interview.mp4"}, "target_aspect": "9:16"}'
```

The answer is `202 Accepted` with the job, `"status": "queued"`. Keep its `id` (`job_...`).

## 2. Wait for it

```bash
curl -s "$VAPI/v1/jobs/job_...?wait=60" -H "Authorization: Bearer $KEY"
```

This answers as soon as the job has finished, or after 60 seconds with its progress. Repeat until `status` is `succeeded`, `failed` or `canceled`. Processing takes roughly as long as the video lasts; `progress` (0 to 1) and `stage` show how far it got.

## 3. Download the result

A job that `succeeded` lists its files in `outputs`:

- `video`: the vertical MP4;
- `analysis`: what was found in the video (shots, people, speakers), JSON;
- `debug`: the video with the crop drawn on it, if you asked for `"debug_overlay": true`.

Each has a `url` that works for an hour. `GET /v1/jobs/{id}` again gives fresh ones; the files are kept for 30 days.

```bash
curl -s -o vertical.mp4 "<outputs.video.url>"
```

## A file instead of a URL

Reserve an upload, `PUT` the file to the address you get, then start the job with the upload's id:

```bash
curl -s -X POST $VAPI/v1/uploads -H "Authorization: Bearer $KEY"
# {"id": "upl_...", "status": "pending", "upload_url": "https://...", ...}
curl -X PUT --upload-file clip.mp4 "<upload_url>"
curl -s -X POST $VAPI/v1/reframe \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"input": {"upload_id": "upl_..."}}'
```

Uploads are kept for 7 days. Files up to 2 GB and 10 minutes long.

## What it will cost

```bash
curl -s -X POST $VAPI/v1/estimates \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"operation": "reframe", "duration_s": 95}'
```

The answer says how much of it the free minutes cover, the price of the rest in euro and whether the organization can pay for it now. See [Billing and limits](billing.md).

## Next

- [Jobs](jobs.md): webhooks instead of waiting, listing, canceling.
- [Reframe](reframe.md): strategies, output size, and correcting single scenes.
- [AI agents and MCP](agents.md): let an agent do all of this.
