MAGI-2 동영상 API
텍스트, 처음과 마지막 프레임 또는 멀티미디어 참조로 1080p 동영상을 생성합니다. 오디오는 기본으로 켜집니다.
MAGI-2 동영상 API
텍스트, 처음과 마지막 프레임 또는 멀티미디어 참조로 1080p 동영상을 생성합니다. 오디오는 기본으로 켜집니다.
요청 및 다운로드
콘솔에서 API 키를 발급합니다. Bearer 인증으로 JSON을 제출하고 작업 ID를 저장하세요. 같은 작업을 성공 또는 실패할 때까지 조회하고 같은 키로 MP4를 다운로드합니다. 조회 시간 초과로 작업이 중단되지는 않습니다.
curl --fail-with-body "https://apimaster.ai/v1/videos/generations" \
-H "Authorization: Bearer $APIMASTER_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: magi2-cup-001" \
-d '{"model":"magi-2","prompt":"A slow camera move toward a ceramic cup in soft daylight.","duration":5,"aspect_ratio":"16:9"}'
{"id":"task_…","task_id":"task_…","object":"video","model":"magi-2","status":"queued"}
TASK_ID="task_..."
curl --fail-with-body "https://apimaster.ai/v1/videos/$TASK_ID" \
-H "Authorization: Bearer $APIMASTER_API_KEY"
curl --fail-with-body --location "https://apimaster.ai/v1/videos/$TASK_ID/content" \
-H "Authorization: Bearer $APIMASTER_API_KEY" -o magi-2.mp4
queued → in_progress → completed / failed
생성 모드
텍스트로 동영상 생성
{"model":"magi-2","prompt":"A blue cup on a table. Slow camera push in with quiet room tone.","duration":4,"generate_audio":true}
첫 프레임과 마지막 프레임
{"model":"magi-2","prompt":"Move from the first composition to the final composition.","first_frame_image":"https://example.com/start.jpg","last_frame_image":"https://example.com/end.jpg","aspect_ratio":"auto","generate_audio":false}
멀티모달 참조
{
"model": "magi-2",
"prompt": "Use the image for appearance, the clip for camera movement and the audio for mood.",
"duration": 6,
"omni_reference_task_type": "reference",
"image_with_roles": [{"url": "https://example.com/object.jpg", "role": "reference_image"}],
"video_urls": ["https://example.com/camera.mp4"],
"audio_urls": ["https://example.com/room-tone.mp3"]
}
인증 없이 바로 내려받을 수 있는 공개 HTTP(S) URL을 사용하세요. 참조 자료는 생성에 영향을 줍니다. 편집, 연장, 중간 키프레임은 지원하지 않습니다.
매개변수
| 필드 | 타입 | 규칙 |
|---|---|---|
model |
string |
magi-2 |
prompt |
string |
모든 모드에서 필수입니다. 최대 15,000자입니다. |
duration / seconds |
integer |
4~30 사이의 정수 초이며 기본값은 5입니다. 두 필드를 함께 주면 값이 같아야 합니다. |
resolution |
string |
1080p만 지원합니다. 생략할 수 있습니다. |
aspect_ratio |
string |
텍스트와 참조 모드는 기본값 16:9와 함께 9:16, 1:1, 4:3, 3:4, 21:9를 지원합니다. 프레임 모드는 생략하거나 auto로 첫 프레임 비율을 따릅니다. 이 모드에서 21:9는 지원하지 않습니다. |
generate_audio / audio |
boolean |
오디오는 기본 활성화 상태입니다. 두 필드를 함께 주면 값이 같아야 합니다. 참조 오디오는 audio_urls를 사용하세요. |
nsfw_check |
boolean |
제출 전 프롬프트와 입력 이미지를 선택적으로 검토합니다. 기본값은 false입니다. |
seed |
integer |
생략하거나 -1이면 무작위입니다. 0~2147483647 사이의 고정값도 동일한 결과를 보장하지는 않습니다. |
omni_reference_task_type |
string |
auto 또는 reference를 사용합니다. 동영상, 오디오 또는 reference_image 역할이 참조 모드를 활성화합니다. image_urls만 참조로 쓸 때는 reference를 명시하세요. |
image_urls |
string[] |
프레임 모드에서 1~2장입니다. 참조 모드에서는 reference_image 역할과 합쳐 최대 10장입니다. |
first_frame_image / last_frame_image |
string |
image_urls와 함께 사용할 수 없습니다. 마지막 프레임에는 첫 프레임이 필요합니다. |
image_with_roles |
object[] |
각 항목에 url과 role을 지정합니다. first_frame, last_frame, reference_image 중 하나를 선택하세요. |
video_urls / audio_urls |
string[] |
동영상과 오디오는 종류마다 최대 5개입니다. 각 클립은 2~30초, 종류마다 합계는 최대 30초입니다. |
요금 및 오류
Sand AI 기본 요금은 요청 출력 1초당 0.08달러입니다. 5초는 0.40달러입니다. 오디오, 참조 자료, 화면 비율은 기본 단가에 영향을 주지 않습니다. 거절되거나 실패한 요청은 과금되지 않습니다. message / error.message를 확인하세요. 제출이 시간 초과되면 동일한 Idempotency-Key와 본문을 재사용하세요.
