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

# Exports

> Render karaoke videos in the cloud or locally

Exports render a finished karaoke as a video file. Use `client.exports.create(...)` as the main entrypoint. Pick `target: "local"` when you want the SDK to render directly on the current machine; otherwise cloud export is the default.

## `client.exports.create(projectId, input, options?)`

Choose the export target with `target: "cloud" | "local"`.

```ts theme={null}
const cloud = await client.exports.create("prj_abc123", {
  resolution: "1080p",
  quality: "high",
});
// => ExportOperation

const local = await client.exports.create("prj_abc123", {
  target: "local",
  resolution: "1080p",
  quality: "high",
  outputPath: "./karaoke.mp4",
});
// => { outputPath, fileSize, duration, ... }
```

Use cloud when you want a managed async export. Use local when you want to render directly on the caller's machine.

### Common fields

| Field              | Type                                  | Description                                                        |
| ------------------ | ------------------------------------- | ------------------------------------------------------------------ |
| `resolution`       | `"540p" \| "720p" \| "1080p" \| "4k"` | Output resolution.                                                 |
| `quality`          | `"low" \| "average" \| "high"`        | Encoding quality.                                                  |
| `fps`              | `30 \| 60`                            | Frames per second. Defaults to `30`. Use `60` for smoother motion. |
| `playbackRate`     | `number`                              | Speed multiplier (e.g. `0.9`).                                     |
| `toneFrequency`    | `number`                              | Pitch shift in semitones.                                          |
| `transparent`      | `boolean`                             | Render with a transparent background.                              |
| `presetId`         | `string`                              | Apply a preset before rendering.                                   |
| `stemVolumes`      | `Record<string, number>`              | Per-stem volume overrides keyed by stem id.                        |
| `settingsOverride` | `object`                              | Patch the project settings for this export only.                   |

Use `fps: 60` for smoother motion. Cloud quotes apply a `1.5x` credit multiplier at `60 fps`. Transparent 60 fps cloud exports are available when the selected duration and resolution fit cloud limits.

### Example with stem volumes

```ts theme={null}
const result = await client.exports.create("prj_abc123", {
  resolution: "1080p",
  quality: "high",
  stemVolumes: {
    vocals: 0,
    instrumental: 1,
    backing: 0.5,
  },
});
```

### Example with settings override

```ts theme={null}
const result = await client.exports.create("prj_abc123", {
  resolution: "1080p",
  settingsOverride: {
    trim: { startSeconds: 5, endSeconds: 180 },
    style: {
      background: { type: "color", color: "#101010" },
    },
  },
});
```

See [Render settings reference](/en/render-settings-reference) for the full
`settingsOverride` shape.

## `client.exports.quote(projectId, input, options?)`

Quote the credits required for a cloud export without starting the export.

```ts theme={null}
const quote = await client.exports.quote("prj_abc123", {
  resolution: "1080p",
  quality: "high",
  transparent: false,
});

console.log(quote.creditsRequired, quote.sufficientBalance);
```

Local exports run on the caller's machine and do not use cloud export credits,
so `quote(...)` is only for cloud exports.

## `client.exports.list(projectId, input?, options?)`

List exports for a project, with pagination.

```ts theme={null}
const exports = await client.exports.list("prj_abc123", {
  page: 1,
  pageSize: 50,
});
```

<ParamField path="page" type="number">
  Page number. Defaults to `1` on the server.
</ParamField>

<ParamField path="pageSize" type="number">
  Page size. Defaults to `100`. Maximum `100`.
</ParamField>

## `client.exports.get(exportId, options?)`

Fetch an export by ID alone, without knowing the parent project.

```ts theme={null}
const exported = await client.exports.get("exp_xyz");
```

## Local export

```ts theme={null}
const result = await client.exports.create("prj_abc123", {
  target: "local",
  resolution: "1080p",
  quality: "high",
  outputPath: "./karaoke.mp4",
  onProgress(progress) {
    console.log(progress.stage, progress.percent);
  },
});

console.log(result.outputPath);
```

Use `onDependencyProgress` if you want updates while the local render toolchain is being installed or verified.

## `client.exports.prepareLocal(projectId, body, options?)`

Return the prepared payload needed to render an export locally. Use this when integrating with `@youka/remotion` or another local renderer. The server returns the composition inputs, asset URLs, and render parameters without queuing a cloud render.

```ts theme={null}
const payload = await client.exports.prepareLocal("prj_abc123", {
  resolution: "1080p",
  quality: "high",
});

// Hand payload off to your local renderer
await renderLocally(payload);
```

<Note>
  `client.exports.prepareLocal(...)` does not start a cloud render. No billable
  compute is consumed on the Youka side.
</Note>

## Waiting for an export

Cloud exports are async. Use `client.exports.wait(...)`:

```ts theme={null}
const operation = await client.exports.create("prj_abc123", {
  resolution: "1080p",
});

const finalized = await client.exports.wait(operation, {
  pollIntervalMs: 3_000,
});
console.log("Download from", finalized.url);
```

## Downloading the result

Cloud exports finish with a signed `url`. Use the built-in helper to stream the file to disk. `output` can be either a directory or a full file path, and `filename` is optional:

```ts theme={null}
await client.exports.download(finalized, {
  output: "./exports",
});
```

## What's next

* [Tasks](/en/sdk/tasks) — operation handles and advanced task polling
* [Presets](/en/sdk/presets) — reusable render configurations
* [Project settings](/en/sdk/project-settings) — patch a project's active settings
