# Quickstart

Get a YouTube transcript in under two minutes. Create an account, call the API, or connect the MCP server to your agent.

Two paths: let your agent do it, or call the API yourself.

## Path A: let your agent do it

Connect the hosted MCP server once, then ask in plain language.

1. Add `https://api.youtubetranslate.com/mcp` as a custom connector in your client. [Connect to ChatGPT](/docs/connect-chatgpt.md) and [Connect other clients](/docs/connect-clients.md) walk through each client.
2. Approve the OAuth screen. Complete account sign-in or registration and approve the requested scopes. Approving OAuth does not add credits.
3. Ask: *"Get the transcript of this video and summarize it in five bullets: https://www.youtube.com/watch?v=jNQXAC9IVRw"*

You do not need a separate API key for MCP. OAuth handles it.

## Path B: call the API

### 1. Check the demo first

The demo needs no credentials and returns output from two allowlisted videos, so you can judge quality before paying anything.

```bash
curl -s https://api.youtubetranslate.com/api/demo/examples
```

### 2. Create an account

Send `accept_terms: true` after reading `/terms` and `/privacy`. The API key is returned **once** and cannot be retrieved later.

```bash
curl -s -X POST https://api.youtubetranslate.com/api/accounts \
  -H 'Content-Type: application/json' \
  -d '{"email":"you@example.com","accept_terms":true}'
```

The response contains `account_id` and `api_key`. New accounts have no free processing credits. Use the separate public demo for free examples.

### 3. Ask what it will cost

Never start paid work before quoting it. `maximumCreditUnits` is the hold that gets reserved.

```bash
curl -s -X POST https://api.youtubetranslate.com/api/processing/quote \
  -H "X-API-Key: $YTT_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"operation":"transcribe","url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","language":"en"}'
```

If `cached` is `true`, the read costs 2,000 microcredits and is safe to run immediately.

### 4. Transcribe

For an uncached video, `max_credit_units` must be at least the quoted maximum. Omitting it returns `428` with code `budget_required` rather than spending silently.

```bash
curl -s -X POST https://api.youtubetranslate.com/api/videos \
  -H "X-API-Key: $YTT_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: transcript-rick-001' \
  -d '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","language":"en","max_credit_units":300000}'
```

### 5. Read the result

Cached submissions return `200` with a video ID; retrieve the text from the transcript endpoint below. New jobs return `202` and a `job_id`; poll until `status` is `completed`.

```bash
curl -s "https://api.youtubetranslate.com/api/videos/$VIDEO_ID/transcript" \
  -H "X-API-Key: $YTT_API_KEY"
```

## Then what

- Translate it: `POST /api/videos/:id/translate` with `{"language":"es"}`
- Add subtitles: `POST /api/videos/:id/subtitles` with `{"language":"es","format":"srt"}`
- Summarize it: `POST /api/videos/:id/summarize` with `{"language":"en","length":"medium"}`
- Search inside it: `POST /api/videos/:id/search` with `{"query":"pricing"}`

Each of these is cheaper than starting over, because they build on the retained transcript. See the [REST API](/docs/rest-api.md) reference for exact shapes and [Pricing and credits](/docs/pricing.md) for what each call costs.
