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

# Create Video Generation

POST https://api.meshapi.ai/v1/video/generations
Content-Type: application/json

Create a BytePlus Seedance video generation task.

Returns immediately with ``{"id": "<task_id>"}``.
Poll ``GET /v1/video/generations/{id}`` until status is
``succeeded``, ``failed``, or ``expired``.

Pass ``callback_url`` to receive a POST notification when the task
status changes. We intercept the BytePlus callback, update our DB,
then forward the full task payload to your URL.

Reference: https://developers.meshapi.ai/api-reference/mesh-api/video/create-video-generation

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: openapi
  version: 1.0.0
paths:
  /v1/video/generations:
    post:
      operationId: create-video-generation
      summary: Create Video Generation
      description: |-
        Create a BytePlus Seedance video generation task.

        Returns immediately with ``{"id": "<task_id>"}``.
        Poll ``GET /v1/video/generations/{id}`` until status is
        ``succeeded``, ``failed``, or ``expired``.

        Pass ``callback_url`` to receive a POST notification when the task
        status changes. We intercept the BytePlus callback, update our DB,
        then forward the full task payload to your URL.
      tags:
        - video
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Task created; poll the returned id for status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                description: Any type
        '402':
          description: Insufficient balance or spend cap reached
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Model not found or not a BytePlus video model
          content:
            application/json:
              schema:
                description: Any type
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                description: Any type
        '502':
          description: BytePlus upstream error
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
servers:
  - url: https://api.meshapi.ai
    description: Production Server
components:
  schemas:
    VideoContentItem:
      type: object
      properties:
        type:
          type: string
        text:
          type:
            - string
            - 'null'
        image_url:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        video_url:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        audio_url:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        draft_task:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        role:
          type:
            - string
            - 'null'
      required:
        - type
      description: >-
        A single item in the content array (text, image_url, video_url,
        audio_url).
      title: VideoContentItem
    VideoGenerationRequest:
      type: object
      properties:
        model:
          type: string
        content:
          type: array
          items:
            $ref: '#/components/schemas/VideoContentItem'
        callback_url:
          type:
            - string
            - 'null'
        return_last_frame:
          type: boolean
          default: false
        service_tier:
          type:
            - string
            - 'null'
        execution_expires_after:
          type:
            - integer
            - 'null'
        generate_audio:
          type:
            - boolean
            - 'null'
        draft:
          type:
            - boolean
            - 'null'
        resolution:
          type:
            - string
            - 'null'
        ratio:
          type:
            - string
            - 'null'
        duration:
          type:
            - integer
            - 'null'
        frames:
          type:
            - integer
            - 'null'
        seed:
          type:
            - integer
            - 'null'
        camera_fixed:
          type:
            - boolean
            - 'null'
        watermark:
          type:
            - boolean
            - 'null'
        safety_identifier:
          type:
            - string
            - 'null'
        priority:
          type:
            - integer
            - 'null'
      required:
        - model
        - content
      title: VideoGenerationRequest
    VideoTaskError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      title: VideoTaskError
    VideoTaskContent:
      type: object
      properties:
        video_url:
          type:
            - string
            - 'null'
        last_frame_url:
          type:
            - string
            - 'null'
      title: VideoTaskContent
    VideoTaskUsage:
      type: object
      properties:
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
      required:
        - completion_tokens
        - total_tokens
      title: VideoTaskUsage
    VideoTaskResponse:
      type: object
      properties:
        id:
          type: string
        model:
          type:
            - string
            - 'null'
        status:
          type: string
          default: queued
        error:
          oneOf:
            - $ref: '#/components/schemas/VideoTaskError'
            - type: 'null'
        created_at:
          type:
            - integer
            - 'null'
        updated_at:
          type:
            - integer
            - 'null'
        content:
          oneOf:
            - $ref: '#/components/schemas/VideoTaskContent'
            - type: 'null'
        seed:
          type:
            - integer
            - 'null'
        resolution:
          type:
            - string
            - 'null'
        ratio:
          type:
            - string
            - 'null'
        duration:
          type:
            - integer
            - 'null'
        frames:
          type:
            - integer
            - 'null'
        framespersecond:
          type:
            - integer
            - 'null'
        generate_audio:
          type:
            - boolean
            - 'null'
        safety_identifier:
          type:
            - string
            - 'null'
        priority:
          type:
            - integer
            - 'null'
        draft:
          type:
            - boolean
            - 'null'
        draft_task_id:
          type:
            - string
            - 'null'
        service_tier:
          type:
            - string
            - 'null'
        execution_expires_after:
          type:
            - integer
            - 'null'
        usage:
          oneOf:
            - $ref: '#/components/schemas/VideoTaskUsage'
            - type: 'null'
      required:
        - id
      title: VideoTaskResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

