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

# Veo 3.1

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

Generate fixed 8-second videos with selectable Quality, Fast, or Lite tiers and 720p, 1080p, or 4K output. Text and frame generation default to Quality at 720p; reference images require Fast or Lite.

### Supported modes

| Mode                  | Required input                        | Rules                                                                       |
| --------------------- | ------------------------------------- | --------------------------------------------------------------------------- |
| Quality               | `model`, `prompt`                     | Set `quality=Quality` and optional `resolution` (`720p`, `1080p`, or `4k`). |
| Fast                  | `model`, `prompt`                     | Set `quality=Fast` and optional `resolution` (`720p`, `1080p`, or `4k`).    |
| Lite                  | `model`, `prompt`                     | Set `quality=Lite` and optional `resolution` (`720p`, `1080p`, or `4k`).    |
| First and last frames | `model`, `prompt`, `images`           | Provide one first-frame URL or two URLs in first-to-last order.             |
| Reference images      | `model`, `prompt`, `reference_images` | Provide 1–3 URLs, use Fast or Lite, and do not combine with `images`.       |

**Async flow:** Create the task, save `data.id`, then [poll the Task](/quick-guide#get-task-status) with `GET /v1/tasks/{task_id}`. On `succeeded`, read `data.output.media`. On `failed`, read `data.error_code` and `data.error_message`, then follow the [error and retry policy](/quick-guide#errors-and-retry-policy).

**Using a local file?** [upload a local input](/quick-guide#upload-an-input-file) first and pass the returned `data.url`.

Reference: https://docs.beatapi.io/api-reference/video-api/veo-3-1

## Authentication

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

## Request

### Headers

- `Idempotency-Key` (string, optional)

### Body (application/json)

This endpoint expects a Veo31VideoRequest.

- `Veo31VideoRequest`

## Response

### 201

Video generation task accepted

## 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 requests (`rate_limit_exceeded`, including the free-model limits) or too many tasks processing at once (`user_concurrency_exceeded`). Retryable after `Retry-After` seconds (also `error.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

### Veo31TextOrFrameVideoRequest

Veo 3.1 text or first/last-frame generation. Output is fixed at 8 seconds and defaults to Quality at 720p. Price depends on quality and resolution.

- `model` ("veo-3.1", required) — Must be `veo-3.1`.
- `prompt` (string, required) — Video generation instructions.
- `images` (list of string, optional) — One first-frame image or first- and last-frame images as public HTTPS URLs.
- `aspect_ratio` (enum, optional, default: 16:9) — Output video aspect ratio.
  - Allowed values: `16:9`, `9:16`, `auto`
- `resolution` (enum, optional, default: 720p) — Output video resolution. 4k and 4K are equivalent. Price depends on quality and resolution.
  - Allowed values: `720p`, `1080p`, `4k`, `4K`
- `quality` (enum, optional, default: Quality) — Text or frame generation tier.
  - Allowed values: `Quality`, `Fast`, `Lite`
- `watermark` (string, optional) — Optional watermark text forwarded to the selected model.
- `enable_translation` (boolean, optional) — Allow prompt translation before generation.

### Veo31ReferenceVideoRequest

Veo 3.1 reference-image generation. Output is fixed at 8 seconds and supports the Fast or Lite tier, defaulting to Fast at 720p. Price depends on quality and resolution.

- `model` ("veo-3.1", required) — Must be `veo-3.1`.
- `prompt` (string, required) — Video generation instructions.
- `reference_images` (list of string, required) — Public HTTPS reference images.
- `aspect_ratio` (enum, optional, default: 16:9) — Output video aspect ratio.
  - Allowed values: `16:9`, `9:16`, `auto`
- `resolution` (enum, optional, default: 720p) — Output video resolution. 4k and 4K are equivalent. Price depends on quality and resolution.
  - Allowed values: `720p`, `1080p`, `4k`, `4K`
- `quality` (enum, optional, default: Fast) — Reference-image generation tier.
  - Allowed values: `Fast`, `Lite`
- `watermark` (string, optional) — Optional watermark text forwarded to the selected model.
- `enable_translation` (boolean, optional) — Allow prompt translation before generation.

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

## Examples

### Veo 3.1

**Response**

```json
{
  "data": {
    "capability_id": "veo-3.1",
    "capability_version": null,
    "completed_at": null,
    "created_at": 1782210000,
    "error_code": null,
    "error_message": null,
    "id": "task_8K2qA",
    "media_type": "video",
    "model": "veo-3.1",
    "object": "task",
    "output": null,
    "request_id": "req_abc123",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1782210000,
    "usage": {
      "billable_duration_seconds": 8,
      "credits_charged": 2,
      "credits_refunded": 0,
      "credits_reserved": 2,
      "credits_settled": 0
    }
  }
}
```

**SDK Code**

```python Veo 3.1
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript Veo 3.1
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

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

```go Veo 3.1
package main

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

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Veo 3.1
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/tasks")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Veo 3.1
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Veo 3.1
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Veo 3.1
import Foundation

let headers = ["Authorization": "Bearer <token>"]

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

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()
```

### Quality

**Request**

```json
{
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "A cinematic aerial reveal of a quiet coastal village at sunrise.",
  "quality": "Quality",
  "resolution": "720p"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "veo-3.1",
    "capability_version": null,
    "completed_at": null,
    "created_at": 1782210000,
    "error_code": null,
    "error_message": null,
    "id": "task_8K2qA",
    "media_type": "video",
    "model": "veo-3.1",
    "object": "task",
    "output": null,
    "request_id": "req_abc123",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1782210000,
    "usage": {
      "billable_duration_seconds": 8,
      "credits_charged": 2,
      "credits_refunded": 0,
      "credits_reserved": 2,
      "credits_settled": 0
    }
  }
}
```

**SDK Code**

```python Quality
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "aspect_ratio": "16:9",
    "model": "veo-3.1",
    "prompt": "A cinematic aerial reveal of a quiet coastal village at sunrise.",
    "quality": "Quality",
    "resolution": "720p"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Quality
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"aspect_ratio":"16:9","model":"veo-3.1","prompt":"A cinematic aerial reveal of a quiet coastal village at sunrise.","quality":"Quality","resolution":"720p"}'
};

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

