curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "Omni-Flash-Ext",
prompt: "a girl is dancing happily in a sunny garden",
duration: 10,
resolution: "1080p",
aspect_ratio: "9:16"
};
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));
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": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16",
}
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))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KS1H7ZYSJWH1N779S2FSHTKA"
}
]
}
{
"error": {
"code": 400,
"message": "요청 파라미터가 올바르지 않습니다",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "인증에 실패했습니다. API 키를 확인하세요",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "계정 잔액이 부족합니다. 충전 후 다시 시도하세요",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "요청이 너무 많습니다. 잠시 후 다시 시도하세요",
"type": "rate_limit_error"
}
}
Omni-Flash-Ext
Omni-Flash-Ext 비디오 생성
- Omni-Flash-Ext 통합 비디오 생성 모델
- 텍스트-비디오, 단일 이미지-비디오, 참조 비디오, 3장 참조 이미지 융합 지원
- 720p/1080p/4k 해상도와 4/6/8/10초 길이 지원
- 비동기 작업 API. 작업을 제출한 뒤 작업 ID로 결과를 조회합니다
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": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "Omni-Flash-Ext",
prompt: "a girl is dancing happily in a sunny garden",
duration: 10,
resolution: "1080p",
aspect_ratio: "9:16"
};
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));
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": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16",
}
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))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KS1H7ZYSJWH1N779S2FSHTKA"
}
]
}
{
"error": {
"code": 400,
"message": "요청 파라미터가 올바르지 않습니다",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "인증에 실패했습니다. API 키를 확인하세요",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "계정 잔액이 부족합니다. 충전 후 다시 시도하세요",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "요청이 너무 많습니다. 잠시 후 다시 시도하세요",
"type": "rate_limit_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "Omni-Flash-Ext",
prompt: "a girl is dancing happily in a sunny garden",
duration: 10,
resolution: "1080p",
aspect_ratio: "9:16"
};
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));
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": "Omni-Flash-Ext",
"prompt": "a girl is dancing happily in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16",
}
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))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KS1H7ZYSJWH1N779S2FSHTKA"
}
]
}
{
"error": {
"code": 400,
"message": "요청 파라미터가 올바르지 않습니다",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "인증에 실패했습니다. API 키를 확인하세요",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "계정 잔액이 부족합니다. 충전 후 다시 시도하세요",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "요청이 너무 많습니다. 잠시 후 다시 시도하세요",
"type": "rate_limit_error"
}
}
인증
string
필수
모든 요청은 Bearer Token 인증이 필요합니다.API Key 발급:API Key 관리 페이지에서 API Key를 발급받으세요.요청 시 다음 헤더를 추가합니다:
Authorization: Bearer YOUR_API_KEY
요청 파라미터
string
필수
비디오 생성 모델 이름입니다.
Omni-Flash-Ext로 고정됩니다.string
필수
비디오 내용 설명입니다. 장면, 인물, 동작, 환경, 카메라 움직임, 화면 스타일, 오디오 힌트를 자세히 작성하는 것을 권장합니다.예:
"a girl is dancing happily in a sunny garden"integer
기본값:"6"
비디오 길이입니다. 단위는 초입니다.지원 값:
4, 6, 8, 10.5, 7 등 다른 값을 전달하면 invalid_duration 오류가 반환됩니다.참조 비디오를 업로드할 때는
duration을 전달할 필요가 없습니다. duration과 video_urls는 동시에 전달할 수 없습니다.string
기본값:"720p"
비디오 해상도입니다. 대소문자를 구분하지 않습니다.지원 값:
720p1080p4k
다른 해상도를 전달하면
invalid_resolution 오류가 반환됩니다.string
기본값:"16:9"
비디오 화면 비율입니다. 가로 또는 세로 출력을 제어합니다.자주 사용하는 값:
16:9- 가로9:16- 세로
16:9string
호환 필드입니다.
aspect_ratio와 같은 의미입니다. 둘 다 전달하는 경우 같은 값으로 유지하는 것을 권장합니다.string
생성 유형으로, 이미지의 사용 방식을 지정합니다.가능한 값:
frame- 시작 프레임 모드.image_urls에는 이미지 1장만 업로드할 수 있으며, 비디오의 시작 프레임으로 사용됩니다.reference- 참조 모드.image_urls에는 이미지 1장 또는 3장을 업로드할 수 있으며, 참조 이미지로 사용됩니다.
generation_type이 frame인 경우 image_urls는 1장만 지원하며, 다른 개수를 전달하면 unsupported_image_count 오류가 반환됩니다.array<url>
참조 이미지 URL 배열입니다.
generation_type에 따라 생략하거나, 1장 또는 3장을 전달할 수 있습니다:- 생략 또는 빈 배열: 텍스트-비디오
- 1장: 단일 이미지-비디오
- 3장: 참조 이미지 융합(
generation_type이reference일 때만 지원)
generation_type과의 관계:generation_type이frame: 이미지 1장만 업로드할 수 있습니다.generation_type이reference: 이미지 1장 또는 3장을 업로드할 수 있습니다.
2장 이미지로 시작 프레임 + 끝 프레임을 지정하는 모드는 지원하지 않습니다. 2장을 전달하면
unsupported_image_count 오류가 반환됩니다. 4장 이상은 충분히 검증되지 않았으므로 권장하지 않습니다.array<url>
참조 비디오 URL 배열입니다. 생략하거나 참조 비디오 1개를 전달할 수 있습니다.공개적으로 접근 가능한 HTTP/HTTPS 비디오 URL만 지원합니다.
image_urls와 함께 전달할 수 있으며, 이미지는 인물 또는 구도 참조로, 비디오는 움직임 참조로 사용됩니다.Omni-Flash-Ext는 참조 비디오를 0개 또는 1개만 지원합니다. 2개 이상 전달하면 unsupported_video_count 오류가 반환됩니다.video_urls를 전달할 때는 duration을 전달할 필요가 없습니다. video_urls와 duration은 동시에 전달할 수 없습니다.응답
integer
응답 상태 코드입니다. 성공 시
200입니다.array
작업 결과 조회
비디오 생성은 비동기 작업입니다. 제출 후task_id가 반환됩니다. 작업 상태 조회 API로 진행 상황과 결과를 조회하세요.
cURL
curl --request GET \
--url https://api.apimart.ai/v1/tasks/task_01KS1H7ZYSJWH1N779S2FSHTKA \
--header 'Authorization: Bearer <token>'
성공 결과 예시
{
"code": 200,
"data": {
"id": "task_01KS1H7ZYSJWH1N779S2FSHTKA",
"status": "completed",
"progress": 100,
"created": 1779246294,
"completed": 1779246534,
"actual_time": 240,
"estimated_time": 600,
"cost": 0.4,
"credits_cost": 4,
"result": {
"videos": [
{
"url": ["https://cdn.example.com/videos/abc.mp4"],
"expires_at": 1779332760
}
]
}
}
}
실패 결과 예시
{
"code": 200,
"data": {
"id": "task_01KS1H7ZYSJWH1N779S2FSHTKA",
"status": "failed",
"progress": 100,
"created": 1779246294,
"completed": 1779246534,
"actual_time": 240,
"estimated_time": 600,
"cost": 0,
"credits_cost": 0,
"error": {
"message": "invalid duration 7, must be one of 4/6/8/10",
"code": "task_failed"
}
}
}
사용 사례
시나리오 1: 텍스트-비디오
{
"model": "Omni-Flash-Ext",
"prompt": "a beautiful sunset over the ocean with seagulls flying",
"duration": 6,
"resolution": "720p",
"aspect_ratio": "16:9"
}
시나리오 2: 단일 이미지-비디오
{
"model": "Omni-Flash-Ext",
"prompt": "make the character smile and slowly turn around, cinematic camera motion",
"duration": 6,
"resolution": "1080p",
"aspect_ratio": "9:16",
"image_urls": ["https://example.com/character.jpg"]
}
시나리오 3: 3장 참조 이미지 융합
{
"model": "Omni-Flash-Ext",
"prompt": "a creative scene combining these elements with smooth camera motion",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "9:16",
"image_urls": [
"https://example.com/scene.jpg",
"https://example.com/character.jpg",
"https://example.com/product.jpg"
]
}
시나리오 4: 4K 짧은 비디오
{
"model": "Omni-Flash-Ext",
"prompt": "close-up of a hummingbird hovering in front of a red flower",
"duration": 4,
"resolution": "4k",
"aspect_ratio": "16:9"
}
시나리오 5: 참조 비디오 생성
{
"model": "Omni-Flash-Ext",
"prompt": "the same scene but at night with neon lights",
"resolution": "720p",
"aspect_ratio": "16:9",
"video_urls": ["https://example.com/reference.mp4"]
}
오류 코드
| HTTP | 오류 유형 | 의미 | 해결 방법 |
|---|---|---|---|
| 400 | invalid_request_error | model이 Omni-Flash-Ext가 아니거나, prompt가 비어 있거나, JSON 형식이 올바르지 않습니다 | 요청 본문을 확인하세요 |
| 400 | invalid_duration | duration이 4, 6, 8, 10 중 하나가 아닙니다 | 지원되는 길이로 변경하세요 |
| 400 | invalid_resolution | resolution이 720p, 1080p, 4k 중 하나가 아닙니다 | 지원되는 해상도로 변경하세요 |
| 400 | unsupported_image_count | image_urls 개수가 지원되지 않습니다. 2장을 전달할 때 자주 발생합니다 | 0장, 1장 또는 3장으로 변경하세요 |
| 400 | unsupported_video_count | video_urls 개수가 지원되지 않습니다. 2개 이상 전달할 때 자주 발생합니다 | 참조 비디오를 0개 또는 1개로 변경하세요 |
| 401 | authentication_error | Token이 유효하지 않습니다 | Bearer Token을 확인하세요 |
| 402 | payment_required | 잔액이 부족합니다 | 충전 후 다시 시도하세요 |
| 429 | rate_limit_error | 요청 제한에 도달했습니다 | 동시 요청 수를 낮추거나 나중에 다시 시도하세요 |
data.error에 실패 사유를 반환합니다. 일반적인 원인은 업스트림 할당량 일시 부족, 콘텐츠 심사 실패, 업스트림 타임아웃입니다.⌘I