APIMaster.ai

Gemini Omni 1.2 Flash — 參數與限制

本頁為 APIMaster gemini-omni-1.2-flash 的閘道協定,核驗於 2026-11-07,不是 Google 原生 Interactions API。1.1 的 Official/Ext 規則不適用。

Gemini Omni 1.2 Flash

本頁為 APIMaster gemini-omni-1.2-flash 的閘道協定,核驗於 2026-11-07,不是 Google 原生 Interactions API。1.1 的 Official/Ext 規則不適用。

OpenAPI 3.1 · Gemini Omni 1.2 Flash

路由與驗證

目前公開路由為渠道 335。使用 Authorization: Bearer YOUR_API_KEY 與 Content-Type: application/json。API Key 仍受模型、群組、餘額及路由可用性限制;目前沒有另行公布的客戶允許名單。不要在模型 ID 加渠道後綴。1.2 沒有獨立 Ext 路由,模型可見不代表已開放全部 Google 能力。

  • POST https://apimaster.ai/v1/videos
  • POST https://apimaster.ai/v1/videos/generations
  • GET https://apimaster.ai/v1/videos/{task_id}
  • GET https://apimaster.ai/v1/videos/{task_id}/content
  • GET https://apimaster.ai/v1/video-submissions/by-key
  • GET https://apimaster.ai/api/log/token

參數與限制

欄位 型別 規則
model string 固定公開模型 ID。
prompt string 所有模式均必填非空白指令,包含編輯及延續。
duration integer 預設 10;一般生成 3–15 整秒;插值與續寫新增部分 3–10 秒;編輯時忽略。
seconds integer / string duration 相容別名,整數或整數字串;兩者同傳以 duration 優先。
resolution string 360p、720p(預設)、1080p、4k,不分大小寫;2160p 轉 4k。1080p/4k 為上採樣。
aspect_ratio string 16:9(預設)或 9:16,其他字串目前轉為 16:9,請僅用支援值。
ratio string 舊版比例別名,不是解析度;優先使用 aspect_ratio。
size string 舊版比例別名;優先序 aspect_ratio、ratio、size。
image_urls string[] 公開 HTTP(S) 圖片直連;單圖預設為起始畫面,多圖為參考。
first_frame_image string 首幀圖片公開直連。
last_frame_image string 必須同傳 first_frame_image;首尾比例應匹配輸出。
image_with_roles object[] 與直接首尾幀欄位二選一。每項有 url 與非空 role;first_frame/last_frame 為首尾幀,其他為參考。尾幀需要首幀。
video_urls string[] 最多一段、最長 15 秒的公開輸入影片,預設編輯。
omni_reference_task_type string auto、edit、extend、reference、text_to_video、image_to_video、reference_to_video;續寫必須明確 extend。
extend_from_task_id string 本人已成功的同模型公開 task_... ID;與 video_urls 互斥。原渠道及上游帳戶必須可用;不是 Google interaction ID。

所有參考圖與首尾幀合計最多 10 張。image_with_roles 與直接首尾幀欄位不能同用。供應商建議最多兩個角色、每個三張圖。輸入只接受公開 HTTP(S) 直連,不接受 Base64、Data URL、multipart。已驗證 PNG/JPEG 與 MP4。影片時長探測相容 MP4/MOV,最多讀取 100 MiB;這不是上游保證的檔案大小上限。目前沒有公布單圖位元組限制或完整上游編碼/大小協定。

不支援音訊參考、audio_urls、Google interaction/conversation 狀態、metadata、generation_type、system_prompt、temperature、negative_prompt、seed、fps、n。負面要求與生成聲音寫入 prompt。可連續引用已完成的公開任務,但每次輸入影片仍限 15 秒,不是 Google 原生多輪會話。未知頂層欄位會被拒絕。

不執行生成的 JSON 範例

以下僅為請求體,不會執行。將 example.com 和範例 ID 換成自己的資料。新操作用新鍵;同一操作重試保留原鍵及原請求體。下一輪使用已完成子任務的公開 ID。音訊輸入不支援,因此沒有有效音訊範例。