```go Quality
package main

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

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A cinematic aerial reveal of a quiet coastal village at sunrise.\",\n  \"quality\": \"Quality\",\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 Quality
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/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  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A cinematic aerial reveal of a quiet coastal village at sunrise.\",\n  \"quality\": \"Quality\",\n  \"resolution\": \"720p\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A cinematic aerial reveal of a quiet coastal village at sunrise.\",\n  \"quality\": \"Quality\",\n  \"resolution\": \"720p\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "A cinematic aerial reveal of a quiet coastal village at sunrise.",
  "quality": "Quality",
  "resolution": "720p"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Quality
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A cinematic aerial reveal of a quiet coastal village at sunrise.\",\n  \"quality\": \"Quality\",\n  \"resolution\": \"720p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Quality
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "A cinematic aerial reveal of a quiet coastal village at sunrise.",
  "quality": "Quality",
  "resolution": "720p"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/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()
```

### Fast

**Request**

```json
{
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "A fast cinematic product reveal with natural camera motion.",
  "quality": "Fast",
  "resolution": "1080p"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "veo-3.1",
    "capability_version": null,
    "completed_at": null,
    "created_at": 1782210000,
    "error_code": null,
    "error_message": null,
    "id": "task_8K2qA",
    "media_type": "video",
    "model": "veo-3.1",
    "object": "task",
    "output": null,
    "request_id": "req_abc123",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1782210000,
    "usage": {
      "billable_duration_seconds": 8,
      "credits_charged": 2,
      "credits_refunded": 0,
      "credits_reserved": 2,
      "credits_settled": 0
    }
  }
}
```

**SDK Code**

```python Fast
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "aspect_ratio": "16:9",
    "model": "veo-3.1",
    "prompt": "A fast cinematic product reveal with natural camera motion.",
    "quality": "Fast",
    "resolution": "1080p"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Fast
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"aspect_ratio":"16:9","model":"veo-3.1","prompt":"A fast cinematic product reveal with natural camera motion.","quality":"Fast","resolution":"1080p"}'
};

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

```go Fast
package main

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

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A fast cinematic product reveal with natural camera motion.\",\n  \"quality\": \"Fast\",\n  \"resolution\": \"1080p\"\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 Fast
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/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  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A fast cinematic product reveal with natural camera motion.\",\n  \"quality\": \"Fast\",\n  \"resolution\": \"1080p\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A fast cinematic product reveal with natural camera motion.\",\n  \"quality\": \"Fast\",\n  \"resolution\": \"1080p\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "A fast cinematic product reveal with natural camera motion.",
  "quality": "Fast",
  "resolution": "1080p"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Fast
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A fast cinematic product reveal with natural camera motion.\",\n  \"quality\": \"Fast\",\n  \"resolution\": \"1080p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Fast
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "A fast cinematic product reveal with natural camera motion.",
  "quality": "Fast",
  "resolution": "1080p"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/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()
