# vid2md quickstart

vid2md accepts an HTTPS video URL or an uploaded video file and returns a timestamped Markdown report.

The landing page demo starts with only a video URL or upload. After the Markdown is ready, log in by email to claim, copy, or download the result.

## Sign up or log in

```bash
curl https://vid2md.com/v1/auth/start \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com"}'
```

Check your inbox for the six digit code, then verify it:

```bash
curl https://vid2md.com/v1/auth/verify \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","code":"123456"}'
```

The response includes a `session_token`.

## Create an API key

Use the landing page `Create API key` button after login, or call the endpoint:

```bash
curl https://vid2md.com/v1/api-keys \
  -H "Authorization: Bearer v2ms_your_session" \
  -H "Content-Type: application/json" \
  -d '{"name":"Local scripts"}'
```

Store the API key once. vid2md stores only a hash.

## Buy credits

```bash
curl https://vid2md.com/v1/checkouts \
  -H "Authorization: Bearer v2m_your_key" \
  -H "Content-Type: application/json" \
  -d '{"kind":"credits","package":"starter"}'
```

Packages are `starter`, `growth`, and `scale`. Concise mode costs 1 credit per started minute. Regular costs 2x, detailed 4x, and ultra-detailed 8x.

Use `{"kind":"archive"}` to start the archive subscription. Archive keeps Markdown results in your account history. It does not store source videos.

## Choose input

Use a public HTTPS URL:

```json
{"video_url":"https://cdn.example.com/video.mp4"}
```

Or upload a file and use the returned tokenized R2 handoff URL. For authenticated API jobs, use `/v1/uploads`:

```bash
curl https://vid2md.com/v1/uploads \
  -H "Authorization: Bearer v2m_your_key" \
  -H "Content-Type: video/mp4" \
  --data-binary @demo.mp4
```

```json
{"video_url":"https://vid2md.com/v1/upload-videos/upl_123?token=..."}
```

The landing page demo uses `/v1/demo/uploads` before login and asks for email only after the result is ready.

## Start a job

```bash
curl https://vid2md.com/v1/jobs \
  -H "Authorization: Bearer v2m_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://cdn.example.com/video.mp4",
    "mode": "regular"
  }'
```

## Poll

```bash
curl https://vid2md.com/v1/jobs/job_123 \
  -H "Authorization: Bearer v2m_your_key"
```

Poll every `retry_after_seconds` until the job returns `succeeded`, `failed`, or `cancelled`.

## Download Markdown

```bash
curl https://vid2md.com/v1/jobs/job_123/result \
  -H "Authorization: Bearer v2m_your_key" \
  -o result.md
```

Use `?format=json` for metadata. The web app also exposes Copy Markdown and Download `.md` actions after a job succeeds.
