Build with Gaia Video Factory
面向开发者的统一模型网关文档。从创建 API Key、配置客户端,到调用 LLM、Image2 生图和 Grok 视频接口,这里提供客户接入所需的核心入口。
快速开始
三步完成接入:创建 Key、选择 Base URL、开始调用模型。
API 参考
目前已接入统一网关、Image2 生图和 Grok 视频转发。
Unified Base URL
https://api.gaiavideofactory.com/v1Universal API Key
sk-ga_...LLM Model
gpt-5.4-miniImage Model
gpt-image-2 或 image2Async Image
POST /v1/images/generations/asyncVideo Model
grok-imagine-videoAsync Video
POST /v1/videos/asynccurl https://api.gaiavideofactory.com/v1/models \
-H "Authorization: Bearer sk-ga_xxx"
异步图生视频
推荐带参考图的视频生成使用异步接口。网关会先返回任务 ID,再在后台提交给 Grok、轮询状态并保存最终视频。
提交任务
POST https://api.gaiavideofactory.com/v1/videos/async兼容写法
POST https://api.gaiavideofactory.com/v1/videos?async=true查询状态
GET /v1/videos/async/{job_id}下载成片
GET /v1/videos/async/{job_id}/contentcurl -X POST "https://api.gaiavideofactory.com/v1/videos/async" \
-H "Authorization: Bearer sk-ga_xxx" \
-F "model=grok-imagine-video" \
-F "prompt=雨夜街头,镜头缓慢推进,电影感真实光影" \
-F "seconds=6" \
-F "size=1280x720" \
-F "resolution_name=720p" \
-F "preset=normal" \
-F "input_reference[]=@/path/to/image.png"
curl "https://api.gaiavideofactory.com/v1/videos/async/vidjob_xxx" \
-H "Authorization: Bearer sk-ga_xxx"
curl -L "https://api.gaiavideofactory.com/v1/videos/async/vidjob_xxx/content" \
-H "Authorization: Bearer sk-ga_xxx" \
-o result.mp4
异步生图
推荐慢速生图任务使用异步接口,提交后立即返回任务 ID,避免浏览器、客户服务器或 Cloudflare 等待超时。
提交任务
POST https://api.gaiavideofactory.com/v1/images/generations/async兼容写法
POST https://api.gaiavideofactory.com/v1/images/generations?async=true查询状态
GET /v1/images/generations/async/{job_id}获取结果
GET /v1/images/generations/async/{job_id}/resultcurl -X POST "https://api.gaiavideofactory.com/v1/images/generations/async" \
-H "Authorization: Bearer sk-ga_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "cinematic product photo, clean studio lighting",
"size": "1024x1024"
}'
curl "https://api.gaiavideofactory.com/v1/images/generations/async/imgjob_xxx" \
-H "Authorization: Bearer sk-ga_xxx"
curl "https://api.gaiavideofactory.com/v1/images/generations/async/imgjob_xxx/result" \
-H "Authorization: Bearer sk-ga_xxx"
客户端配置
任何支持 OpenAI-compatible Provider 的客户端,都可以用 Gaia API Key 接入。