Gemini Omni Flash: 채팅 모델로 영상 생성
Omni는 chat/completions로 텍스트와 미디어를 받고 응답에서 미디어를 만들 수 있습니다. 비동기 Media API와 매개변수가 다릅니다.
- 메시지에 지원 이미지, GIF, 오디오, 영상 URL을 넣을 수 있습니다.
- OpenAI 호환 messages 구조와 전체 Omni 모델 ID를 사용하세요.
- Studio와 Telegram 봇에서도 같은 기능을 제공합니다.
전체 예제
원본 가이드의 실행 가능한 예제를 모두 아래에 보존했습니다. 사용 중인 도구와 운영체제에 해당하는 블록만 실행하세요.
bash
curl https://nordrouter.com/v1/chat/completions \
-H "Authorization: Bearer sk-nr-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-omni-flash-preview",
"messages": [{"role": "user", "content": "Generate a video: a red balloon floating over a calm sea"}],
"modalities": ["image", "text"],
"max_tokens": 4000
}'json
{
"model": "google/gemini-omni-flash-preview",
"messages": [{
"role": "user",
"content": [
{ "type": "text", "text": "Create an ad: use the person from the photo, motion from the reference video, and cut to the audio beat" },
{ "type": "image_url", "image_url": { "url": "https://example.com/hero.png" } },
{ "type": "image_url", "image_url": { "url": "https://example.com/style.gif" } },
{ "type": "input_audio", "input_audio": { "data": "BASE64_AUDIO", "format": "wav" } },
{ "type": "video_url", "video_url": { "url": "https://example.com/motion.mp4" } }
]
}],
"modalities": ["image", "text"],
"max_tokens": 4000
}json
{
"choices": [{
"message": {
"role": "assistant",
"content": "I've generated the video for you.",
"videos": [{ "type": "video_url",
"video_url": { "url": "https://nordrouter.com/media/file/…" } }]
}
}],
"usage": { "prompt_tokens": 18, "completion_tokens": 58197, "total_tokens": 58215 }
}공식 문서 및 관련 링크
| Omni Flash | Regular video models (/media/generate) | |
|---|---|---|
| Endpoint | POST /v1/chat/completions | POST /media/generate |
| Billing | per token (input $0.2322 / output $1.3932 per 1M) | flat per generation |
| Speed | ~40–60 s, synchronous response | task + polling |
| Video price | ≈ $0.08 | from $0.11 |
관련 가이드
먼저 최소 텍스트 요청으로 연결을 확인한 다음 스트리밍, 도구 호출, 이미지와 같은 고급 기능을 추가하세요. API 키를 공개 코드나 브라우저 프런트엔드에 넣지 마세요.