Gemini Omni 1.2 Flash — Requests, billing and idempotency
Channel 335 gateway contract, JSON examples, public task continuation, polling, final charges and safe retry boundaries.
Gemini Omni 1.2 Flash
This page describes APIMaster's gemini-omni-1.2-flash gateway contract, checked on 2026-11-07. It is not the native Google Interactions API, and the 1.1 Official/Ext parameter table does not apply.
Download the OpenAPI 3.1 schema · Current model card
Endpoints, authentication and route
- Create:
POST https://apimaster.ai/v1/videosorPOST https://apimaster.ai/v1/videos/generations. - Poll:
GET https://apimaster.ai/v1/videos/{task_id}. - Download:
GET https://apimaster.ai/v1/videos/{task_id}/content. - Recover a keyed submission:
GET https://apimaster.ai/v1/video-submissions/by-keywith the originalIdempotency-Keyheader. - Recent API-key usage logs:
GET https://apimaster.ai/api/log/token.
Use Authorization: Bearer YOUR_API_KEY. Creation accepts Content-Type: application/json only. Do not append a channel suffix to the model ID. The current public route is 335; normal account/model permissions, route availability, balance and media safety rules apply. There is no separate 1.2 Ext route or Google interaction-ID input in this contract. Model listing confirms availability, not exposure of every Google capability.
Request fields and limits
model and a non-whitespace prompt are required in every mode, including editing and continuation. Unknown top-level fields are rejected.
| Field | Type | Supported behavior |
|---|---|---|
model |
string | Exactly gemini-omni-1.2-flash. |
prompt |
string | Required instructions, even when images/video/a parent task are supplied. Describe generated dialogue/music/sound in this field. |
duration |
integer | Default 10. Ordinary text/image/reference generation: 3–15 seconds. First/last-frame interpolation and extension: 3–10 seconds. For extension this is the new segment, not the combined file. Ignored for editing. |
seconds |
integer or integer string | Compatibility alias; new clients should send only duration. If both are supplied, duration takes precedence. |
resolution |
string | 360p, 720p (default), 1080p, 4k; case-insensitive. 2160p normalizes to 4k. 1080p/4k are upsampled outputs. |
aspect_ratio |
string | 16:9 (default) or 9:16. Other string values currently normalize to 16:9; send only the supported values. |
ratio, size |
string | Legacy aspect-ratio aliases, not resolution. Prefer one aspect_ratio; precedence is aspect_ratio, then ratio, then size. |
image_urls |
string array | Public HTTP(S) direct image URLs. One image is a starting image by default; multiple images are references. |
first_frame_image |
string | Public HTTP(S) direct URL of the first frame. |
last_frame_image |
string | Requires first_frame_image. Together they select interpolation; match frame proportions to the requested aspect ratio. |
image_with_roles |
object array | Alternative to explicit frame fields: each item has url and nonempty role. first_frame/last_frame identify frames; other roles are references. A last frame requires a first frame. |
video_urls |
string array | At most one public HTTP(S) input video, no longer than 15 seconds. Supplying it defaults to editing. |
omni_reference_task_type |
string | auto (default), edit, extend, reference, text_to_video, image_to_video, reference_to_video. A video/parent input is edited unless extend is explicitly selected. |
extend_from_task_id |
string | Your own successful APIMaster public task_... ID for this exact model. Mutually exclusive with video_urls. Requires its original route/provider account to remain available. |
All supplied reference images and frames together must total at most 10. Use either image_with_roles or the explicit frame fields, not both. For character references the supplier recommends at most two characters and three images per character; this recommendation is distinct from the gateway's ten-image limit.
Inputs must be directly downloadable public HTTP(S) URLs. Data URLs, Base64 and multipart uploads are not supported by this model endpoint. PNG/JPEG image references and MP4 videos have been used in validation. The gateway's duration probe supports MP4/MOV-compatible input and reads at most 100 MiB; this is a probe bound, not a promise that every 100 MiB file or codec is accepted upstream. No per-image byte limit or exhaustive provider codec/file-size contract is currently published for this route. Use compact PNG/JPEG and MP4 assets; do not assume Google-native media limits apply.
Standalone audio references, audio_urls, Google interaction/conversation state, metadata, generation_type, system_prompt, temperature, negative_prompt, seed, fps and n are not supported request fields. Negative instructions and generated audio instructions belong in prompt. Audio associated with generated video is included in the video-output pricing component. Native Google multi-turn interactions are not exposed; chained operations on your completed public task IDs are supported, subject to the same input-video limit on every turn.
Non-running JSON examples
The following are inert request bodies, not scripts. Replace all example.com media and placeholder task IDs with your own resources. Use a different idempotency key for each intended new operation; keep the same key and unchanged body for retries of that operation.
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"}
Reference images
{"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"}
First and last frames
{"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"}
The equivalent role-based form is:
{"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"}
Edit an uploaded video URL
{"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"}
Omit duration for editing: source duration controls the output.
Extend an uploaded video URL
{"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"}
Continue a completed public task
{"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"}
For another turn, wait for that child task to complete and use the child's public task ID as the next parent. Do not send a Google interaction ID or the private supplier task ID. If the resulting parent video is longer than 15 seconds, it cannot be reused under the current reference-input limit.
Edit a completed public task
{"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"}
There is no valid audio-reference example because audio inputs are not supported.
Submission, polling, download and failure
The first successful POST returns HTTP 200:
{"id":"task_REDACTED_EXAMPLE","task_id":"task_REDACTED_EXAMPLE","object":"video","model":"gemini-omni-1.2-flash","status":"queued"}
Poll GET /v1/videos/{task_id} every 5–10 seconds with your API key. Public states are queued, in_progress, completed and failed; clients should also tolerate unknown for an unmapped/transitional state. Polling and content download are reads, not generation requests.
Completed-task response shape from the current adapter, with task identity and timestamp replaced:
{"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"}}
url and metadata.url are authenticated platform proxy URLs, not raw supplier downloads. Send your bearer key when downloading them. A terminal generation failure is returned by polling as a task response, typically HTTP 200:
{"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."}}
The message is sanitized and varies by failure. Submission validation/authentication/balance/route errors instead use HTTP 4xx/5xx. A POST timeout or transport/5xx failure is not proof that the supplier did not accept the request.
Actual usage, final cost, settlement and refunds
Task polling responses do not currently include guaranteed usage, modality breakdowns, total USD or a complete billing receipt. There is no Omni-specific invoice endpoint; /v1/videos/{task_id}/billing is not a supported Omni final-charge contract.
For API integration, use GET https://apimaster.ai/api/log/token with the same bearer API key. This returns a bounded recent list for that key, not a paginated invoice/history export. For account-wide/history queries, use the signed-in account consumption log (GET /api/log/self, account authentication required). A model-generation API key is not a substitute for account authentication on that account endpoint.
Parse each row's other JSON string and match other.task_id to the public task ID. On a successfully reconciled task, other.final_amount_usd is the finalized customer charge, already reflecting the frozen route and account pricing. prompt_tokens/completion_tokens are actual token counts when supplied. Additional other fields can include input_tokens, text_output_tokens, video_output_tokens, token_usage_source, retail_token_prices, and group_ratio.
For illustration, a finalized three-second 360p validation task used input=39, text output=0 and video output=5793 tokens; its final customer charge was $0.064286 after the applicable frozen rates, account multiplier and quota rounding. This is a historical example, not a price promise for a new request.
As checked on 2026-11-07, channel 335's card lists customer base rates of $1.32 input / $7.92 text output / $10.56 video output per million tokens, before account-specific multipliers. Query the current model card rather than hardcoding these prices. The conceptual token formula is:
USD = (input_tokens × input_rate
+ text_output_tokens × text_output_rate
+ video_output_tokens × video_output_rate) / 1,000,000
Apply the frozen applicable account pricing and platform quota rounding. Generated-video audio belongs to the video-output component, not a separately exposed audio-input counter. Input tokens are aggregated; the public contract does not guarantee separate text/image/video input counts.
Submission reserves an estimate. After generation, actual usage and the frozen prices reconcile it; a refund or additional debit may follow. Confirmed failed generation refunds the generation reservation. Transport timeout/unknown acceptance alone is not a confirmed failure or a promise of immediate refund. In the raw ledger, quota units convert at 500,000 units = USD 1; an initial reservation row alone is not the final invoice. Do not add final_amount_usd to the same task's settlement-adjustment rows and count them twice.
An extension's video-output tokens cover the newly generated segment, while the input reference video is billed as input. The returned MP4 contains the original plus the new segment; do not charge by the combined file duration. A three-second parent extended by three seconds was validated as an approximately six-second file with approximately three seconds of new video-output tokens plus reference-input usage.
The supplier can omit component details. The current parser uses reported input/output totals; if no text breakdown is supplied, it treats reported output as video output. If valid token usage is absent but an authoritative supplier cost receipt exists, the task can settle from that receipt, without inventing token counts. Such logs can have token_usage_source: "provider_cost_receipt" and missing modality counts. If both usable usage and cost are absent, the gateway does not finalize a successful generation from the duration estimate; it keeps reconciling. Therefore complete modality counts on every final task are not guaranteed. Final costs must be read after settlement; there is no fixed settlement-time SLA.
Gateway idempotency and acceptance recovery
Supply Idempotency-Key, 8–128 visible ASCII characters (no whitespace), on the creation POST. There is no body-field equivalent. One key identifies one intended generation within one account. JSON object key order is ignored; changed values, array order, explicit-versus-omitted defaults, routing group or explicit route can produce a conflict. Reuse the unchanged body, account and routing choices after timeout.
- First request: one durable claim, one original upstream generation attempt.
- Same account/key/request: HTTP 202 with an existing receipt and
Idempotency-Replayed: true; no second generation, reservation or task. - Same account/key with a changed request: HTTP 409,
idempotency_conflict. - Original connection disconnect: the gateway finishes the owned, bounded submission/persistence attempt independently where possible. It does not create another generation to recover it.
Recover by calling GET /v1/video-submissions/by-key with your bearer API key and the original Idempotency-Key. The GET is a receipt-only read. It does not submit a task, call the generator, move funds or actively search the supplier by key. A valid key belonging to the same account may read the receipt; a different account cannot.
An illustrative accepted lookup result is:
{"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"}}
The actual response also contains timestamps, request/support references, error/recovery metadata and retention information. These are submission states, separate from generation states:
| Submission state | Client action |
|---|---|
pending, submitting |
Keep reading the original receipt. Do not generate a replacement. |
accepted + task_ready: true |
Poll the returned public task ID. |
accepted + task_ready: false |
Original acceptance is recorded but task/accounting persistence needs reconciliation. Keep the key; contact support if unresolved. |
acceptance_unknown |
No automatic resubmission. Preserve the key and support reference; contact support. A refund alone does not prove that a duplicate generation is safe. |
not_accepted |
Correct the confirmed error and use a new key only when the receipt/financial state permits; the original key continues to replay its original result. |
Claims are retained for at least 30 days with no automatic key reuse. A missing/404 by-key result has retry_safe: false: it does not rule out an in-flight original request, a request made before this feature, or one made without your key. A POST without a client key still creates an independent operation; repeating that POST is not a client-recoverable keyed retry.
This is gateway-side replay protection, not a promise of native Google/APIMart idempotency or automatic supplier discovery after an ambiguous timeout. The gateway never automatically re-sends an uncertain original. Already accepted and financially committed local task records can be restored from durable evidence without re-running generation or charging again.
Quote endpoint and capability boundaries
POST /v1/videos/quote does not support gemini-omni-1.2-flash. Its current supported-model check is Seedance-specific. Do not treat it as a free Omni estimate or rely on a quote schema for this model. There is no supported no-task/no-generator quote contract for Omni 1.2 at present.
This page and the linked schema describe the exposed gateway surface only. Supplier media moderation and regional restrictions still apply; the supplier documents restrictions on uploaded-video editing/extension for the EEA, Switzerland and the UK. No additional customer allowlist is specified for the current default route, but keys must have the appropriate model/group access. Do not infer additional Official/Ext or Google-native features from the model's availability listing.
Supplier reference: APIMart Omni 1.2 generation. The public APIMaster task IDs, responses, billing logs and gateway idempotency described here take precedence over the supplier's native response examples.
