curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-5-flash",
"prompt": "A cinematic shot of a fox walking through a sunlit forest, with a slow tracking camera",
"resolution": "720p",
"size": "16:9",
"duration": 8,
"generate_audio": true,
"nsfw_check": true,
"return_last_frame": true
}'
import requests
payload = {
"model": "seedance-2-5-flash",
"prompt": "A cinematic shot of a fox walking through a sunlit forest, with a slow tracking camera",
"resolution": "720p",
"size": "16:9",
"duration": 8,
"generate_audio": True,
"nsfw_check": True,
"return_last_frame": True
}
response = requests.post(
"https://api.apimart.ai/v1/videos/generations",
headers={"Authorization": "Bearer <token>"},
json=payload,
timeout=60,
)
response.raise_for_status()
print(response.json())
const payload = {
"model": "seedance-2-5-flash",
"prompt": "A cinematic shot of a fox walking through a sunlit forest, with a slow tracking camera",
"resolution": "720p",
"size": "16:9",
"duration": 8,
"generate_audio": true,
"nsfw_check": true,
"return_last_frame": true
};
const response = await fetch("https://api.apimart.ai/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_example_seedance25flash"
}
]
}
seedance-2-5-flash
Seedance 2.5 Flash 동영상 생성
텍스트, 멀티모달 참조, 편집, 연장, 시작·끝 프레임으로 최대 30초의 480p / 720p 동영상을 생성합니다.
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-5-flash",
"prompt": "A cinematic shot of a fox walking through a sunlit forest, with a slow tracking camera",
"resolution": "720p",
"size": "16:9",
"duration": 8,
"generate_audio": true,
"nsfw_check": true,
"return_last_frame": true
}'
import requests
payload = {
"model": "seedance-2-5-flash",
"prompt": "A cinematic shot of a fox walking through a sunlit forest, with a slow tracking camera",
"resolution": "720p",
"size": "16:9",
"duration": 8,
"generate_audio": True,
"nsfw_check": True,
"return_last_frame": True
}
response = requests.post(
"https://api.apimart.ai/v1/videos/generations",
headers={"Authorization": "Bearer <token>"},
json=payload,
timeout=60,
)
response.raise_for_status()
print(response.json())
const payload = {
"model": "seedance-2-5-flash",
"prompt": "A cinematic shot of a fox walking through a sunlit forest, with a slow tracking camera",
"resolution": "720p",
"size": "16:9",
"duration": 8,
"generate_audio": true,
"nsfw_check": true,
"return_last_frame": true
};
const response = await fetch("https://api.apimart.ai/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_example_seedance25flash"
}
]
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-5-flash",
"prompt": "A cinematic shot of a fox walking through a sunlit forest, with a slow tracking camera",
"resolution": "720p",
"size": "16:9",
"duration": 8,
"generate_audio": true,
"nsfw_check": true,
"return_last_frame": true
}'
import requests
payload = {
"model": "seedance-2-5-flash",
"prompt": "A cinematic shot of a fox walking through a sunlit forest, with a slow tracking camera",
"resolution": "720p",
"size": "16:9",
"duration": 8,
"generate_audio": True,
"nsfw_check": True,
"return_last_frame": True
}
response = requests.post(
"https://api.apimart.ai/v1/videos/generations",
headers={"Authorization": "Bearer <token>"},
json=payload,
timeout=60,
)
response.raise_for_status()
print(response.json())
const payload = {
"model": "seedance-2-5-flash",
"prompt": "A cinematic shot of a fox walking through a sunlit forest, with a slow tracking camera",
"resolution": "720p",
"size": "16:9",
"duration": 8,
"generate_audio": true,
"nsfw_check": true,
"return_last_frame": true
};
const response = await fetch("https://api.apimart.ai/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_example_seedance25flash"
}
]
}
POST /v1/videos/generations로 제출하고 data[0].task_id를 받은 뒤 GET /v1/tasks/{task_id}로 조회합니다.
요청 매개변수
seedance-2-5-flash를 사용합니다. doubao-seedance-2-5-flash도 허용합니다. 점이 포함된 seedance-2.5-flash는 지원하지 않습니다.비디오 작업을 제출하기 전에 콘텐츠 검토를 실행할지 여부를 지정합니다.
true:omni-moderation-latest로 프롬프트와 입력 이미지를 검토false또는 생략: 검토 요청을 보내지 않으며 검토 비용이나 지연이 추가되지 않음(기본값)
nsfw_content_detected)을 반환하며 작업을 생성하거나 생성 요금을 부과하지 않습니다. 참조 동영상·오디오는 검토하지 않습니다. 검토 서비스 오류 시 요청이 계속 진행될 수 있습니다.16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive(기본값)를 지원합니다. 별칭은 aspect_ratio입니다. 시작·끝 프레임, 편집, 연장 작업은 adaptive만 가능합니다.정수 초
4–30; 일반 요청에서 생략하면 5, -1은 자동입니다. 명시적 edit는 -1 또는 생략만 허용하며, 생략 시 -1로 처리하고 원본 길이를 따릅니다. 자동 길이는 30초분을 선차감한 후 실제 토큰 사용량으로 정산합니다.auto(기본값), reference, edit, extend를 지원하며 참조 소재가 있는 작업에만 사용합니다. 유형을 명시하면 제출 시 아래 제한을 검사합니다.모두
reference_image로 처리하는 참조 이미지 배열입니다. image_with_roles와 합쳐 최대 10장입니다. 시작·끝 프레임은 image_with_roles를 사용하세요.각 항목에
url과 role이 필요합니다. 역할은 reference_image, first_frame(최대 1장), last_frame(최대 1장, 시작 프레임과 함께)입니다. image_urls와 합쳐 최대 10장이며 충돌하는 역할을 혼합하지 마세요. video_urls / audio_urls가 있으면 시작·끝 프레임은 멀티모달 참조 이미지로 처리됩니다.draft / draft_task_id는 지원하지 않으므로 요청에서 제거하세요. 포함하면 제출 시 HTTP 400을 반환합니다. 초안 기능은 Seedance 2.5를 사용하세요.소재 요구 사항
공개 접근 가능한http(s) URL 또는 승인된 asset:// ID를 사용합니다. 출력 해상도와 입력 동영상 픽셀 제한은 별도로 검사합니다.
| 소재 | 제한 |
|---|---|
| 이미지 | 두 이미지 필드 합계 ≤10장; JPEG / PNG / WebP / BMP / TIFF / GIF / HEIC / HEIF; 너비·높이 각각 300–6000 px; 비율 0.4–2.5; 각 <30 MB. |
| 동영상 | ≤5개; MP4 / MOV, 영상 H.264 / H.265, 오디오 AAC / MP3; 각 2–30초, 합계 ≤30초; 각 ≤200 MB; 너비·높이 각각 300–6000 px, 비율 0.4–2.5, 너비 × 높이 409,600–8,295,044픽셀, 24–60 FPS. |
| 오디오 | ≤5개; WAV / MP3; 각 2–30초, 합계 ≤30초; 각 ≤15 MB. |
작업 유형과 제한
| 모드 | 사용법과 제한 |
|---|---|
| 텍스트 → 동영상 | prompt를 제공하고 참조 소재와 omni_reference_task_type은 생략합니다. |
| 참조 → 동영상 | 참조 소재를 제공하며 reference는 선택 사항입니다. 일반 길이·비율 제한이 적용됩니다. |
| 시작·끝 프레임 | image_with_roles를 사용하며 size / aspect_ratio는 adaptive여야 합니다. |
| 동영상 편집 | edit; 4–30초 원본 동영상이 1개 이상 필요합니다. 비율은 adaptive, duration은 -1 또는 생략입니다. |
| 동영상 연장 | extend; 참조 동영상 1개 이상, 비율은 adaptive여야 합니다. |
auto는 소재와 프롬프트로 유형을 판단하므로 생성 중에 제한 위반으로 실패할 수 있습니다. 명시적 유형도 프롬프트 의도와 다르면 InvalidParameter.TaskTypeMismatch가 발생할 수 있습니다.
요청 예제
멀티모달 참조
{
"model": "seedance-2-5-flash",
"prompt": "Use the composition of @视频1, the subject in @图片1, and @音频1 as background music",
"image_urls": [
"https://example.com/reference.jpg"
],
"video_urls": [
"https://example.com/reference_8s.mp4"
],
"audio_urls": [
"https://example.com/music_5s.mp3"
],
"omni_reference_task_type": "reference",
"duration": 8,
"size": "16:9"
}
시작·끝 프레임
{
"model": "seedance-2-5-flash",
"prompt": "Smoothly transition from the first frame to the last frame",
"image_with_roles": [
{
"url": "https://example.com/first.jpg",
"role": "first_frame"
},
{
"url": "https://example.com/last.jpg",
"role": "last_frame"
}
],
"size": "adaptive",
"duration": 5
}
동영상 편집
{
"model": "seedance-2-5-flash",
"prompt": "Edit @视频1: replace the cloudy sky with a clear sunset while preserving the camera movement",
"video_urls": [
"https://example.com/source_10s.mp4"
],
"omni_reference_task_type": "edit",
"size": "adaptive",
"duration": -1,
"output_format": "mov"
}
동영상 연장
{
"model": "seedance-2-5-flash",
"prompt": "Extend @视频1 forward: continue the camera movement as the subject walks into the forest",
"video_urls": [
"https://example.com/source_10s.mp4"
],
"omni_reference_task_type": "extend",
"size": "adaptive",
"duration": 5
}
비공개 소재 사용
실제 사람의 얼굴이 있는 이미지·동영상은 소재 라이브러리 승인 후asset://로 사용하세요. 업로드 model도 seedance-2-5-flash로 설정합니다. 소재 라이브러리 API를 참고하고 아래 Flash 모델명을 사용하세요.
curl --request POST \
--url https://api.apimart.ai/v1/seedance2/private-avatar/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-5-flash",
"group": {
"name": "flash-assets"
},
"asset_type": "Image",
"assets": [
{
"url": "https://example.com/reference.jpg",
"name": "reference"
}
]
}'
asset:// ID를 받아 image_urls, image_with_roles[].url, video_urls, audio_urls에 사용합니다.
작업 상태와 결과
작업 조회 API를 폴링합니다.pending / processing은 진행 중, completed는 성공, failed는 실패입니다. data.result.videos[0].url[0]을 읽으세요. url은 배열입니다.
curl --request GET \
--url 'https://api.apimart.ai/v1/tasks/task_example_seedance25flash' \
--header 'Authorization: Bearer <token>'
{
"code": 200,
"data": {
"id": "task_example_seedance25flash",
"status": "completed",
"progress": 100,
"cost": 0.3104,
"credits_cost": 3.104,
"usage": {
"completion_tokens": 38800
},
"result": {
"videos": [
{
"url": [
"https://example.com/generated-video.mp4"
],
"last_frame_url": "https://example.com/generated-last-frame.png"
}
]
}
}
}
| 필드 | 의미 |
|---|---|
data.usage.completion_tokens | 최종 정산 토큰 수. 완료 직후 몇 초 동안 없을 수 있으므로 다시 조회하세요. |
data.cost | 계정 할인이 적용된 실제 청구액(USD). 반환값을 기준으로 합니다. |
data.credits_cost | 실제 차감된 크레딧. |
data.result.videos[].url | 동영상 URL 배열. 즉시 다운로드하여 저장하세요. |
data.result.videos[].last_frame_url | return_last_frame: true로 요청하고 성공한 경우의 끝 프레임 URL. |
data.error.message | 실패 이유. 실패 시 data.cost는 0이며 선차감액은 환불됩니다. |
요금 계산
- 제출 시 해상도별 초당 단가로 선차감합니다. 참조 동영상이 있으면 입력 포함 요금 구간을 사용하며 출력 길이와 참조 동영상 총길이를 합산합니다.
- 일반 요청의
duration생략은 출력 5초,duration: -1또는edit의 길이 생략은 출력 30초를 기준으로 선차감합니다. - 성공 후
data.usage.completion_tokens÷ 1,000,000 × 해당 100만 토큰당 단가에 계정 할인을 적용하여 차액을 환불하거나 추가 차감합니다. 참조 동영상 유무에 따라token/token-input구간을 사용합니다. 최종 금액은data.cost입니다. - 제출 거절 시 생성 요금은 없고, 생성 실패 시 선차감액을 환불합니다. 단가와 할인은 가격 페이지를 확인하세요.
일반적인 오류
| 상황 | 조치 |
|---|---|
| HTTP 400: 미지원 해상도 | 480p / 720p만 사용하고 1080p는 사용하지 마세요. |
| HTTP 400: 소재 수 초과 | 이미지 합계 10장, 동영상 5개, 오디오 5개 이내로 줄이고 길이도 확인하세요. |
| HTTP 400: 초안 미지원 | draft / draft_task_id를 제거합니다. |
| HTTP 400: 유형·길이·비율 오류 | omni_reference_task_type, duration, size / aspect_ratio의 조합을 확인하세요. |
HTTP 400: nsfw_content_detected | 검토 거절로 처리하고 error.message에 따라 내용을 수정하세요. |
| 모델을 찾을 수 없음 | seedance-2.5-flash가 아닌 seedance-2-5-flash를 사용하세요. |
작업 failed | data.error.message를 확인하고 소재·프롬프트를 작업 유형에 맞추세요. 선차감액은 환불됩니다. |