```

### Lite

**Request**

```json
{
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "A concise storyboard-ready product reveal.",
  "quality": "Lite",
  "resolution": "4k"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "veo-3.1",
    "capability_version": null,
    "completed_at": null,
    "created_at": 1782210000,
    "error_code": null,
    "error_message": null,
    "id": "task_8K2qA",
    "media_type": "video",
    "model": "veo-3.1",
    "object": "task",
    "output": null,
    "request_id": "req_abc123",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1782210000,
    "usage": {
      "billable_duration_seconds": 8,
      "credits_charged": 2,
      "credits_refunded": 0,
      "credits_reserved": 2,
      "credits_settled": 0
    }
  }
}
```

**SDK Code**

```python Lite
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "aspect_ratio": "16:9",
    "model": "veo-3.1",
    "prompt": "A concise storyboard-ready product reveal.",
    "quality": "Lite",
    "resolution": "4k"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Lite
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"aspect_ratio":"16:9","model":"veo-3.1","prompt":"A concise storyboard-ready product reveal.","quality":"Lite","resolution":"4k"}'
};

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

```go Lite
package main

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

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A concise storyboard-ready product reveal.\",\n  \"quality\": \"Lite\",\n  \"resolution\": \"4k\"\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 Lite
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/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  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A concise storyboard-ready product reveal.\",\n  \"quality\": \"Lite\",\n  \"resolution\": \"4k\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A concise storyboard-ready product reveal.\",\n  \"quality\": \"Lite\",\n  \"resolution\": \"4k\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "A concise storyboard-ready product reveal.",
  "quality": "Lite",
  "resolution": "4k"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Lite
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"A concise storyboard-ready product reveal.\",\n  \"quality\": \"Lite\",\n  \"resolution\": \"4k\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Lite
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "A concise storyboard-ready product reveal.",
  "quality": "Lite",
  "resolution": "4k"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/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()
```

### First and last frames

**Request**

```json
{
  "aspect_ratio": "16:9",
  "images": [
    "https://media.beatapi.io/samples/neon-singer.png",
    "https://media.beatapi.io/samples/smart-bottle.png"
  ],
  "model": "veo-3.1",
  "prompt": "Move smoothly from the opening portrait to the final product reveal.",
  "quality": "Quality",
  "resolution": "720p"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "veo-3.1",
    "capability_version": null,
    "completed_at": null,
    "created_at": 1782210000,
    "error_code": null,
    "error_message": null,
    "id": "task_8K2qA",
    "media_type": "video",
    "model": "veo-3.1",
    "object": "task",
    "output": null,
    "request_id": "req_abc123",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1782210000,
    "usage": {
      "billable_duration_seconds": 8,
      "credits_charged": 2,
      "credits_refunded": 0,
      "credits_reserved": 2,
      "credits_settled": 0
    }
  }
}
```

**SDK Code**

```python First and last frames
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "aspect_ratio": "16:9",
    "images": ["https://media.beatapi.io/samples/neon-singer.png", "https://media.beatapi.io/samples/smart-bottle.png"],
    "model": "veo-3.1",
    "prompt": "Move smoothly from the opening portrait to the final product reveal.",
    "quality": "Quality",
    "resolution": "720p"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript First and last frames
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"aspect_ratio":"16:9","images":["https://media.beatapi.io/samples/neon-singer.png","https://media.beatapi.io/samples/smart-bottle.png"],"model":"veo-3.1","prompt":"Move smoothly from the opening portrait to the final product reveal.","quality":"Quality","resolution":"720p"}'
};

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

```go First and last frames
package main

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

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"aspect_ratio\": \"16:9\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\",\n    \"https://media.beatapi.io/samples/smart-bottle.png\"\n  ],\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"Move smoothly from the opening portrait to the final product reveal.\",\n  \"quality\": \"Quality\",\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 First and last frames
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/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  \"aspect_ratio\": \"16:9\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\",\n    \"https://media.beatapi.io/samples/smart-bottle.png\"\n  ],\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"Move smoothly from the opening portrait to the final product reveal.\",\n  \"quality\": \"Quality\",\n  \"resolution\": \"720p\"\n}"

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

```java First and last frames
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"aspect_ratio\": \"16:9\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\",\n    \"https://media.beatapi.io/samples/smart-bottle.png\"\n  ],\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"Move smoothly from the opening portrait to the final product reveal.\",\n  \"quality\": \"Quality\",\n  \"resolution\": \"720p\"\n}")
  .asString();
```

