> ## 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.

# Projects

> Upload media and create, inspect, list, and delete karaoke projects

Projects are the top-level resource in Youka. Each project owns its source file, separated stems, synced lyrics, exports, and project settings.

## Creating a project

For most cases, use `client.projects.create()` — it handles uploads for you.

```ts theme={null}
const operation = await client.projects.create({
  source: { type: "path", path: "./song.mp3" },
  lyricsSource: { type: "transcribe" },
});
// => ProjectOperation
```

### Source types

<Tabs>
  <Tab title="path">
    Reads a file from disk.

    ```ts theme={null}
    source: {
      type: "path",
      path: "./song.mp3",
      contentType: "audio/mpeg", // optional, inferred if omitted
    }
    ```
  </Tab>

  <Tab title="bytes">
    In-memory `Blob`, `File`, `ArrayBuffer`, or `Uint8Array`.

    ```ts theme={null}
    source: {
      type: "bytes",
      data: fileBuffer,
      filename: "song.mp3",
      contentType: "audio/mpeg", // optional
    }
    ```
  </Tab>

  <Tab title="url">
    Remote HTTP or HTTPS URL.

    Supported hosted pages depend on yt-dlp. See the [supported URLs list](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md).

    ```ts theme={null}
    source: {
      type: "url",
      url: "https://example.com/song.mp4",
      maxVideoQuality: "1080p", // optional: "720p", "1080p", "4k", or "best"
    }
    ```

    `maxVideoQuality` controls the maximum downloaded video quality for URL
    sources. It defaults to `1080p`. The SDK uses the best available quality up
    to that limit, and falls back to the best available format if the platform
    does not expose a capped stream. Use `best` for no cap.

    <Note>
      On Node.js and Bun, the SDK automatically ensures the required URL
      dependency binaries (`ffmpeg`, `ffprobe`, `yt-dlp`) on first use. The
      CLI equivalent is `youka deps ensure --for url`.
    </Note>
  </Tab>
</Tabs>

### Other fields

<ParamField path="title" type="string">
  Project title. Defaults to the source filename.
</ParamField>

<ParamField path="splitModel" type="SplitModel">
  Stem separation model. Defaults to `mdx23c`. See [Split model
  reference](/en/desktop/split-model).
</ParamField>

<ParamField path="presetId" type="string">
  Apply a reusable preset at creation time.
</ParamField>

<ParamField path="lyricsSource" type="LyricsSource">
  Configure lyrics sync. See below.
</ParamField>

### Lyrics sources

```ts theme={null}
// Transcribe lyrics from the audio
lyricsSource: {
  type: "transcribe",
  syncModel: "audioshake-transcription", // optional
  language: "en",                        // optional
}

// Align exact lyrics to the audio
lyricsSource: {
  type: "align",
  lyrics: "First line\nSecond line\n...",
  syncModel: "audioshake-alignment",
}

```

## `client.projects.create(input, options?)`

`client.projects.create()` also accepts a low-level `inputFile` source when you already have an uploaded `inputFileId`.

```ts theme={null}
const upload = await client.uploads.create({
  filename: "song.mp3",
  contentType: "audio/mpeg",
  contentLength: buffer.byteLength,
});

await client.uploads.upload(upload.uploadUrl, buffer, {
  contentType: "audio/mpeg",
});

const operation = await client.projects.create({
  source: {
    type: "inputFile",
    inputFileId: upload.inputFileId,
    filename: "song.mp3",
  },
  title: "My Song",
});
```

## `client.projects.quote(input, options?)`

Quote the credits required to create a project without creating it.

```ts theme={null}
const quote = await client.projects.quote({
  source: { type: "path", path: "./song.mp3" },
  lyricsSource: { type: "transcribe", language: "en" },
  splitModel: "mdx23c",
});

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

`client.projects.quote(...)` accepts the same `source` forms as
`client.projects.create(...)`, including URL `maxVideoQuality`. If you already
know the media duration and do not want to upload the file just to quote, pass
the low-level REST shape:

```ts theme={null}
const quote = await client.projects.quote({
  durationSeconds: 210,
  lyricsSource: null,
  splitModel: "mdx23c",
});
```

## `client.uploads.create(body, options?)`

Allocate an upload slot and get a signed URL.

```ts theme={null}
const upload = await client.uploads.create({
  filename: "song.mp3",
  contentType: "audio/mpeg",
  contentLength: 4_521_344,
});
// => { inputFileId, uploadUrl }
```

## `client.uploads.upload(uploadUrl, body, options?)`

PUT the file bytes to the signed URL.

```ts theme={null}
await client.uploads.upload(upload.uploadUrl, fileBuffer, {
  contentType: "audio/mpeg",
  signal: abortController.signal,
});
```

<ParamField path="body" type="FetchBody" required>
  Any `fetch`-compatible body: `Blob`, `File`, `ArrayBuffer`, `Uint8Array`,
  `ReadableStream`, or `string`.
</ParamField>

Throws `YoukaRequestError` with code `UPLOAD_FAILED` if the upload returns a non-2xx status.

## `client.projects.get(projectId, options?)`

Fetch the full project state, including stems, lyrics, and exports.

```ts theme={null}
const project = await client.projects.get("prj_abc123");
console.log(project.title, project.stems, project.lyrics);
```

## `client.projects.update(projectId, body, options?)`

Patch project metadata.

```ts theme={null}
const project = await client.projects.update("prj_abc123", {
  title: "Updated title",
  artists: ["Artist name"],
});
```

Pass at least one of `title` or `artists`.

## `client.projects.list(options?)`

List every project owned by the authenticated account.

```ts theme={null}
const projects = await client.projects.list();
projects.forEach((p) => console.log(p.id, p.title));
```

Returns an array of project list items (a leaner shape than `getProject`).

## `client.projects.delete(projectId, options?)`

Delete a project and all its associated stems, lyrics, and exports.

```ts theme={null}
await client.projects.delete("prj_abc123", {
  idempotencyKey: "delete-prj_abc123",
});
```

<Warning>
  Deletion is permanent. Pair with an idempotency key so retries are safe.
</Warning>

## What's next

* [Stems](/en/sdk/stems) — re-run stem separation
* [Lyrics sync](/en/sdk/lyrics-sync) — re-sync lyrics
* [Exports](/en/sdk/exports) — render finished videos
* [Tasks](/en/sdk/tasks) — wait on project operations with `client.projects.wait`