1. text_to_video

{"model":"gemini-omni-1.2-flash","prompt":"A blue glass sphere rolls slowly across a plain gray table.","duration":3,"resolution":"360p","aspect_ratio":"16:9"}

2. reference_to_video

{"model":"gemini-omni-1.2-flash","prompt":"Animate these geometric references while preserving their shapes and colors.","image_urls":["https://example.com/reference-a.png","https://example.com/reference-b.png"],"omni_reference_task_type":"reference","duration":6,"resolution":"720p","aspect_ratio":"16:9"}

3. first_frame_image / last_frame_image

{"model":"gemini-omni-1.2-flash","prompt":"Make a smooth transition from the first view to the last view.","first_frame_image":"https://example.com/first.png","last_frame_image":"https://example.com/last.png","duration":6,"resolution":"720p","aspect_ratio":"16:9"}

4. image_with_roles

{"model":"gemini-omni-1.2-flash","prompt":"Make a smooth transition between these views.","image_with_roles":[{"url":"https://example.com/first.png","role":"first_frame"},{"url":"https://example.com/last.png","role":"last_frame"}],"duration":6,"resolution":"720p"}

5. edit / video_urls

{"model":"gemini-omni-1.2-flash","prompt":"Change the lighting to sunset while preserving the scene.","video_urls":["https://example.com/input.mp4"],"omni_reference_task_type":"edit","resolution":"720p"}

6. extend / video_urls

{"model":"gemini-omni-1.2-flash","prompt":"Continue the camera movement for three more seconds.","video_urls":["https://example.com/input.mp4"],"omni_reference_task_type":"extend","duration":3,"resolution":"720p"}

7. extend / extend_from_task_id

{"model":"gemini-omni-1.2-flash","prompt":"Continue the previous scene with a gentle camera pan.","extend_from_task_id":"task_YOUR_COMPLETED_TASK","omni_reference_task_type":"extend","duration":3,"resolution":"720p"}

8. edit / extend_from_task_id

{"model":"gemini-omni-1.2-flash","prompt":"Keep the scene but turn the blue sphere yellow.","extend_from_task_id":"task_YOUR_COMPLETED_TASK","omni_reference_task_type":"edit","resolution":"720p"}

任務、輪詢與下載

首次受理 POST 回傳 HTTP 200、queued。每 5–10 秒輪詢:queued → in_progress → completed/failed,也應容忍過渡 unknown。url 與 metadata.url 為平台鑑權代理,下載仍帶 Bearer Key。生成失敗通常以 HTTP 200 回傳 error.code=generation_failed,訊息經脫敏;提交錯誤為 HTTP 4xx/5xx。超時或 5xx 不能證明未受理。以下為任務標識及時間已替換的回應結構。

{"id":"task_REDACTED_EXAMPLE","task_id":"task_REDACTED_EXAMPLE","object":"video","model":"gemini-omni-1.2-flash","status":"queued"}
{"id":"task_REDACTED_COMPLETED_EXAMPLE","task_id":"task_REDACTED_COMPLETED_EXAMPLE","object":"video","model":"gemini-omni-1.2-flash","status":"completed","progress":100,"created_at":1793966808,"url":"https://apimaster.ai/v1/videos/task_REDACTED_COMPLETED_EXAMPLE/content","metadata":{"url":"https://apimaster.ai/v1/videos/task_REDACTED_COMPLETED_EXAMPLE/content"}}
{"id":"task_REDACTED_FAILED_EXAMPLE","task_id":"task_REDACTED_FAILED_EXAMPLE","object":"video","model":"gemini-omni-1.2-flash","status":"failed","progress":100,"created_at":1793966808,"error":{"code":"generation_failed","message":"The generation request failed."}}

用量、最終費用與退款