```php First and last frames
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "aspect_ratio": "16:9",
  "images": [
    "https://media.beatapi.io/samples/neon-singer.png",
    "https://media.beatapi.io/samples/smart-bottle.png"
  ],
  "model": "veo-3.1",
  "prompt": "Move smoothly from the opening portrait to the final product reveal.",
  "quality": "Quality",
  "resolution": "720p"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp First and last frames
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"aspect_ratio\": \"16:9\",\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\",\n    \"https://media.beatapi.io/samples/smart-bottle.png\"\n  ],\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"Move smoothly from the opening portrait to the final product reveal.\",\n  \"quality\": \"Quality\",\n  \"resolution\": \"720p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift First and last frames
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "aspect_ratio": "16:9",
  "images": ["https://media.beatapi.io/samples/neon-singer.png", "https://media.beatapi.io/samples/smart-bottle.png"],
  "model": "veo-3.1",
  "prompt": "Move smoothly from the opening portrait to the final product reveal.",
  "quality": "Quality",
  "resolution": "720p"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/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()
```

### Reference images (Fast)

**Request**

```json
{
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "Create a cohesive cinematic scene using the supplied visual references.",
  "quality": "Fast",
  "reference_images": [
    "https://media.beatapi.io/samples/neon-singer.png",
    "https://media.beatapi.io/samples/smart-bottle.png"
  ],
  "resolution": "720p"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "veo-3.1",
    "capability_version": null,
    "completed_at": null,
    "created_at": 1782210000,
    "error_code": null,
    "error_message": null,
    "id": "task_8K2qA",
    "media_type": "video",
    "model": "veo-3.1",
    "object": "task",
    "output": null,
    "request_id": "req_abc123",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1782210000,
    "usage": {
      "billable_duration_seconds": 8,
      "credits_charged": 2,
      "credits_refunded": 0,
      "credits_reserved": 2,
      "credits_settled": 0
    }
  }
}
```

**SDK Code**

```python Reference images (Fast)
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "aspect_ratio": "16:9",
    "model": "veo-3.1",
    "prompt": "Create a cohesive cinematic scene using the supplied visual references.",
    "quality": "Fast",
    "reference_images": ["https://media.beatapi.io/samples/neon-singer.png", "https://media.beatapi.io/samples/smart-bottle.png"],
    "resolution": "720p"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Reference images (Fast)
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"aspect_ratio":"16:9","model":"veo-3.1","prompt":"Create a cohesive cinematic scene using the supplied visual references.","quality":"Fast","reference_images":["https://media.beatapi.io/samples/neon-singer.png","https://media.beatapi.io/samples/smart-bottle.png"],"resolution":"720p"}'
};

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

```go Reference images (Fast)
package main

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

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"Create a cohesive cinematic scene using the supplied visual references.\",\n  \"quality\": \"Fast\",\n  \"reference_images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\",\n    \"https://media.beatapi.io/samples/smart-bottle.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 Reference images (Fast)
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/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  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"Create a cohesive cinematic scene using the supplied visual references.\",\n  \"quality\": \"Fast\",\n  \"reference_images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\",\n    \"https://media.beatapi.io/samples/smart-bottle.png\"\n  ],\n  \"resolution\": \"720p\"\n}"

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

```java Reference images (Fast)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"Create a cohesive cinematic scene using the supplied visual references.\",\n  \"quality\": \"Fast\",\n  \"reference_images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\",\n    \"https://media.beatapi.io/samples/smart-bottle.png\"\n  ],\n  \"resolution\": \"720p\"\n}")
  .asString();
```

```php Reference images (Fast)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "Create a cohesive cinematic scene using the supplied visual references.",
  "quality": "Fast",
  "reference_images": [
    "https://media.beatapi.io/samples/neon-singer.png",
    "https://media.beatapi.io/samples/smart-bottle.png"
  ],
  "resolution": "720p"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Reference images (Fast)
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"aspect_ratio\": \"16:9\",\n  \"model\": \"veo-3.1\",\n  \"prompt\": \"Create a cohesive cinematic scene using the supplied visual references.\",\n  \"quality\": \"Fast\",\n  \"reference_images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\",\n    \"https://media.beatapi.io/samples/smart-bottle.png\"\n  ],\n  \"resolution\": \"720p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Reference images (Fast)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "aspect_ratio": "16:9",
  "model": "veo-3.1",
  "prompt": "Create a cohesive cinematic scene using the supplied visual references.",
  "quality": "Fast",
  "reference_images": ["https://media.beatapi.io/samples/neon-singer.png", "https://media.beatapi.io/samples/smart-bottle.png"],
  "resolution": "720p"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/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()
```