> 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-v-1-video-generations-post

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: openapi
  version: 1.0.0
paths:
  /v1/video/generations:
    post:
      operationId: create-video-generation-v-1-video-generations-post
      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:
        - subpackage_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/CreateVideoGenerationResponse'
        '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
    CreateVideoGenerationResponse:
      type: object
      properties:
        id:
          type: string
      required:
        - id
      title: CreateVideoGenerationResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "model": "byteplus/dreamina-seedance-2-0",
  "content": [
    {
      "type": "text",
      "text": "A girl holding a fox, the girl opens her eyes and gently looks at the camera, the fox is held gently, the camera slowly pulls back, the girl's hair is blown by the wind, and the sound of the wind can be heard."
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://easydrawingguides.com/wp-content/uploads/2017/04/how-to-draw-goku-featured-image-1200-735x692.png"
      }
    }
  ],
  "callback_url": "https://webhook.site/a281f7de-5e51-48ab-9781-4399f3c5d942",
  "generate_audio": true,
  "ratio": "adaptive",
  "duration": 5,
  "watermark": false
}
```

**Response**

```json
{
  "id": "string"
}
```

**SDK Code**

```python
import requests

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

payload = {
    "model": "byteplus/dreamina-seedance-2-0",
    "content": [
        {
            "type": "text",
            "text": "A girl holding a fox, the girl opens her eyes and gently looks at the camera, the fox is held gently, the camera slowly pulls back, the girl's hair is blown by the wind, and the sound of the wind can be heard."
        },
        {
            "type": "image_url",
            "image_url": { "url": "https://easydrawingguides.com/wp-content/uploads/2017/04/how-to-draw-goku-featured-image-1200-735x692.png" }
        }
    ],
    "callback_url": "https://webhook.site/a281f7de-5e51-48ab-9781-4399f3c5d942",
    "generate_audio": True,
    "ratio": "adaptive",
    "duration": 5,
    "watermark": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
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 girl holding a fox, the girl opens her eyes and gently looks at the camera, the fox is held gently, the camera slowly pulls back, the girl\'s hair is blown by the wind, and the sound of the wind can be heard."},{"type":"image_url","image_url":{"url":"https://easydrawingguides.com/wp-content/uploads/2017/04/how-to-draw-goku-featured-image-1200-735x692.png"}}],"callback_url":"https://webhook.site/a281f7de-5e51-48ab-9781-4399f3c5d942","generate_audio":true,"ratio":"adaptive","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
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 girl holding a fox, the girl opens her eyes and gently looks at the camera, the fox is held gently, the camera slowly pulls back, the girl's hair is blown by the wind, and the sound of the wind can be heard.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n        \"url\": \"https://easydrawingguides.com/wp-content/uploads/2017/04/how-to-draw-goku-featured-image-1200-735x692.png\"\n      }\n    }\n  ],\n  \"callback_url\": \"https://webhook.site/a281f7de-5e51-48ab-9781-4399f3c5d942\",\n  \"generate_audio\": true,\n  \"ratio\": \"adaptive\",\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
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 girl holding a fox, the girl opens her eyes and gently looks at the camera, the fox is held gently, the camera slowly pulls back, the girl's hair is blown by the wind, and the sound of the wind can be heard.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n        \"url\": \"https://easydrawingguides.com/wp-content/uploads/2017/04/how-to-draw-goku-featured-image-1200-735x692.png\"\n      }\n    }\n  ],\n  \"callback_url\": \"https://webhook.site/a281f7de-5e51-48ab-9781-4399f3c5d942\",\n  \"generate_audio\": true,\n  \"ratio\": \"adaptive\",\n  \"duration\": 5,\n  \"watermark\": false\n}"

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

```java
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 girl holding a fox, the girl opens her eyes and gently looks at the camera, the fox is held gently, the camera slowly pulls back, the girl's hair is blown by the wind, and the sound of the wind can be heard.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n        \"url\": \"https://easydrawingguides.com/wp-content/uploads/2017/04/how-to-draw-goku-featured-image-1200-735x692.png\"\n      }\n    }\n  ],\n  \"callback_url\": \"https://webhook.site/a281f7de-5e51-48ab-9781-4399f3c5d942\",\n  \"generate_audio\": true,\n  \"ratio\": \"adaptive\",\n  \"duration\": 5,\n  \"watermark\": false\n}")
  .asString();
```

```php
<?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 girl holding a fox, the girl opens her eyes and gently looks at the camera, the fox is held gently, the camera slowly pulls back, the girl\'s hair is blown by the wind, and the sound of the wind can be heard."
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://easydrawingguides.com/wp-content/uploads/2017/04/how-to-draw-goku-featured-image-1200-735x692.png"
      }
    }
  ],
  "callback_url": "https://webhook.site/a281f7de-5e51-48ab-9781-4399f3c5d942",
  "generate_audio": true,
  "ratio": "adaptive",
  "duration": 5,
  "watermark": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
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 girl holding a fox, the girl opens her eyes and gently looks at the camera, the fox is held gently, the camera slowly pulls back, the girl's hair is blown by the wind, and the sound of the wind can be heard.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n        \"url\": \"https://easydrawingguides.com/wp-content/uploads/2017/04/how-to-draw-goku-featured-image-1200-735x692.png\"\n      }\n    }\n  ],\n  \"callback_url\": \"https://webhook.site/a281f7de-5e51-48ab-9781-4399f3c5d942\",\n  \"generate_audio\": true,\n  \"ratio\": \"adaptive\",\n  \"duration\": 5,\n  \"watermark\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "byteplus/dreamina-seedance-2-0",
  "content": [
    [
      "type": "text",
      "text": "A girl holding a fox, the girl opens her eyes and gently looks at the camera, the fox is held gently, the camera slowly pulls back, the girl's hair is blown by the wind, and the sound of the wind can be heard."
    ],
    [
      "type": "image_url",
      "image_url": ["url": "https://easydrawingguides.com/wp-content/uploads/2017/04/how-to-draw-goku-featured-image-1200-735x692.png"]
    ]
  ],
  "callback_url": "https://webhook.site/a281f7de-5e51-48ab-9781-4399f3c5d942",
  "generate_audio": true,
  "ratio": "adaptive",
  "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()
```