{
  "openapi": "3.1.0",
  "info": {
    "title": "SeedRouter Gemini Omni 1.2 Flash",
    "version": "1.0.0",
    "description": "Gemini Omni 1.2 Flash video with native sound from text, images, first and last frames or references, or an edit or extension of a video, at 360p to 4K. Asynchronous task delivery; media by URL only; callbacks are not offered; tasks cannot be cancelled."
  },
  "servers": [
    {
      "url": "https://api.seedrouter.ai/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/videos/generations": {
      "post": {
        "summary": "Create a video generation task",
        "operationId": "createVideoTask",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted. Poll the returned id; no video is returned by this call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{task_id}": {
      "get": {
        "summary": "Read an owned image task",
        "operationId": "getImageTask",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^task_[A-Za-z0-9]{1,64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Processing, completed or failed task. Polling timeout is not a task failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "VideoRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "const": "gemini-omni-1.2-flash"
          },
          "prompt": {
            "type": "string",
            "description": "Required in every mode: the shot, the change for an edit, or what happens next for an extension."
          },
          "duration": {
            "type": "integer",
            "minimum": 3,
            "maximum": 15,
            "default": 10,
            "description": "3–15 seconds; at most 10 with first and last frames and for an extension (the added part). Ignored by an edit, which keeps the source length."
          },
          "resolution": {
            "type": "string",
            "default": "720p",
            "description": "360p, 720p, 1080p or 4k (2160p means 4k), case-insensitive."
          },
          "aspect_ratio": {
            "type": "string",
            "enum": [
              "16:9",
              "9:16"
            ],
            "default": "16:9"
          },
          "image_urls": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "One image is the start frame; several are subject references. Up to 10 images in total, frames included."
          },
          "first_frame_image": {
            "type": "string",
            "format": "uri",
            "description": "The start frame; with last_frame_image, interpolation."
          },
          "last_frame_image": {
            "type": "string",
            "format": "uri",
            "description": "The end frame; needs a first frame."
          },
          "image_with_roles": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "role": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                }
              },
              "required": [
                "url",
                "role"
              ],
              "additionalProperties": false
            },
            "description": "Frames or references with roles: first_frame, last_frame, or any other role for a reference."
          },
          "video_urls": {
            "minItems": 1,
            "maxItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "One clip of at most 15 seconds to edit (default) or extend."
          },
          "omni_reference_task_type": {
            "type": "string",
            "enum": [
              "auto",
              "edit",
              "extend",
              "reference",
              "text_to_video",
              "image_to_video",
              "reference_to_video"
            ],
            "default": "auto"
          },
          "extend_from_task_id": {
            "type": "string",
            "minLength": 1,
            "description": "One of your completed gemini-omni-1.2-flash tasks, to edit or extend its video."
          }
        },
        "required": [
          "model",
          "prompt"
        ],
        "additionalProperties": false
      },
      "TaskAccepted": {
        "type": "object",
        "required": [
          "id",
          "model",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "enum": [
              "gemini-omni-1.2-flash"
            ]
          },
          "status": {
            "const": "processing"
          },
          "created_at": {
            "type": "integer"
          }
        }
      },
      "Task": {
        "type": "object",
        "required": [
          "id",
          "model",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "enum": [
              "gemini-omni-1.2-flash"
            ]
          },
          "status": {
            "enum": [
              "processing",
              "completed",
              "failed"
            ]
          },
          "created_at": {
            "type": "integer"
          },
          "finished_at": {
            "type": "integer"
          },
          "output": {
            "type": "object",
            "properties": {
              "video_url": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              10001,
              10002,
              20001,
              20002,
              30001,
              30002,
              50001,
              50002,
              50003,
              60001,
              60002,
              60003,
              60004,
              90001
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
