# Gemini Omni Text to Video > MuAPI의 저지연 API를 통해 gemini-omni-text-to-video AI 모델을 손쉽게 연동하세요. 유연한 종량제 요금, 즉각적인 확장성 및 뛰어난 가용성을 제공합니다. ## 개요 - **Endpoint**: `POST https://api.muapi.ai/api/v1/gemini-omni-text-to-video` - **모델 ID**: `gemini-omni-text-to-video` - **카테고리**: 텍스트를 비디오로 - **변형**: Text to Video - **패밀리**: gemini-omni - **비용**: 호출당 1.5 크레딧(일부 모델은 매개변수에 따라 동적으로 비용을 계산함) ## API 사용법 Muapi는 **제출 후 폴링(Submit-then-poll)** 패턴을 사용합니다. 즉, 작업을 제출하고 `request_id`를 얻은 다음 `status`가 `completed`가 될 때까지 엔드포인트를 폴링합니다. 선택적으로 제출 호출 시 `?webhook=YOUR_URL`을 전달하여 작업 완료 시 POST 웹훅 콜백을 수신할 수 있습니다(폴링 생략 가능). **인증**: `x-api-key` 헤더에 MuApi 키를 보냅니다. https://muapi.ai/access-keys에서 하나 받으세요. ### 1. 작업 제출 ```http POST https://api.muapi.ai/api/v1/gemini-omni-text-to-video Content-Type: application/json x-api-key: YOUR_API_KEY ``` **최소(필수):** ```json { "prompt": "" } ``` **전체 예(모든 매개변수):** ```json { "prompt": "", "duration": 8, "resolution": "1080p", "aspect_ratio": "16:9", "audio_ids": [], "seed": 0, "character_ids": [] } ``` **응답:** ```json { "request_id": "abc123", "status": "processing" } ``` ### 2. 결과 폴링 ```http GET https://api.muapi.ai/api/v1/predictions/{request_id}/result x-api-key: YOUR_API_KEY ``` 가능한 'status' 값: 'queued', 'pending', 'processing', 'completed', 'failed', 'cancelled'. 2~5초마다 폴링을 수행하세요. `completed` 상태가 되면 결과 URL이 `outputs` 배열에 반환됩니다. **`completed` 시 응답 예시:** ```json { "id": "abc123", "status": "completed", "outputs": [ "https://cdn.muapi.ai/.../output.png" ], "urls": { "get": "https://api.muapi.ai/api/v1/predictions/abc123/result" }, "created_at": "2026-05-08T12:34:56Z", "has_nsfw_contents": [] } ``` ### cURL ```bash 1. 작업 제출 REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/gemini-omni-text-to-video \ -H "x-api-key: $MUAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt":""}' | jq -r .request_id) 2. 완료될 때까지 폴링 while :; do RESP=$(curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY") STATUS=$(echo "$RESP" | jq -r .status) [ "$STATUS" = "completed" ] && echo "$RESP" | jq .outputs && break [ "$STATUS" = "failed" ] && echo "$RESP" && exit 1 sleep 3 done ``` ### Python ```python import os, time, requests API = "https://api.muapi.ai/api/v1" headers = {"x-api-key": os.environ["MUAPI_API_KEY"]} r = requests.post(f"{API}/gemini-omni-text-to-video", headers=headers, json={"prompt":""}) request_id = r.json()["request_id"] while True: res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json() if res["status"] == "completed": print(res["outputs"]); break if res["status"] == "failed": raise RuntimeError(res.get("error")); time.sleep(3) ``` ## 입력 스키마 API는 다음 입력 매개변수를 허용합니다. - **`prompt`** (`string`, _필수_): 비디오. Gemini Omni는 프롬프트, , , 오디오와 호환됩니다. - **`duration`** (`int`, _선택사항_): 비디오 지속 시간 () . - 기본값: `8` - 옵션: `"4"`, `"6"`, `"8"`, `"10"` - **`resolution`** (`string`, _선택사항_): 해상도 비디오 출력. 출력: 360p $0.039/, 720p $0.13/, 1080p $0.195/, 4K $0.39/. - 기본값: `"1080p"` - 옵션: `"360p"`, `"720p"`, `"1080p"`, `"4k"` - **`aspect_ratio`** (`string`, _선택사항_): 출력 비디오 종횡비. - 기본값: `"16:9"` - 옵션: `"16:9"`, `"9:16"` - **`audio_ids`** (`array`, _선택사항_): Up to 3 voice profile IDs returned by the Gemini Omni Audio endpoint. - **`seed`** (`int`, _선택사항_): 시드(0–2147483647) . , , . - 기본값: `0` - **`character_ids`** (`array`, _선택사항_): Up to 3 character IDs from Gemini Omni Character to feature in the video. ## 출력 스키마 폴링 엔드포인트는 다음 필드를 반환합니다. - **`id`** (`string`): 요청 ID입니다. - **`status`** (`string`): 'queued', 'pending', 'processing', 'completed', 'failed', 'cancelled' 중 하나입니다. - **`outputs`** (`array`): 생성된 이미지/비디오/오디오에 대한 URL 목록입니다. `status`가 `completed`가 될 때까지 비어 있습니다. - **`urls.get`** (`string`): 이 예측 결과를 다시 조회하는 자체 링크입니다. - **`error`** (`string` | `null`): `status`가 `failed`인 경우의 오류 메시지입니다. - **`created_at`** (`string`): 요청이 생성된 시점의 ISO-8601 타임스탬프입니다. - **`has_nsfw_contents`** (`array of boolean`): 출력별 NSFW 감지 플래그입니다. ## 웹훅(선택사항) 제출 URL에 `?webhook=https://your-server/path`를 추가하세요. 작업이 최종 상태에 도달하면 Muapi가 해당 URL로 폴링 응답과 동일한 페이로드를 POST 전송하므로 별도의 폴링이 필요하지 않습니다. ## 에이전트 연동 Muapi는 MCP 서버와 CLI를 제공하므로 AI 에이전트(Claude Code, Cursor, 커스텀 에이전트)가 복잡한 HTTP 코드 없이도 이 엔드포인트를 호출할 수 있습니다. ```bash # CLI 설치 npm install -g muapi-cli # 1회 인증 muapi auth login # 모든 Muapi 모델을 에이전트에 MCP 도구로 제공합니다. muapi mcp serve ``` MCP 서버는 `gemini-omni-text-to-video`을 포함하여 모든 모델에 대해 제출 + 폴링을 래핑하는 도구를 노출합니다. 카테고리별 단축키(`muapi image generate`, `muapi video from-image` 등)는 `muapi --help`를 참조하세요. ## 관련 모델 - [이미지를 비디오로](https://muapi.ai/ko/playground/gemini-omni-image-to-video) - [Audio Profile](https://muapi.ai/ko/playground/gemini-omni-audio) - [Character Creation](https://muapi.ai/ko/playground/gemini-omni-character) - [1.1 Flash](https://muapi.ai/ko/playground/gemini-omni-flash-1-1-text-to-video) - [텍스트를 비디오로](https://muapi.ai/ko/playground/gemini-omni-text-to-video) - [Video Edit](https://muapi.ai/ko/playground/gemini-omni-video-edit) - [1.1 Flash Image to Video](https://muapi.ai/ko/playground/gemini-omni-flash-1-1-image-to-video) - [1.1 Flash Edit](https://muapi.ai/ko/playground/gemini-omni-flash-1-1-edit) - [1.1 Flash Reference to Video](https://muapi.ai/ko/playground/gemini-omni-flash-1-1-reference-to-video) ## 자원 - [플레이그라운드 페이지](https://muapi.ai/ko/playground/gemini-omni-text-to-video) - [API 참조](https://muapi.ai/ko/playground/gemini-omni-text-to-video/api) - [전역 llms.txt](https://muapi.ai/ko/llms.txt)