> For the complete documentation index, see [llms.txt](https://bountyv.gitbook.io/vdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bountyv.gitbook.io/vdocs/youtube-tools-api/music-short.md).

# Music Short

Trim a section of a song and mux it with a 9:16 cover into a YouTube Short. Asynchronous — returns a job ID that you poll.

```
POST /api/v1/youtube/music-short
```

Supply a public `audio_url`, a public 9:16 `image_url` cover, and the trim window (`start_sec`/`end_sec`, ≤ 60s). We mux them into a 1080×1920 MP4 on the clip worker. The call returns a `job_id`; poll [`GET /api/v1/jobs/{id}`](/vdocs/video-api/jobs.md) until `status` is `completed`, then download from `/api/v1/jobs/{id}/video`. Flat charge per successful short; refunded on failure.

## Authentication

```
Authorization: Bearer sk_live_...
```

Requires the `youtube` product entitlement. See [Authentication](/vdocs/authentication.md) for details.

## Bring your own cover & captions

On the API, the cover image and any captions are **customer-supplied**. Generate a 9:16 cover with the [Thumbnail API](/vdocs/youtube-tools-api/thumbnail-generate.md) (or host your own), and pass word-pop captions as an array if you want them burned in. Auto cover-generation and auto-transcription are panel-only.

## Request

**Content-Type:** `application/json` (or `multipart/form-data` to upload the audio/cover files directly instead of hosting them yourself).

| Field       | Type   | Required           | Description                                                                                                                                                               |
| ----------- | ------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `audio_url` | string | ✅ (JSON lane)      | Public https URL to the song.                                                                                                                                             |
| `image_url` | string | ✅ (JSON lane)      | Public https URL to a 9:16 cover image.                                                                                                                                   |
| `audio`     | file   | ✅ (multipart lane) | The song file, uploaded directly instead of `audio_url`.                                                                                                                  |
| `image`     | file   | ✅ (multipart lane) | The 9:16 cover image file, uploaded directly instead of `image_url`.                                                                                                      |
| `start_sec` | number | ✅                  | Section start in seconds (≥ 0).                                                                                                                                           |
| `end_sec`   | number | ✅                  | Section end (> `start_sec`, at most 60s after it).                                                                                                                        |
| `captions`  | array  | —                  | Optional word-pop captions: `[{ word, start, end }]` with times relative to the section (0 = `start_sec`). Max 2000 entries. In multipart, pass as a JSON-encoded string. |

## Response

```json
{
  "job_id": "V1StGXR8_Z5jdHi6B-myT",
  "status": "queued",
  "charged_cents": 25,
  "balance_cents": 4975,
  "poll_url": "/api/v1/jobs/V1StGXR8_Z5jdHi6B-myT"
}
```

HTTP status: `202 Accepted`.

Poll [`GET /api/v1/jobs/{job_id}`](/vdocs/video-api/jobs.md) every 5–10 seconds until the job completes or fails, then download the finished MP4 from `/api/v1/jobs/{job_id}/video`.

## Example

```bash
# 1. Submit
curl -X POST https://substance-api.com/api/v1/youtube/music-short \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "audio_url": "https://example.com/song.mp3",
    "image_url": "https://example.com/cover_9x16.png",
    "start_sec": 42,
    "end_sec": 72
  }'

# 2. Poll until completed, then download
curl https://substance-api.com/api/v1/jobs/JOB_ID \
  -H "Authorization: Bearer sk_live_..."
```

## Errors

| Status | When                                                                                                                    |
| ------ | ----------------------------------------------------------------------------------------------------------------------- |
| `400`  | Missing/invalid `audio_url`/`audio` or `image_url`/`image`, bad trim window, section over 60s, or malformed `captions`. |
| `401`  | Missing/invalid API key.                                                                                                |
| `402`  | Insufficient balance.                                                                                                   |
| `403`  | Account doesn't have the `youtube` product enabled.                                                                     |
| `502`  | The short couldn't be started. Balance is refunded — see `refunded_cents`.                                              |
| `503`  | Pipeline temporarily offline.                                                                                           |

Jobs that fail mid-pipeline return `status: "failed"` when polled and are refunded automatically. See [Errors](/vdocs/errors.md) for full details.

## Pricing

Billed per call — see [Credits & pricing](/vdocs/account/credits.md) for current rates.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bountyv.gitbook.io/vdocs/youtube-tools-api/music-short.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