輪詢不保證包含 usage、模態細分或美元總額。結算後的對客金額讀取消費日誌 other.final_amount_usd。相同 Key 可 GET /api/log/token,取得該 Key 有限條近期記錄,並非長期帳單匯出;帳戶歷史 GET /api/log/self 需帳戶登入,不能由生成 Key 替代。把 other 字串解析成 JSON,按 other.task_id 匹配。實際用量存在時有 prompt_tokens、completion_tokens,並可能有 other.input_tokens、text_output_tokens、video_output_tokens、token_usage_source、retail_token_prices、group_ratio。輸入是聚合量,不保證分拆文字、圖片、影片。

2026-11-07 渠道 335 使用者倍率前價格:輸入 $1.32、文字輸出 $7.92、影片輸出 $10.56/百萬 tokens;以即時模型卡為準。提交先預扣估算,完成後按實際用量與凍結價格補扣或退款。確認生成失敗退回生成預扣;受理不明不表示立即退款。500,000 quota = USD 1。不要將初始預扣當最終金額,也不要把最終費用和補退款流水重複相加。歷史範例輸入 39、文字輸出 0、影片輸出 5793,最終 $0.064286,不是新請求固定報價。

USD = (input_tokens × input_rate
     + text_output_tokens × text_output_rate
     + video_output_tokens × video_output_rate) / 1,000,000

續寫只計新增片段的影片輸出,原影片另計輸入;回傳 MP4 包含兩部分。已驗證 3 秒原片續寫 3 秒形成約 6 秒檔案,輸出 tokens 對應新增約 3 秒。生成音訊屬影片輸出。缺文字明細時,目前解析器將輸出總數視為影片輸出;缺有效 tokens 但有權威費用回執時可依回執結算,token_usage_source=provider_cost_receipt,不虛構計數。兩者都缺則繼續核帳,因此不保證完整模態計數或固定結算時間。

閘道冪等與恢復

Idempotency-Key 為 8–128 個不含空白的可見 ASCII 字元,沒有請求體替代欄位,按帳戶隔離。同帳戶、同鍵、同請求回傳 HTTP 202 和 Idempotency-Replayed:true,不再生成或預扣;改請求、群組或指定路由回傳 409 idempotency_conflict。JSON 物件鍵順序不影響指紋;陣列順序、值與省略/明確預設值會影響。連線中斷後,已取得執行權的原提交會盡可能在受限時間內完成並持久化。

{"code":200,"data":{"submission_id":"REDACTED_SUBMISSION_ID","task_id":"task_REDACTED_EXAMPLE","model":"gemini-omni-1.2-flash","status":"accepted","task_ready":true,"same_key_replay_safe":true,"new_submission_safe":false,"next_action":"query_task"}}

GET /v1/video-submissions/by-key 帶原鍵及 Bearer Key,只讀平台回執,不呼叫生成器、不按鍵搜尋上游、不移動資金。pending/submitting 繼續讀;accepted 且 task_ready=true 時輪詢 task_id;accepted 但未就緒時待核帳或聯絡支援;acceptance_unknown 禁止自動重送,保留原鍵及支援引用;not_accepted 僅在確認錯誤已修正且回執/資金狀態允許時改用新鍵。舊鍵永遠重放原結果。404 的 retry_safe=false 不是未受理證明。至少保留 30 天,不自動重用鍵。未帶客戶端鍵的重複 POST 是新操作。這是閘道冪等,不承諾 Google/APIMart 原生冪等或自動發現上游任務;受理不明絕不自動重送。已受理且資金已確認的本地原任務可恢復,不重新生成或扣費。

能力邊界與估價

POST /v1/videos/quote 不支援此模型,目前僅有 Seedance 校驗。Omni 沒有受支援的不建立任務/不呼叫生成器的免費 quote,也沒有獨立 invoice 或 /v1/videos/{task_id}/billing 最終帳單協定。仍受供應商審核與地區限制;EEA、瑞士、英國對上傳影片編輯/續寫有限制。下方提供完整協定;供應商原生範例不能代替 APIMaster 公開 ID、回應及帳目。

APIMart · Gemini Omni 1.2 Flash