> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

# Music Video

POST https://api.beatapi.io/v1/music-video/tasks
Content-Type: application/json

Create a Music Video workflow task from images, audio, and creative controls.

If an input is local, [upload a local input](/quick-guide#upload-an-input-file) and use the returned `data.url`. Save `data.id`, [poll the Task](/quick-guide#get-task-status), and follow the [error and retry policy](/quick-guide#errors-and-retry-policy).

Reference: https://docs.beatapi.io/api-reference/workflow-api/music-video

## Authentication

- `Authorization` header (bearer token, required) — Send your API key as `Authorization: Bearer <BEATAPI_API_KEY>`.

## Request

### Headers

- `Idempotency-Key` (string, optional) — Optional retry key. Reusing the same key with the same request body returns the accepted task; reusing it with a different body returns `409 idempotency_conflict`.

### Body (application/json)

This endpoint expects a FernMusicVideoTaskCreateRequest.

- `audio_url` (string, required) — Top-level public HTTPS audio URL. Standard accepts 10-180 seconds; Premium accepts 10-300 seconds.
- `mv_tier` (enum, optional, default: standard) — Select the Music Video tier. Omit this field for Standard; Premium requests must set `premium`.
  - Allowed values: `standard`, `premium`
- `images` (list of string, optional) — Top-level scene images. Standard requires 1-7. Premium sing modes accept 0-6; Premium dance and perform require exactly 6 public HTTPS PNG, JPEG, or WebP URLs.
- `prompt` (string, optional) — Optional creative direction for story, setting, performance, camera, lighting, and pacing. Maximum 3000 characters.
- `language` (enum, optional) — Dialogue and lyric language used by the Standard workflow.
  - Allowed values: `en`, `zh`
- `quality` (enum, optional, default: standard) — Generation quality tier. High quality is unavailable at 540p.
  - Allowed values: `standard`, `high`
- `style` (string, optional) — Optional concise visual style, such as cinematic, anime, documentary, or fashion editorial.
- `aspect_ratio` (enum, optional) — Target output placement. Set explicitly for the destination player or social feed.
  - Allowed values: `1:1`, `16:9`, `9:16`, `4:3`, `3:4`
- `resolution` (enum, optional, default: 720p) — Top-level output resolution. Standard accepts 540p, 720p, or 1080p; Premium is fixed to 720p.
  - Allowed values: `540p`, `720p`, `1080p`
- `lip_sync` (boolean, optional, default: false) — Generate lip-synchronized performance. When true, `lip_ref_url` is required.
- `lip_ref_url` (string, optional) — Public HTTPS close-up, front-facing face image used for Standard lip sync.
- `add_subtitle` (boolean, optional, default: false) — Burn generated or supplied subtitles into the final video.
- `subtitle_color` (string, optional) — Subtitle text color as a six-digit hexadecimal value. Used when subtitles are enabled.
- `srt_url` (string, optional) — Optional public HTTPS `.srt` subtitle file. Upload a local subtitle through `POST /v1/files`.
- `duration` (integer, optional) — Top-level billing fallback only; detected audio duration wins. Standard accepts 10-180 seconds and Premium accepts 10-300 seconds.
- `compose_mode` (enum, optional, default: auto) — Auto composes the final Music Video; manual pauses at `requires_action` so shots can be reviewed or edited before compose.
  - Allowed values: `auto`, `manual`
- `mv_mode` (enum, optional) — Premium performance mode. Sing modes require `lip_ref_urls`; dance and perform require exactly six `images`.
  - Allowed values: `sing`, `sing_perform`, `dance`, `perform`
- `lip_ref_urls` (list of string, optional) — Required for sing and sing_perform; omit for dance and perform. Provide one or two public HTTPS close-up, front-facing face images.

## Response

### 201

Task accepted

- `data` (Task, required) — Accepted or current BeatAPI task state.

## Errors

### 400 Bad Request Error

Malformed JSON or a field, value or combination this endpoint does not accept (`bad_request`; the message names the field), or input refused by moderation (`content_policy_violation`). Not retryable unchanged.

- `error` (ErrorError, required) — Structured BeatAPI error. Use `code` (or `retryable`) for program logic and retain `request_id` for support.

### 401 Unauthorized Error

No API key (`missing_api_key`), or a key that is wrong, expired, disabled or exhausted (`invalid_api_key`; the message says which). Send it as `Authorization: Bearer <key>`; the key works with or without the `sk-` prefix. Not retryable.

- `error` (ErrorError, required) — Structured BeatAPI error. Use `code` (or `retryable`) for program logic and retain `request_id` for support.

### 402 Payment Required Error

Insufficient balance (`insufficient_credits`). The account balance is zero or below the price of this request. Top up, then send it again; not retryable before that.

- `error` (ErrorError, required) — Structured BeatAPI error. Use `code` (or `retryable`) for program logic and retain `request_id` for support.

### 403 Forbidden Error

The key or account is not permitted to make this call (`forbidden`), for example a model that is not available on free credit (a top-up unlocks it), a request from outside the key's IP allowlist, or a model outside the key's group. Not retryable.

- `error` (ErrorError, required) — Structured BeatAPI error. Use `code` (or `retryable`) for program logic and retain `request_id` for support.

### 409 Conflict Error

The `Idempotency-Key` was already used with a different request body, or the first request with it is still being processed (`idempotency_conflict`). Not retryable unchanged.

- `error` (ErrorError, required) — Structured BeatAPI error. Use `code` (or `retryable`) for program logic and retain `request_id` for support.

### 429 Too Many Requests Error

Too many tasks processing at once (`user_concurrency_exceeded`) or too many requests (`rate_limit_exceeded`). Retryable once a processing task finishes, or after `Retry-After` seconds.

- `error` (ErrorError, required) — Structured BeatAPI error. Use `code` (or `retryable`) for program logic and retain `request_id` for support.

### 500 Internal Server Error

Unexpected internal error (`internal_error`). Retryable; keep `request_id` for support if it persists.

- `error` (ErrorError, required) — Structured BeatAPI error. Use `code` (or `retryable`) for program logic and retain `request_id` for support.

### 503 Service Unavailable Error

The request could not be completed (`processing_unavailable`, `processing_timeout`, `processing_failed` or `result_transfer_failed`). Nothing was charged. Retryable with backoff; `Retry-After` is sent when the wait is known. BeatAPI does not answer 502 or 504.

- `error` (ErrorError, required) — Structured BeatAPI error. Use `code` (or `retryable`) for program logic and retain `request_id` for support.

## Types

### Task

- `id` (string, required) — Stable BeatAPI task ID used for polling and support.
- `object` (enum, required) — Object discriminator; always `task`.
  - Allowed values: `task`
- `task_kind` (enum, required) — Public task family that determines which capability fields are present. `data` is a data capability run as a task (`data:web.research`), polled through `POST /v1/capabilities/run`.
  - Allowed values: `workflow`, `effect`, `image`, `video`, `data`
- `capability_id` (string, required) — Stable BeatAPI workflow, Effect, generation model, or data capability ID (such as `web.research`) selected when the task was accepted.
- `capability_version` (integer, required, nullable) — Immutable capability version used by this task. Legacy workflow rows are returned as version 1.
- `status` (enum, required) — Current task lifecycle status. Stop polling at `succeeded` or `failed`; Music Video can also require manual action.
  - Allowed values: `queued`, `processing`, `storyboard_ready`, `requires_action`, `editing`, `composing`, `succeeded`, `failed`
- `stage` (enum, required) — Current processing stage, exposed separately so workflow progress can be tracked.
  - Allowed values: `queued`, `processing`, `storyboard_ready`, `requires_action`, `editing`, `composing`, `succeeded`, `failed`
- `created_at` (integer, required) — Unix timestamp when BeatAPI accepted the task.
- `updated_at` (integer, required) — Unix timestamp of the latest task update.
- `completed_at` (integer, required, nullable) — Terminal Unix timestamp, or null while work is in progress.
- `output` (TaskOutput, required, nullable) — Output is null until the task succeeds.
- `usage` (TaskUsage, required) — USD reservation, settlement, refund, and optional billable duration for this task.
- `request_id` (string, required) — Correlation ID to retain for logs and BeatAPI support.
- `error_code` (string, required, nullable) — Machine-readable terminal failure code, or null when no task failure is recorded.
- `error_message` (string, required, nullable) — Human-readable terminal failure detail, or null when no task failure is recorded.
- `workflow` (enum, optional) — Present for workflow tasks; identifies the selected BeatAPI workflow.
  - Allowed values: `music-video`, `ecommerce-video`, `video-analysis`
- `effect_id` (string, optional) — Present for Effect tasks; stable selected Effect ID.
- `effect_version` (integer, optional) — Present for Effect tasks; immutable Effect version used for processing.
- `media_type` (enum, optional) — Present when task_kind is image or video.
  - Allowed values: `image`, `video`
- `model` (string, optional) — Stable BeatAPI model alias. It is independent from internal execution routing.
- `storyboard` (Storyboard, optional) — Music Video storyboard metadata when available.
- `poll_after_seconds` (integer, optional) — Present while the task is running: how long to wait before the next status call (5 for images, 8 for video and Effects, 10 for workflows and data tasks). Absent on a terminal task.
- `typical_seconds` (TaskTypicalSeconds, optional) — Present while the task is running, when enough recent finishes exist: how long this task's model recently took from accepted to succeeded, measured on this gateway. Past `p90` with no change the task is running long; there is no ETA beyond that.
- `retryable` (boolean, optional) — Present on a failed task: whether resubmitting could succeed. True when the task failed on our side or timed out (a failed task is not charged); false when it was refused for content or bad input. Same code-to-retryable rule as the error envelope.

### ErrorError

Structured BeatAPI error. Use `code` (or `retryable`) for program logic and retain `request_id` for support.

- `code` (enum, required) — Stable machine-readable error code. `unauthorized` is the deprecated name for a 401; since 2026-09-29 a 401 is `missing_api_key` or `invalid_api_key`. Treat a legacy `unauthorized` like `invalid_api_key`.
  - Allowed values: `bad_request`, `missing_api_key`, `invalid_api_key`, `unauthorized`, `forbidden`, `not_found`, `insufficient_credits`, `idempotency_conflict`, `user_concurrency_exceeded`, `rate_limit_exceeded`, `content_policy_violation`, `processing_unavailable`, `processing_failed`, `processing_timeout`, `result_transfer_failed`, `invalid_signature`, `realtime_disabled`, `realtime_capacity_unavailable`, `realtime_session_expired`, `origin_not_allowed`, `invalid_client_secret`, `transport_not_allowed`, `internal_error`
- `message` (string, required) — English sentence that states the cause; for `bad_request` it names the field. Written for people and logs, not for parsing.
- `retryable` (boolean, required) — Whether making the same call again could succeed. Present on every error; branch on it instead of the status code. True for 429, 500 and 503 (rate_limit_exceeded, user_concurrency_exceeded, internal_error, processing_unavailable, processing_timeout, processing_failed, result_transfer_failed, realtime_capacity_unavailable). False for a request, key or balance that must change first (bad_request, content_policy_violation, missing_api_key, invalid_api_key, insufficient_credits, forbidden, not_found, idempotency_conflict, realtime_disabled and the other realtime credential codes).
- `request_id` (string, required) — Correlation ID to retain for BeatAPI support.
- `retry_after_seconds` (integer, optional) — Seconds to wait before retrying. Present on every 429, and on a 503 when the wait is known; the same value is sent in the `Retry-After` header.
- `docs` (string, optional) — The public Skill page that says what to do about an error. Present on errors answered by the capability endpoints (`/v1/capabilities/search`, `/v1/capabilities/inspect`, `/v1/capabilities/run`); absent on every other endpoint.

### TaskOutput

Output is null until the task succeeds.

### TaskUsage

- `credits_reserved` (double, required) — USD amount reserved for this task. The compatibility field name is retained; 1 Credit equals $1 USD.
- `credits_charged` (double, required) — USD amount charged when the task or operation is accepted.
- `credits_settled` (double, required) — USD amount settled after successful work.
- `credits_refunded` (double, required) — USD amount refunded after failed eligible work.
- `billable_duration_seconds` (integer, optional) — Server-detected or request-declared billable duration used for USD calculation.

### Storyboard

- `shots` (list of StoryboardShot, required) — Ordered Music Video storyboard shots. The array may be empty before storyboard generation completes.

### TaskTypicalSeconds

Present while the task is running, when enough recent finishes exist: how long this task's model recently took from accepted to succeeded, measured on this gateway. Past `p90` with no change the task is running long; there is no ETA beyond that.

- `p50` (integer, required) — Median seconds.
- `p90` (integer, required) — Ninetieth-percentile seconds.
- `samples` (integer, required) — Finished tasks the figures rest on.
- `window` (string, required) — The window measured, such as `7d`.

### TaskOutput0

- `media` (list of TaskOutputOneOf0MediaItems, required) — BeatAPI-hosted result assets.
- `r2_url` (string, required, deprecated) — Deprecated — read media[0].url. The primary asset's URL again (the video, else the first image), the same value as that media[].url, kept only for clients that read one URL.

### TaskOutput1

- `text` (string, required) — Completed video analysis text.
- `usage` (TaskOutputOneOf1Usage, required) — Measured token usage used for final USD settlement.
- `finish_reason` (string, required, nullable) — Why the model stopped generating.

### TaskOutput2

A data task's result: the capability's own result object, such as `web.research` with `research_notes` and `sources` (in a view: `items`).

- `object` (string, required) — The result type, such as `web.research`.

### StoryboardShot

- `id` (string, required) — BeatAPI shot id. Use this id for media retrieval, edit, and compose operations.
- `index` (integer, required) — Zero-based shot order in the storyboard.
- `status` (enum, required) — Current lifecycle state for this storyboard shot.
  - Allowed values: `queued`, `processing`, `storyboard_ready`, `requires_action`, `editing`, `composing`, `succeeded`, `failed`
- `created_at` (integer, required) — Unix timestamp when the shot record was created.
- `updated_at` (integer, required) — Unix timestamp when the shot record last changed.
- `duration_seconds` (integer, optional) — Planned or generated shot duration in seconds.
- `prompt` (string, optional) — Creative instruction used to generate this shot.
- `lyric_text` (string, optional) — Lyric segment aligned with this shot when available.
- `media` (StoryboardShotMedia, optional) — Present only after the shot media has been materialized or after a shot edit finishes.

### TaskOutputOneOf0MediaItems

- `type` (enum, required) — Result asset type.
  - Allowed values: `image`, `video`
- `url` (string, required) — BeatAPI-hosted HTTPS result URL.
- `mime_type` (string, required) — Result asset MIME type.

### TaskOutputOneOf1Usage

Measured token usage used for final USD settlement.

- `input_tokens` (integer, required) — Tokens consumed by the prompt and video input.
- `output_tokens` (integer, required) — Tokens consumed by visible output and model reasoning.
- `total_tokens` (integer, required) — Total measured input and output tokens.

### StoryboardShotMedia

Present only after the shot media has been materialized or after a shot edit finishes.

- `type` (string, optional) — Hosted media type for the materialized shot.
- `url` (string, optional) — BeatAPI-hosted HTTPS URL for the materialized shot.
- `mime_type` (string, optional) — MIME type of the hosted shot media.

## Examples

### Standard

**Request**

```json
{
  "audio_url": "https://media.beatapi.io/samples/neon-singer-preview.mp3",
  "mv_tier": "standard",
  "images": [
    "https://media.beatapi.io/samples/neon-singer.png"
  ],
  "resolution": "720p"
}
```

**SDK Code**

```python Standard
import requests

url = "https://api.beatapi.io/v1/music-video/tasks"

payload = {
    "audio_url": "https://media.beatapi.io/samples/neon-singer-preview.mp3",
    "mv_tier": "standard",
    "images": ["https://media.beatapi.io/samples/neon-singer.png"],
    "resolution": "720p"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Standard
const url = 'https://api.beatapi.io/v1/music-video/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"audio_url":"https://media.beatapi.io/samples/neon-singer-preview.mp3","mv_tier":"standard","images":["https://media.beatapi.io/samples/neon-singer.png"],"resolution":"720p"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Standard
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beatapi.io/v1/music-video/tasks"

	payload := strings.NewReader("{\n  \"audio_url\": \"https://media.beatapi.io/samples/neon-singer-preview.mp3\",\n  \"mv_tier\": \"standard\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"720p\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Standard
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/music-video/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"audio_url\": \"https://media.beatapi.io/samples/neon-singer-preview.mp3\",\n  \"mv_tier\": \"standard\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"720p\"\n}"

response = http.request(request)
puts response.read_body
```

```java Standard
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/music-video/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"audio_url\": \"https://media.beatapi.io/samples/neon-singer-preview.mp3\",\n  \"mv_tier\": \"standard\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"720p\"\n}")
  .asString();
```

```php Standard
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/music-video/tasks', [
  'body' => '{
  "audio_url": "https://media.beatapi.io/samples/neon-singer-preview.mp3",
  "mv_tier": "standard",
  "images": [
    "https://media.beatapi.io/samples/neon-singer.png"
  ],
  "resolution": "720p"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Standard
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/music-video/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"audio_url\": \"https://media.beatapi.io/samples/neon-singer-preview.mp3\",\n  \"mv_tier\": \"standard\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"720p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Standard
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "audio_url": "https://media.beatapi.io/samples/neon-singer-preview.mp3",
  "mv_tier": "standard",
  "images": ["https://media.beatapi.io/samples/neon-singer.png"],
  "resolution": "720p"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/music-video/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Premium

**Request**

```json
{
  "audio_url": "https://media.beatapi.io/samples/song.mp3",
  "mv_tier": "premium",
  "images": [
    "https://media.beatapi.io/samples/stage.png"
  ],
  "resolution": "720p",
  "mv_mode": "sing_perform",
  "lip_ref_urls": [
    "https://media.beatapi.io/samples/singer.png"
  ]
}
```

**SDK Code**

```python Premium
import requests

url = "https://api.beatapi.io/v1/music-video/tasks"

payload = {
    "audio_url": "https://media.beatapi.io/samples/song.mp3",
    "mv_tier": "premium",
    "images": ["https://media.beatapi.io/samples/stage.png"],
    "resolution": "720p",
    "mv_mode": "sing_perform",
    "lip_ref_urls": ["https://media.beatapi.io/samples/singer.png"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Premium
const url = 'https://api.beatapi.io/v1/music-video/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"audio_url":"https://media.beatapi.io/samples/song.mp3","mv_tier":"premium","images":["https://media.beatapi.io/samples/stage.png"],"resolution":"720p","mv_mode":"sing_perform","lip_ref_urls":["https://media.beatapi.io/samples/singer.png"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Premium
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beatapi.io/v1/music-video/tasks"

	payload := strings.NewReader("{\n  \"audio_url\": \"https://media.beatapi.io/samples/song.mp3\",\n  \"mv_tier\": \"premium\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/stage.png\"\n  ],\n  \"resolution\": \"720p\",\n  \"mv_mode\": \"sing_perform\",\n  \"lip_ref_urls\": [\n    \"https://media.beatapi.io/samples/singer.png\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Premium
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/music-video/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"audio_url\": \"https://media.beatapi.io/samples/song.mp3\",\n  \"mv_tier\": \"premium\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/stage.png\"\n  ],\n  \"resolution\": \"720p\",\n  \"mv_mode\": \"sing_perform\",\n  \"lip_ref_urls\": [\n    \"https://media.beatapi.io/samples/singer.png\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Premium
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/music-video/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"audio_url\": \"https://media.beatapi.io/samples/song.mp3\",\n  \"mv_tier\": \"premium\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/stage.png\"\n  ],\n  \"resolution\": \"720p\",\n  \"mv_mode\": \"sing_perform\",\n  \"lip_ref_urls\": [\n    \"https://media.beatapi.io/samples/singer.png\"\n  ]\n}")
  .asString();
```

```php Premium
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/music-video/tasks', [
  'body' => '{
  "audio_url": "https://media.beatapi.io/samples/song.mp3",
  "mv_tier": "premium",
  "images": [
    "https://media.beatapi.io/samples/stage.png"
  ],
  "resolution": "720p",
  "mv_mode": "sing_perform",
  "lip_ref_urls": [
    "https://media.beatapi.io/samples/singer.png"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Premium
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/music-video/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"audio_url\": \"https://media.beatapi.io/samples/song.mp3\",\n  \"mv_tier\": \"premium\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/stage.png\"\n  ],\n  \"resolution\": \"720p\",\n  \"mv_mode\": \"sing_perform\",\n  \"lip_ref_urls\": [\n    \"https://media.beatapi.io/samples/singer.png\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Premium
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "audio_url": "https://media.beatapi.io/samples/song.mp3",
  "mv_tier": "premium",
  "images": ["https://media.beatapi.io/samples/stage.png"],
  "resolution": "720p",
  "mv_mode": "sing_perform",
  "lip_ref_urls": ["https://media.beatapi.io/samples/singer.png"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/music-video/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```