> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# doubao-seedance-1-0-pro 비디오 생성

>  - 비동기 처리 모드, 후속 쿼리를 위한 작업 ID 반환
- 텍스트-비디오, 이미지-비디오 (첫 프레임/마지막 프레임) 지원
- 가로, 세로, 정사각형 여러 비율 지원 

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "doubao-seedance-1-0-pro-fast",
      "prompt": "햇빛 아래에서 노는 귀여운 새끼 고양이, 푹신한 털, 밝은 눈",
      "duration": 5,
      "aspect_ratio": "16:9",
      "resolution": "1080p"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.apimart.ai/v1/videos/generations"

  payload = {
      "model": "doubao-seedance-1-0-pro-fast",
      "prompt": "햇빛 아래에서 노는 귀여운 새끼 고양이, 푹신한 털, 밝은 눈",
      "duration": 5,
      "aspect_ratio": "16:9",
      "resolution": "1080p"
  }

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

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

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://api.apimart.ai/v1/videos/generations";

  const payload = {
    model: "doubao-seedance-1-0-pro-fast",
    prompt: "햇빛 아래에서 노는 귀여운 새끼 고양이, 푹신한 털, 밝은 눈",
    duration: 5,
    aspect_ratio: "16:9",
    resolution: "720p"
  };

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

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload)
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "io/ioutil"
      "net/http"
  )

  func main() {
      url := "https://api.apimart.ai/v1/videos/generations"

      payload := map[string]interface{}{
          "model":        "doubao-seedance-1-0-pro-fast",
          "prompt":       "햇빛 아래에서 노는 귀여운 새끼 고양이, 푹신한 털, 밝은 눈",
          "duration":     5,
          "aspect_ratio": "16:9",
          "resolution":   "720p",
      }

      jsonData, _ := json.Marshal(payload)

      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer <token>")
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;

  public class Main {
      public static void main(String[] args) throws Exception {
          String url = "https://api.apimart.ai/v1/videos/generations";

          String payload = """
          {
            "model": "doubao-seedance-1-0-pro-fast",
            "prompt": "햇빛 아래에서 노는 귀여운 새끼 고양이, 푹신한 털, 밝은 눈",
            "duration": 5,
            "aspect_ratio": "16:9",
            "resolution": "1080p"
          }
          """;

          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create(url))
              .header("Authorization", "Bearer <token>")
              .header("Content-Type", "application/json")
              .POST(HttpRequest.BodyPublishers.ofString(payload))
              .build();

          HttpResponse<String> response = client.send(request,
              HttpResponse.BodyHandlers.ofString());

          System.out.println(response.body());
      }
  }
  ```

  ```php PHP theme={null}
  <?php

  $url = "https://api.apimart.ai/v1/videos/generations";

  $payload = [
      "model" => "doubao-seedance-1-0-pro-fast",
      "prompt" => "햇빛 아래에서 노는 귀여운 새끼 고양이, 푹신한 털, 밝은 눈",
      "duration" => 5,
      "aspect_ratio" => "16:9",
      "resolution" => "720p"
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer <token>",
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ?>
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  url = URI("https://api.apimart.ai/v1/videos/generations")

  payload = {
    model: "doubao-seedance-1-0-pro-fast",
    prompt: "햇빛 아래에서 노는 귀여운 새끼 고양이, 푹신한 털, 밝은 눈",
    duration: 5,
    aspect_ratio: "16:9",
    resolution: "720p"
  }

  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 = payload.to_json

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

  ```swift Swift theme={null}
  import Foundation

  let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!

  let payload: [String: Any] = [
      "model": "doubao-seedance-1-0-pro-fast",
      "prompt": "햇빛 아래에서 노는 귀여운 새끼 고양이, 푹신한 털, 밝은 눈",
      "duration": 5,
      "aspect_ratio": "16:9",
      "resolution": "1080p"
  ]

  var request = URLRequest(url: url)
  request.httpMethod = "POST"
  request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
  request.setValue("application/json", forHTTPHeaderField: "Content-Type")
  request.httpBody = try? JSONSerialization.data(withJSONObject: payload)

  let task = URLSession.shared.dataTask(with: request) { data, response, error in
      if let error = error {
          print("Error: \(error)")
          return
      }

      if let data = data, let responseString = String(data: data, encoding: .utf8) {
          print(responseString)
      }
  }

  task.resume()
  ```

  ```csharp C# theme={null}
  using System;
  using System.Net.Http;
  using System.Text;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main(string[] args)
      {
          var url = "https://api.apimart.ai/v1/videos/generations";

          var payload = @"{
              ""model"": ""doubao-seedance-1-0-pro-fast"",
              ""prompt"": ""햇빛 아래에서 노는 귀여운 새끼 고양이, 푹신한 털, 밝은 눈"",
              ""duration"": 5,
              ""aspect_ratio"": ""16:9"",
              ""resolution"": ""720p""
          }";

          using var client = new HttpClient();
          client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");

          var content = new StringContent(payload, Encoding.UTF8, "application/json");
          var response = await client.PostAsync(url, content);
          var result = await response.Content.ReadAsStringAsync();

          Console.WriteLine(result);
      }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": [
      {
        "status": "submitted",
        "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "요청 매개변수가 잘못되었습니다",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "인증에 실패했습니다. API 키를 확인하세요",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "잔액이 부족합니다. 충전해 주세요",
      "type": "payment_required"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": 429,
      "message": "요청이 너무 많습니다. 나중에 다시 시도하세요",
      "type": "rate_limit_error"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": 500,
      "message": "서버 내부 오류. 나중에 다시 시도하세요",
      "type": "server_error"
    }
  }
  ```
</ResponseExample>

## 인증

<ParamField header="Authorization" type="string" required>
  모든 API 엔드포인트에는 Bearer Token 인증이 필요합니다

  API 키 받기:

  [API 키 관리 페이지](https://apimart.ai/keys)에서 API 키를 받으세요

  요청 헤더에 추가:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## 요청 매개변수

<ParamField body="model" type="string" required>
  비디오 생성 모델 이름

  지원되는 모델:

  * `doubao-seedance-1-0-pro-fast` - 빠른 버전, 빠른 생성, 미리보기 및 반복에 적합
  * `doubao-seedance-1-0-pro-quality` - 고품질 버전, 생성 시간이 더 길지만, 더 좋은 품질
</ParamField>

<ParamField body="prompt" type="string" required>
  비디오 콘텐츠 설명

  더 좋은 생성 결과를 위해 장면, 동작, 스타일 등을 자세히 설명하세요

  예: `"해변의 일몰, 바다 위의 황금빛 햇살, 모래사장을 부드럽게 치는 파도"`
</ParamField>

<ParamField body="duration" type="integer" default="5">
  비디오 길이(초)

  지원 범위: `2` \~ `12` 초

  기본값: `5`
</ParamField>

<ParamField body="aspect_ratio" type="string" default="16:9">
  비디오 종횡비

  옵션:

  * `16:9` - 가로
  * `9:16` - 세로
  * `1:1` - 정사각형
  * `4:3` - 전통 비율
  * `3:4` - 세로 전통 비율
  * `21:9` - 울트라 와이드

  기본값: `16:9`
</ParamField>

<ParamField body="resolution" type="string" default="1080p">
  비디오 해상도

  옵션:

  * `480p` - 표준 화질
  * `720p` - HD
  * `1080p` - Full HD

  기본값: `1080p`
</ParamField>

<ParamField body="seed" type="integer">
  생성 콘텐츠의 무작위성을 제어하기 위한 시드 정수

  값 범위: `-1` \~ `2^32-1` 사이의 정수

  <Note>
    * 동일한 요청에서 모델이 다른 seed 값을 받으면(예: seed를 지정하지 않거나 seed를 -1로 설정하면 난수가 사용됨) 다른 결과가 생성됩니다
    * 동일한 요청에서 모델이 동일한 seed 값을 받으면 유사한 결과가 생성되지만, 완전히 동일하다는 것은 보장되지 않습니다
  </Note>
</ParamField>

## 해상도 및 종횡비 조합

| 해상도   | 지원되는 종횡비                        | 비고    |
| ----- | ------------------------------- | ----- |
| 480p  | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | 모두 지원 |
| 720p  | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | 모두 지원 |
| 1080p | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | 모두 지원 |

<ParamField body="image_with_roles" type="array">
  더 세밀한 제어를 위한 역할이 있는 이미지 배열

  <Expandable title="필드 설명">
    <ParamField body="url" type="string" required>
      이미지 URL 주소
    </ParamField>

    <ParamField body="role" type="string" required>
      이미지 역할

      옵션:

      * `first_frame` - 첫 프레임 이미지, 비디오 시작 프레임으로 (1장만 지원)
      * `last_frame` - 마지막 프레임 이미지, 비디오 종료 프레임으로 (quality 버전만 지원, 1장만 지원)
    </ParamField>
  </Expandable>

  예:

  ```json theme={null}
  [
    {"url": "https://example.com/start.png", "role": "first_frame"},
    {"url": "https://example.com/end.png", "role": "last_frame"}
  ]
  ```

  <Warning>
    * 각 역할의 이미지는 1장만 지원
    * `last_frame`(마지막 프레임 이미지)은 `doubao-seedance-1-0-pro-quality` 버전만 지원하며, fast 버전은 첫 프레임과 마지막 프레임을 함께 사용할 수 없습니다
  </Warning>
</ParamField>

## 응답

<ResponseField name="code" type="integer">
  응답 상태 코드, 성공 시 200
</ResponseField>

<ResponseField name="data" type="array">
  응답 데이터 배열

  <Expandable title="배열 요소">
    <ResponseField name="status" type="string">
      작업 상태, 초기 제출 시 `submitted`
    </ResponseField>

    <ResponseField name="task_id" type="string">
      작업 상태 및 결과를 쿼리하기 위한 고유 작업 식별자
    </ResponseField>
  </Expandable>
</ResponseField>

## 사용 시나리오

### 시나리오 1: 가로 미리보기 비디오 빠른 생성

```json theme={null}
{
  "model": "doubao-seedance-1-0-pro-fast",
  "prompt": "해변의 일몰, 바다 위의 황금빛 햇살, 모래사장을 부드럽게 치는 파도"
}
```

### 시나리오 2: 고품질 세로 짧은 비디오

```json theme={null}
{
  "model": "doubao-seedance-1-0-pro-quality",
  "prompt": "벚꽃 나무 아래에서 돌아가는 소녀, 바람에 날리는 꽃잎",
  "duration": 5,
  "aspect_ratio": "9:16",
  "resolution": "1080p"
}
```

### 시나리오 3: 동적 전환 효과 (첫/마지막 프레임)

```json theme={null}
{
  "model": "doubao-seedance-1-0-pro-quality",
  "prompt": "장면이 낮에서 밤으로 전환, 도시 불빛이 점차 켜짐",
  "image_with_roles": [
    {"url": "https://example.com/day.png", "role": "first_frame"},
    {"url": "https://example.com/night.png", "role": "last_frame"}
  ],
  "duration": 5
}
```

<Note>
  **작업 결과 쿼리**

  비디오 생성은 비동기 작업으로 제출 시 `task_id`가 반환됩니다. [작업 상태 가져오기](/ko/api-reference/tasks/status) 엔드포인트를 사용하여 생성 진행 상황과 결과를 쿼리하세요.
</Note>
