https://dramamaster.ai/api/developer/v1GET /models가 반환하는 제품 ID를 사용하세요. model 필드는 ponys-generation-image와 같은 안정적인 제품 ID를 받습니다.
OpenAPI 명세인증
기본 URL: https://dramamaster.ai/api/developer/v1. 모든 개방형 API 엔드Tokens는 API 키를 사용합니다: 인증: Bearer dm_live_xxx 또는 dm_test_xxx.
응답 및 청구
API와 웹사이트는 Ponys Tokens를 공유합니다. 테스트 키로 생성해도 요금이 부과됩니다.
- 개요, 대본, 스토리보드, 에피소드 내보내기는 각각 4 Tokens입니다.
- 이미지와 영상 요금은 모델과 설정에 따라 달라집니다. 전송 전에 모델 목록을 확인하세요. 모델 목록
- 오디오, 사진 얼굴 교체, 영상 인물 교체는 견적을 먼저 승인해야 합니다. Preview and lock Tokens
숏드라마
대본 → 스토리보드 → 이미지 → 영상 → 내보내기. DramaMaster가 직접 생성하며 같은 사양에는 Ponys와 같은 가격을 적용합니다.
계정 연결
개발자 센터에서 키를 만들고 서버에 보관하세요. Authorization 헤더로 전송합니다.
대본 제출
붙여넣은 대본의 00:00–00:10은 10초 용량 상한을 뜻합니다. 내용이 짧으면 실제 길이를 유지합니다. 목표 길이는 제작 설정에서 별도로 선택하세요.
생성 결과 확인
진행 상황은 최소 10초 간격으로 조회하세요. 이전 단계 완료 후 다음 단계를 제출하세요.
curl https://dramamaster.ai/api/developer/v1/dramas \
-H "Authorization: Bearer $DRAMAMASTER_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept-Language: en-US" \
-H "Idempotency-Key: episode-001" \
-d '{"script":"00:00–00:10\nA woman opens a letter.\nShe looks toward the door."}'제작 과정 엔드Tokens
- POST
/dramas - 대본을 스토리보드로 만들고 에셋과 샷을 생성한 후 에피소드를 내보냅니다.
- POST
/dramas/ideas - 아이디어로 단편 만들기
- PATCH
/dramas/{drama_id}/review - 첫 장면 승인
- GET
/dramas/{drama_id} - 드라마 조회
- POST
/dramas/{drama_id}/assets - 에셋 생성
- POST
/dramas/{drama_id}/images - 이미지 생성
- POST
/dramas/{drama_id}/videos - 동영상 생성
- POST
/dramas/{drama_id}/export - 에피소드 내보내기
- POST
/dramas/{drama_id}/run - 백그라운드 제작
- GET
/dramas/{drama_id}/run - 백그라운드 제작 상태 조회
- POST
/generation/images - 텍스트 또는 참조 이미지로 이미지를 생성합니다.
- POST
/generation/videos - 텍스트, 첫 프레임 또는 참조 미디어로 동영상을 생성합니다.
- GET
/tasks/{task_id} - 작업 조회
아이디어로 단편 만들기
한 편의 이야기를 짧게 적으세요. DM이 스토리보드 작업을 시작하고 소재 이미지나 검토가 필요하면 멈춥니다.
POST /api/developer/v1/dramas/ideas
Idempotency-Key: idea-001
{"idea":"Two strangers find the same letter.",
"duration_seconds":15,"aspect_ratio":"9:16","style":"realistic"}
→ data.drama_id, data.task_id, data.run_id
GET /api/developer/v1/dramas/{drama_id}/run길이는 10, 15, 20, 30초 중 선택할 수 있습니다. 화면은 세로, 가로, 정사각형, 스타일은 실사 또는 애니메이션을 선택하세요. reference_image_urls에는 /files로 이 작업 공간에 올린 이미지를 최대 5장 지정할 수 있습니다.
이미지 및 영상 예제
POST /api/developer/v1/generation/images
{"prompt":"A sealed letter on a table","aspect_ratio":"9:16","image_resolution":"1K"}
POST /api/developer/v1/generation/videos
{"motion_instruction":"The letter slowly opens","aspect_ratio":"9:16","duration_seconds":5,"resolution":"1080P"}
POST /api/developer/v1/generation/videos
{
"model": "Video-Generation-2.0",
"motion_instruction": "The letter opens",
"duration_seconds": 5,
"resolution": "720P"
}
POST /api/developer/v1/generation/videos
{
"model": "2.0-flash",
"motion_instruction": "The letter opens",
"duration_seconds": 5,
"resolution": "720P"
}
POST /api/developer/v1/dramas/{drama_id}/assets
{}
HTTP 200 · /generation/images · /generation/videos
{"code":200,"message":"ok","data":{"task_id":"..."}}
HTTP 200 · /dramas/{drama_id}/assets
{"code":200,"message":"ok","data":{"drama_id":1,"tasks":[{"task_id":"...","points_cost":3}]}}빠른 시작은 /generation/images와 /generation/videos를 사용합니다. 아래 호환 경로는 각기 다른 매개변수를 사용합니다.
이미지: 1K 또는 2K, 참조 이미지 최대 10개, 작업당 이미지 한 장.
비디오: 정수 초, 텍스트 2–15초, 이미지/참조 2–30초. 480P, 720P, 1080P(텍스트는 720P, 1080P). 참조 비디오 합계 최대 15초, 입력과 출력 합계 최대 30초.
model에 Video-Generation-2.0 또는 2.0-flash를 지정하세요. 생략하면 기본 영상 모델을 사용합니다. 사용 가능한 모델은 GET /models에서 확인하세요.
백그라운드 제작
지출 한도 설정 없이 시작하거나 재개할 수 있습니다. 페이지를 닫아도 접수된 작업은 유지됩니다. 중지하면 다음 단계가 제출되지 않으며 실패하거나 결과가 불확실하면 원래 작업을 보존합니다.
POST /api/developer/v1/dramas/{drama_id}/run
{"action":"start"}
GET /api/developer/v1/dramas/{drama_id}/run
POST /api/developer/v1/dramas/{drama_id}/run
{"action":"stop"}
POST /api/developer/v1/dramas/{drama_id}/run
{"action":"resume","expected_run_id":"RUN_ID"}
GET /api/developer/v1/dramas/{drama_id}
→ data.production.review, data.result_url
PATCH /api/developer/v1/dramas/{drama_id}/review
{"expected_revision":12,"shot_id":42,"signature":"MEDIA_SIGNATURE","status":"approved"}운영 전 확인 사항
- partial: true가 반환되면 멈추고 작업 ID를 확인하세요. 아직 필요한 작업만 제출하세요.
- 응답을 잃은 경우 같은 Idempotency-Key와 같은 본문으로 다시 요청하세요. 본문을 바꾸면 409를 반환합니다.
- 단계마다 사용 가능한 동시 실행 슬롯만 제출합니다. 완료 후 새 키로 다음 묶음을 제출하여 next_stage가 진행되는지 확인하세요. partial은 수락된 작업을 표시합니다.
- 400: 모델, 참조 또는 가격 검증 실패; 401: 잘못된 키; 402: Tokens 부족; 409: 전제 조건 또는 충돌; 422: 잘못된 옵션; 429: 제한; 503: 서비스 또는 스크립트 가격 미설정.
- 비공개 링크는 만료됩니다. 작업을 다시 조회하면 새 링크를 받습니다.
- Python 클라이언트로 같은 단계를 자동 실행할 수 있습니다. 고정 run ID로 재개하며 결과가 불확실한 생성 요청은 자동 재전송하지 않습니다.
- DramaMaster와 Ponys는 같은 Tokens 지갑을 사용합니다. 이미지와 영상 가격은 선택한 설정에 따라 Ponys에서 조회합니다. Test keys use the same billing rules.
세대
다음 엔드Tokens는 GET /models의 제품 ID를 받습니다. 위의 숏드라마 과정은 /dramas와 /generation을 사용하며, 기존 /images 및 /videos도 계속 사용할 수 있습니다.
이미지 생성
/api/developer/v1/images/generations독립형 이미지 생성 작업(텍스트-이미지 또는 참조 이미지 구성)을 제출합니다. task_id를 반환합니다. 결과를 보려면 GET /api/developer/v1/tasks/task_id를 폴링하세요.
매개변수
modelbody필수stringGET /models의 제품 ID입니다. 예: ponys-image.
promptbody필수string생성할 이미지의 텍스트 설명
aspect_ratiobody선택string가로세로 비율: 16:9, 9:16, 4:3 또는 3:4
image_resolutionbody선택string출력 해상도: 1K 또는 2K
reference_urlsbody선택string[]참조 이미지 URL. 최대 10장까지 가능하며 선택한 모델의 제한을 따릅니다.
코드 샘플
curl -X POST "https://dramamaster.ai/api/developer/v1/images/generations" \
-H "Authorization: Bearer dm_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "ponys-generation-image",
"prompt": "一只可爱的猫咪在草地上奔跑",
"aspect_ratio": "16:9",
"image_resolution": "2K",
"reference_urls": [
"https://example.com/ref1.jpg"
]
}'{
"code": 200,
"message": "ok",
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}
}요청 본문 예
{
"model": "ponys-generation-image",
"prompt": "一只可爱的猫咪在草地上奔跑",
"aspect_ratio": "16:9",
"image_resolution": "2K",
"reference_urls": [
"https://example.com/ref1.jpg"
]
}동영상 생성
/api/developer/v1/videos/generations영상 생성 작업을 제출합니다. 입력, 길이, 옵션은 제품의 지원 기능에 따라 다릅니다. GET /tasks/task_id로 결과를 확인하세요.
매개변수
modelbody필수stringGET /models의 제품 ID입니다. 예: ponys-turbo.
motion_instructionbody선택string | null[공통/조건부 필수] 프롬프트/모션 명령입니다. 텍스트-비디오, 모든 모달 참조, 편집 및 확장에 필요합니다. 이미지 1 / 비디오 1 / 오디오 1을 언급할 수 있습니다.
aspect_ratiobody선택16:9 | 9:16 | 4:3 | 3:4 | null[공통] 화면비: 16:9, 9:16, 4:3, 3:4
duration_secondsbody선택integer | null[공통] 출력 기간(초)입니다. GET /models에서 duration_range / max_duration_seconds를 확인하세요.
capabilitybody선택first_frame | flf2v | image_reference | null[공통] first_frame, flf2v, image_reference; 필드에서 추론하려면 생략하거나 null입니다(motion_instruction만 = 텍스트-비디오)
image_urlbody선택string | null[공통/모드별] first_frame/flf2v의 첫 번째 프레임 이미지 URL입니다. reference_* 필드와 함께 보내지 마세요
last_frame_urlbody선택string | null마지막 프레임 이미지 URL입니다. flf2v에서 image_url과 함께 사용하며 제품의 지원 여부를 확인하세요.
reference_urlsbody선택string[][공통/참조 모드] image_reference에 대한 참조 이미지 URL
reference_video_urlsbody선택string[]참조 영상 URL입니다. GET /models의 max_reference_videos와 capabilities를 확인하세요.
reference_audio_urlsbody선택string[]참조 오디오 URL입니다. GET /models의 max_reference_audios와 capabilities를 확인하세요.
resolutionbody선택480P | 720P | 1080P | null출력 해상도입니다. 제품이 지원하는 값을 확인하세요.
audiobody선택boolean | null오디오 생성 여부입니다. 제품이 지원해야 합니다.
seedbody선택integer | null결과 재현용 난수 시드입니다. 제품이 지원해야 합니다.
watermarkbody선택boolean | null워터마크 추가 여부입니다. 지원 제품에서 사용하며 기본값은 false입니다.
prompt_extendbody선택boolean | null프롬프트 확장 여부입니다. 제품이 지원해야 합니다.
smart_durationbody선택boolean자동 길이 사용 여부입니다. 지원 제품에서 사용하며 기본값은 false입니다.
enable_thinkingbody선택boolean | null추론 활성화 여부입니다. 지원 제품에서 사용하며 문서나 웹 참조에는 필수입니다.
document_urlbody선택string | null참조 문서 URL입니다. 제품이 지원해야 합니다.
web_urlbody선택string | null공개 웹페이지 참조 URL입니다. 제품이 지원해야 합니다.
코드 샘플
curl -X POST "https://dramamaster.ai/api/developer/v1/videos/generations" \
-H "Authorization: Bearer dm_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "ponys-turbo",
"motion_instruction": "Video 1 sits on the chair in Image 2 and sings. Image 1 walks over, places Image 3 on the table, and says: the sunshine is so nice today.",
"aspect_ratio": "9:16",
"duration_seconds": 8,
"capability": "image_reference",
"reference_urls": [
"https://example.com/character.jpg",
"https://example.com/chair.jpg",
"https://example.com/prop.jpg"
],
"reference_video_urls": [
"https://example.com/performance.mp4"
],
"resolution": "720P",
"audio": true,
"prompt_extend": true,
"smart_duration": false
}'{
"code": 200,
"message": "ok",
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}
}요청 본문 예
{
"model": "ponys-turbo",
"motion_instruction": "Video 1 sits on the chair in Image 2 and sings. Image 1 walks over, places Image 3 on the table, and says: the sunshine is so nice today.",
"aspect_ratio": "9:16",
"duration_seconds": 8,
"capability": "image_reference",
"reference_urls": [
"https://example.com/character.jpg",
"https://example.com/chair.jpg",
"https://example.com/prop.jpg"
],
"reference_video_urls": [
"https://example.com/performance.mp4"
],
"resolution": "720P",
"audio": true,
"prompt_extend": true,
"smart_duration": false
}동영상의 문자 교체
/api/developer/v1/videos/replace-characterFor photos use ponys-face, two reference images and empty video_urls. For video use ponys-animate, one reference and one source video. Estimate first and submit approved_quote_id.
매개변수
video_urlsbody필수string[]Empty for photos; one source video URL for replacement
reference_urlsbody필수string[]Photos: [target,face]; video: [reference]
promptbody선택string원하는 교체를 설명하는 교체 프롬프트
approved_quote_idbody필수stringquote_id returned by the estimate
resolutionbody선택string출력 해상도; 기본 720P
aspect_ratiobody선택string가로세로 비율; 기본값 9:16
modelbody선택stringponys-face / ponys-animate
duration_secondsbody선택number예상 청구에 대한 총 소스 비디오 재생 시간(초)입니다. 생략 시 자동 감지
seedbody선택integer재현 가능한 결과를 위한 무작위 시드
watermarkbody선택boolean워터마크 추가 여부; 기본값은 false
코드 샘플
curl -X POST "https://dramamaster.ai/api/developer/v1/videos/replace-character" \
-H "Authorization: Bearer dm_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"video_urls": [
"https://example.com/video1.mp4"
],
"reference_urls": [
"https://example.com/face1.jpg"
],
"prompt": "将视频中的人物替换为参考图中的人物,保持表情和动作自然",
"resolution": "720P",
"aspect_ratio": "9:16",
"model": "ponys-animate",
"approved_quote_id": "QUOTE_ID_FROM_ESTIMATE",
"duration_seconds": 10.5,
"seed": 12345,
"watermark": false
}'{
"code": 200,
"message": "ok",
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}
}요청 본문 예
{
"video_urls": [
"https://example.com/video1.mp4"
],
"reference_urls": [
"https://example.com/face1.jpg"
],
"prompt": "将视频中的人物替换为参考图中的人物,保持表情和动作自然",
"resolution": "720P",
"aspect_ratio": "9:16",
"model": "ponys-animate",
"approved_quote_id": "QUOTE_ID_FROM_ESTIMATE",
"duration_seconds": 10.5,
"seed": 12345,
"watermark": false
}Generate voice and audio
/api/developer/v1/audio/generationsEstimate the identical inputs, approve the Tokens, then submit its quote_id as approved_quote_id. Success consumes that quote; failure refunds it.
매개변수
modelbody필수stringponys-audio
text_promptbody필수stringAudio text, up to 3000 characters
approved_quote_idbody필수stringquote_id returned by the estimate
referencesbody선택object[]Optional voice or audio references
audio_configbody선택objectFormat, sample rate and voice settings
코드 샘플
curl -X POST "https://dramamaster.ai/api/developer/v1/audio/generations" \
-H "Authorization: Bearer dm_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "ponys-audio",
"text_prompt": "欢迎来到我们的故事。",
"approved_quote_id": "QUOTE_ID_FROM_ESTIMATE"
}'{
"code": 200,
"message": "ok",
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}
}요청 본문 예
{
"model": "ponys-audio",
"text_prompt": "欢迎来到我们的故事。",
"approved_quote_id": "QUOTE_ID_FROM_ESTIMATE"
}Preview and lock Tokens
/api/developer/v1/usage/estimateUse for audio, photo face swaps and video character replacement. options must match generation inputs; refresh and approve expired or changed specifications. Photo: model=ponys-face, feature_key=video_character_replace, options.urls=[target,face]. Video: model=ponys-animate, options.urls=[reference], video_urls=[source], resolution=480p or 720p.
매개변수
feature_keybody필수stringgenerate_standalone_audio / video_character_replace
modelbody필수stringponys-audio / ponys-face / ponys-animate
optionsbody필수objectIdentical generation inputs; financial amounts are server-owned
코드 샘플
curl -X POST "https://dramamaster.ai/api/developer/v1/usage/estimate" \
-H "Authorization: Bearer dm_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"feature_key": "generate_standalone_audio",
"model": "ponys-audio",
"options": {
"text_prompt": "欢迎来到我们的故事。"
}
}'{
"code": 200,
"message": "ok",
"data": {
"feature_key": "generate_standalone_audio",
"model": "ponys-audio",
"points_cost": 9,
"billing_unit": "ponys_token",
"quote_id": "QUOTE_ID_FROM_ESTIMATE",
"expires_at": "2026-10-22T12:00:00Z"
}
}요청 본문 예
{
"feature_key": "generate_standalone_audio",
"model": "ponys-audio",
"options": {
"text_prompt": "欢迎来到我们的故事。"
}
}작업 상태 가져오기
/api/developer/v1/tasks/{task_id}각 작업은 최소 10초 간격으로 completed 또는 failed까지 조회하세요. 계정의 모든 요청은 같은 제한을 사용합니다(기본 분당 10회, GET 포함). 전체 요청 속도를 조절하고 429의 Retry-After를 따르세요. 다운로드 클라이언트가 이를 처리합니다.
매개변수
task_idpath필수string이미지/비디오/교체 엔드Tokens에서 반환된 작업 ID
코드 샘플
curl -X GET "https://dramamaster.ai/api/developer/v1/tasks/{task_id}" \
-H "Authorization: Bearer dm_live_xxx"{
"code": 200,
"message": "ok",
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"task_type": "standalone_image_generate",
"status": "completed",
"progress": 100,
"points_cost": 8,
"billing_unit": "ponys_token",
"billing_wallet": "ponys",
"billing_state": "consumed",
"result_url": "https://example.com/output/xxx.png",
"error_message": null,
"extra": {
"model": "ponys-generation-image",
"aspect_ratio": "16:9"
}
}
}파일 업로드
/api/developer/v1/files저장소에 파일을 업로드하고 참조 가능한 URL을 받습니다. 첫 번째 프레임 이미지, 참조 이미지, 참조 비디오 또는 참조 오디오에 사용합니다(콘텐츠 유형: multipart/form-data).
매개변수
fileformData필수file업로드할 파일(이미지, 비디오, 오디오 등)
코드 샘플
curl -X POST "https://dramamaster.ai/api/developer/v1/files" \
-H "Authorization: Bearer dm_live_xxx" \
-F "file=@./reference.png"{
"code": 200,
"message": "ok",
"data": {
"url": "https://example.com/uploads/xxx.jpg",
"storage_key": "uploads/2024/01/xxx.jpg",
"original_filename": "my_image.jpg",
"size_bytes": 204800,
"content_type": "image/jpeg"
}
}모델 목록
/api/developer/v1/models이미지 및 영상 제품, 지원 기능, 입력 한도와 가격을 조회합니다. 반환된 name을 model에 넣으세요.
매개변수
없음
코드 샘플
curl -X GET "https://dramamaster.ai/api/developer/v1/models" \
-H "Authorization: Bearer dm_live_xxx"{
"code": 200,
"message": "ok",
"data": {
"image_models": [
{
"name": "ponys-generation-image",
"display_name": "Ponys Image",
"icon_url": "https://example.com/icon.png",
"capabilities": [
"text_to_image"
],
"capability_labels": {
"text_to_image": "文生图"
},
"image_resolutions": [
"1K",
"2K"
],
"max_reference_images": 10,
"billing_unit": "ponys_token",
"quote_required": true
}
],
"video_models": [
{
"name": "ponys-generation-video",
"display_name": "Video",
"icon_url": "https://example.com/icon.png",
"capabilities": [
"text_to_video",
"first_frame",
"flf2v",
"image_reference"
],
"capability_labels": {
"text_to_video": "文生视频",
"first_frame": "首帧生视频",
"flf2v": "首尾帧生视频",
"image_reference": "全能参考"
},
"duration_range": {
"min": 2,
"max": 30
},
"max_duration_seconds": {
"text_to_video": 15,
"first_frame": 30,
"flf2v": 30,
"image_reference": 30
},
"max_reference_images": 10,
"max_reference_videos": 5,
"max_reference_audios": 5,
"billing_unit": "ponys_token",
"quote_required": true
}
]
}
}