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

# Rask API v3

> Localize video and audio over REST: upload media, dub it, lip-sync it, translate on-screen text and download the results.

Rask API v3 is the REST API of Rask, the video and audio localization platform. With one API key you can upload or import
media, create localization projects, edit transcripts and segments, keep version history, choose and clone voices, dub and
redub, lip-sync, translate on-screen text, export, and read balance, plan and usage.

To start, you need a plan that includes the API ([pricing](https://rask.ai/pricing)) and a key from the web app. The
[Quickstart](https://docs.api.rask.ai/v3/quickstart.md) takes you from there to a dubbed video.

> [!NOTE]
>
> **Status: alpha.** Every operation may still change before the beta. The version of the contract is in its `info.version`,
> and [the changelog](https://docs.api.rask.ai/changelog.md) lists what changed. API v2 keeps working unchanged beside v3, and
> its documentation stays under **v2** in this site's version selector. If you run on v2 today, see
> [Move from v2](https://docs.api.rask.ai/v3/migrate-from-v2.md).

## Base URL

```text theme={null}
https://api.rask.ai/v3
```

Every path in these pages is relative to it: `POST /projects` means `POST https://api.rask.ai/v3/projects`. The links
the API returns (the `Location` header and the `links` objects) already start with `/v3`, so resolve them against
`https://api.rask.ai`.

## Where to start

> [card] [Quickstart](https://docs.api.rask.ai/v3/quickstart.md)
>
> Get a key, make one request, then dub a whole video from upload to download.

> [card] [Authentication](https://docs.api.rask.ai/authentication.md)
>
> Keys, scopes, spend caps, and what each 401 and 403 means.

> [card] [SDKs](https://docs.api.rask.ai/v3/sdks.md)
>
> Official clients for TypeScript, Python, Go, Java and PHP: the install command for each, and what they do for you.

> [card] [AI agents](https://docs.api.rask.ai/v3/agents.md)
>
> A ready prompt for your agent, how to pass it the key, and how to keep its spending bounded.

> [card] [MCP server](https://docs.api.rask.ai/v3/mcp.md)
>
> Ready-made tools for Claude Code, Claude Desktop, Cursor, VS Code and Codex CLI, with a price to confirm before each spend.

> [card] [Recipes](https://docs.api.rask.ai/v3/recipes/dubbing-model.md)
>
> Dubbing models, your own transcript, voice clones, paid segment generation, lip-sync, on-screen text, one-request runs,
> downloads and spend.

> [card] [Concepts](https://docs.api.rask.ai/v3/concepts/glossary.md)
>
> Jobs, idempotency, ETags, the rule that text is paid by the dub, plan limits and prices.

## How the API behaves

* **Long work is a job.** A call that starts work answers `202` with a [Job](https://docs.api.rask.ai/v3/concepts/jobs.md) (copying a project answers
  with a list of jobs). You wait on the job, then read its result.
* **Spending is explicit.** Every paid call has a free estimate, and you send the estimate's `total_minutes` as
  `expected_cost_minutes`, a cap: if the price is now higher, the call fails with `409 cost_changed` and spends nothing.
  See [Prices and refunds](https://docs.api.rask.ai/v3/concepts/pricing.md).
* **Retries are safe.** Calls that start work or spend, plus creating a segment and restoring a version, require an
  [`Idempotency-Key`](https://docs.api.rask.ai/v3/concepts/idempotency). Once a call has succeeded, a retry with the same key and request replays
  that answer (for a job, its current state) instead of running the work again.
* **Edits are conditional.** Edits of an existing segment and of a speaker's voice require the segment's or speaker's
  [ETag](https://docs.api.rask.ai/v3/concepts/etags.md), in `If-Match` (a merge sends one per segment in its body), so two writers cannot overwrite
  each other.
* **Errors are data.** Every error is `application/problem+json` with a stable `code` and a `hint`. Each code has
  [a page](https://docs.api.rask.ai/errors.md).

## Read the contract from code

These routes need no key, and they serve the same contract these pages are built from:

| Route | What it returns |
| - | - |
| `GET` on the base URL itself | Entry points: the contract version and the links to the rest |
| `GET /openapi.json` | The OpenAPI 3.1 contract, with an `ETag`: send it back in `If-None-Match` to get `304` while the contract is unchanged |
| `GET /openapi/{tag}.json` | One tag's operations and the components they reach |
| `GET /operations` | A compact index of every operation |
| `GET /operations/{operation_id}` | One operation with the schemas it uses |

A tag is written exactly as the contract names it, with each space as %20: `GET /openapi/Projects.json`,
`GET /openapi/Voice%20clones.json`. The groups of the API reference on this site have the same names.

There is no sandbox. To try the API without spending, use a key without `credits:spend` and call the estimates (each
shows the price, with `eligible: false` and the reason `insufficient_scope`), or run a mock of the contract:

```bash theme={null}
npx @stoplight/prism-cli@5 mock https://api.rask.ai/v3/openapi.json
```

The mock serves the paths without `/v3`, so its base URL is `http://127.0.0.1:4010`. Set `RASK_BASE_URL` to that, and the
SDKs and the programs of these docs call the mock. It checks each request against the contract and answers from the
contract's examples, and a header such as `Prefer: code=402, example=insufficient_balance` on `POST /projects` asks for that
error. It stores nothing, and the presigned upload URL it gives is a placeholder, so an upload stops at sending the bytes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.