```

## Examples

### Example response



**Request**

```json
undefined
```

**Response**

```json
{
  "id": "vid_01JZ0S8R7G5A4N3C2V1B0M9K8J"
}
```

**SDK Code**

```python Example response
import requests

url = "https://api.meshapi.ai/v1/video/generations"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Example response
const url = 'https://api.meshapi.ai/v1/video/generations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go Example response
package main

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

func main() {

	url := "https://api.meshapi.ai/v1/video/generations"

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

	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 Example response
require 'uri'
require 'net/http'

url = URI("https://api.meshapi.ai/v1/video/generations")

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'

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

```java Example response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.meshapi.ai/v1/video/generations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.meshapi.ai/v1/video/generations', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Example response
using RestSharp;

var client = new RestClient("https://api.meshapi.ai/v1/video/generations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Example response
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.meshapi.ai/v1/video/generations")! 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()
```

### Example request



**Request**

```json
{
  "model": "byteplus/dreamina-seedance-2-0",
  "content": [
    {
      "type": "text",
      "text": "A paper boat drifting across a calm pond at sunrise."
    }
  ],
  "generate_audio": true,
  "ratio": "16:9",
  "duration": 5,
  "watermark": false
}
```

**Response**

```json
{
  "id": "vid_01JZ0S8R7G5A4N3C2V1B0M9K8J"
}
```

**SDK Code**

```python Example request
import requests

url = "https://api.meshapi.ai/v1/video/generations"

payload = {
    "model": "byteplus/dreamina-seedance-2-0",
    "content": [
        {
            "type": "text",
            "text": "A paper boat drifting across a calm pond at sunrise."
        }
    ],
    "generate_audio": True,
    "ratio": "16:9",
    "duration": 5,
    "watermark": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Example request
const url = 'https://api.meshapi.ai/v1/video/generations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"byteplus/dreamina-seedance-2-0","content":[{"type":"text","text":"A paper boat drifting across a calm pond at sunrise."}],"generate_audio":true,"ratio":"16:9","duration":5,"watermark":false}'
};

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

```go Example request
package main

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

func main() {

	url := "https://api.meshapi.ai/v1/video/generations"

	payload := strings.NewReader("{\n  \"model\": \"byteplus/dreamina-seedance-2-0\",\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"A paper boat drifting across a calm pond at sunrise.\"\n    }\n  ],\n  \"generate_audio\": true,\n  \"ratio\": \"16:9\",\n  \"duration\": 5,\n  \"watermark\": false\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 Example request
require 'uri'
require 'net/http'

url = URI("https://api.meshapi.ai/v1/video/generations")

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  \"model\": \"byteplus/dreamina-seedance-2-0\",\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"A paper boat drifting across a calm pond at sunrise.\"\n    }\n  ],\n  \"generate_audio\": true,\n  \"ratio\": \"16:9\",\n  \"duration\": 5,\n  \"watermark\": false\n}"

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

```java Example request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.meshapi.ai/v1/video/generations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"byteplus/dreamina-seedance-2-0\",\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"A paper boat drifting across a calm pond at sunrise.\"\n    }\n  ],\n  \"generate_audio\": true,\n  \"ratio\": \"16:9\",\n  \"duration\": 5,\n  \"watermark\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.meshapi.ai/v1/video/generations', [
  'body' => '{
  "model": "byteplus/dreamina-seedance-2-0",
  "content": [
    {
      "type": "text",
      "text": "A paper boat drifting across a calm pond at sunrise."
    }
  ],
  "generate_audio": true,
  "ratio": "16:9",
  "duration": 5,
  "watermark": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Example request
using RestSharp;

var client = new RestClient("https://api.meshapi.ai/v1/video/generations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"byteplus/dreamina-seedance-2-0\",\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"A paper boat drifting across a calm pond at sunrise.\"\n    }\n  ],\n  \"generate_audio\": true,\n  \"ratio\": \"16:9\",\n  \"duration\": 5,\n  \"watermark\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example request
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "byteplus/dreamina-seedance-2-0",
  "content": [
    [
      "type": "text",
      "text": "A paper boat drifting across a calm pond at sunrise."
    ]
  ],
  "generate_audio": true,
  "ratio": "16:9",
  "duration": 5,
  "watermark": false
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.meshapi.ai/v1/video/generations")! 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()
```