{
  "openapi": "3.1.0",
  "info": {
    "title": "SeedRouter Veo 3.1",
    "version": "1.0.0",
    "description": "Veo 3.1 video generation: three models priced per 8-second clip and two priced per second. Asynchronous task delivery; images 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": {
        "oneOf": [
          {
            "title": "veo-3.1-fast",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "const": "veo-3.1-fast"
              },
              "prompt": {
                "type": "string"
              },
              "duration": {
                "type": "number",
                "const": 8,
                "default": 8,
                "description": "Every clip is 8 seconds; only 8 is accepted."
              },
              "aspect_ratio": {
                "type": "string",
                "enum": [
                  "16:9",
                  "9:16"
                ]
              },
              "resolution": {
                "type": "string",
                "default": "720p",
                "description": "720p, 1080p, 4k, in any case."
              },
              "enable_gif": {
                "type": "boolean",
                "default": false,
                "description": "Return the clip as an animated GIF instead of MP4. 720p only."
              },
              "nsfw_check": {
                "type": "boolean",
                "default": false,
                "description": "Check the prompt and images for unsafe content before generating."
              },
              "image_urls": {
                "anyOf": [
                  {
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Up to 3 public image URLs (JPEG, PNG or WebP, 10 MB or less each). Base64 is not accepted."
              },
              "generation_type": {
                "type": "string",
                "enum": [
                  "frame",
                  "reference"
                ],
                "description": "frame or reference. Without it, 2 images use frame mode and 3 reference mode."
              }
            },
            "required": [
              "model",
              "prompt"
            ],
            "additionalProperties": false
          },
          {
            "title": "veo-3.1-quality",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "const": "veo-3.1-quality"
              },
              "prompt": {
                "type": "string"
              },
              "duration": {
                "type": "number",
                "const": 8,
                "default": 8,
                "description": "Every clip is 8 seconds; only 8 is accepted."
              },
              "aspect_ratio": {
                "type": "string",
                "enum": [
                  "16:9",
                  "9:16"
                ]
              },
              "resolution": {
                "type": "string",
                "default": "720p",
                "description": "720p, 1080p, 4k, in any case."
              },
              "enable_gif": {
                "type": "boolean",
                "default": false,
                "description": "Return the clip as an animated GIF instead of MP4. 720p only."
              },
              "nsfw_check": {
                "type": "boolean",
                "default": false,
                "description": "Check the prompt and images for unsafe content before generating."
              },
              "image_urls": {
                "anyOf": [
                  {
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Up to 3 public image URLs (JPEG, PNG or WebP, 10 MB or less each). Base64 is not accepted."
              },
              "generation_type": {
                "type": "string",
                "enum": [
                  "frame",
                  "reference"
                ],
                "description": "frame only. Without it, 2 images use frame mode; 3 images (reference mode) are refused."
              }
            },
            "required": [
              "model",
              "prompt"
            ],
            "additionalProperties": false
          },
          {
            "title": "veo-3.1-lite",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "const": "veo-3.1-lite"
              },
              "prompt": {
                "type": "string"
              },
              "duration": {
                "type": "number",
                "const": 8,
                "default": 8,
                "description": "Every clip is 8 seconds; only 8 is accepted."
              },
              "aspect_ratio": {
                "type": "string",
                "enum": [
                  "16:9",
                  "9:16"
                ]
              },
              "resolution": {
                "type": "string",
                "default": "720p",
                "description": "720p, 1080p, in any case."
              },
              "enable_gif": {
                "type": "boolean",
                "default": false,
                "description": "Return the clip as an animated GIF instead of MP4. 720p only."
              },
              "nsfw_check": {
                "type": "boolean",
                "default": false,
                "description": "Check the prompt and images for unsafe content before generating."
              }
            },
            "required": [
              "model",
              "prompt"
            ],
            "additionalProperties": false
          },
          {
            "title": "veo-3.1-fast-official",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "const": "veo-3.1-fast-official"
              },
              "prompt": {
                "type": "string"
              },
              "negative_prompt": {
                "type": "string"
              },
              "duration": {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 4
                  },
                  {
                    "type": "number",
                    "const": 6
                  },
                  {
                    "type": "number",
                    "const": 8
                  }
                ],
                "default": 8,
                "description": "4, 6 or 8 seconds."
              },
              "aspect_ratio": {
                "type": "string",
                "enum": [
                  "16:9",
                  "9:16"
                ],
                "default": "16:9"
              },
              "resolution": {
                "type": "string",
                "default": "720p",
                "description": "720p, 1080p, 4k, in any case."
              },
              "first_frame_image": {
                "type": "string",
                "format": "uri"
              },
              "last_frame_image": {
                "type": "string",
                "format": "uri",
                "description": "Needs first_frame_image."
              },
              "seed": {
                "type": "integer",
                "minimum": 0,
                "maximum": 4294967295,
                "description": "Random when omitted."
              },
              "generate_audio": {
                "type": "boolean",
                "default": false,
                "description": "Add an audio track; billed at a higher per-second rate."
              },
              "person_generation": {
                "type": "string",
                "enum": [
                  "allow_adult",
                  "disallow"
                ],
                "default": "allow_adult"
              },
              "resize_mode": {
                "type": "string",
                "enum": [
                  "pad",
                  "crop"
                ],
                "default": "pad",
                "description": "Needs first_frame_image."
              },
              "enhance_prompt": {
                "type": "boolean",
                "const": true,
                "default": true,
                "description": "Only true is accepted; omit the field otherwise."
              },
              "nsfw_check": {
                "type": "boolean",
                "default": false,
                "description": "Check the prompt and images for unsafe content before generating."
              }
            },
            "required": [
              "model",
              "prompt"
            ],
            "additionalProperties": false
          },
          {
            "title": "veo-3.1-quality-official",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "const": "veo-3.1-quality-official"
              },
              "prompt": {
                "type": "string"
              },
              "negative_prompt": {
                "type": "string"
              },
              "duration": {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 4
                  },
                  {
                    "type": "number",
                    "const": 6
                  },
                  {
                    "type": "number",
                    "const": 8
                  }
                ],
                "default": 8,
                "description": "4, 6 or 8 seconds."
              },
              "aspect_ratio": {
                "type": "string",
                "enum": [
                  "16:9",
                  "9:16"
                ],
                "default": "16:9"
              },
              "resolution": {
                "type": "string",
                "default": "720p",
                "description": "720p, 1080p, 4k, in any case."
              },
              "first_frame_image": {
                "type": "string",
                "format": "uri"
              },
              "last_frame_image": {
                "type": "string",
                "format": "uri",
                "description": "Needs first_frame_image."
              },
              "seed": {
                "type": "integer",
                "minimum": 0,
                "maximum": 4294967295,
                "description": "Random when omitted."
              },
              "generate_audio": {
                "type": "boolean",
                "default": false,
                "description": "Add an audio track; billed at a higher per-second rate."
              },
              "person_generation": {
                "type": "string",
                "enum": [
                  "allow_adult",
                  "disallow"
                ],
                "default": "allow_adult"
              },
              "resize_mode": {
                "type": "string",
                "enum": [
                  "pad",
                  "crop"
                ],
                "default": "pad",
                "description": "Needs first_frame_image."
              },
              "enhance_prompt": {
                "type": "boolean",
                "const": true,
                "default": true,
                "description": "Only true is accepted; omit the field otherwise."
              },
              "nsfw_check": {
                "type": "boolean",
                "default": false,
                "description": "Check the prompt and images for unsafe content before generating."
              }
            },
            "required": [
              "model",
              "prompt"
            ],
            "additionalProperties": false
          }
        ],
        "discriminator": {
          "propertyName": "model"
        }
      },
      "TaskAccepted": {
        "type": "object",
        "required": [
          "id",
          "model",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "enum": [
              "veo-3.1-fast",
              "veo-3.1-quality",
              "veo-3.1-lite",
              "veo-3.1-fast-official",
              "veo-3.1-quality-official"
            ]
          },
          "status": {
            "const": "processing"
          },
          "created_at": {
            "type": "integer"
          }
        }
      },
      "Task": {
        "type": "object",
        "required": [
          "id",
          "model",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "enum": [
              "veo-3.1-fast",
              "veo-3.1-quality",
              "veo-3.1-lite",
              "veo-3.1-fast-official",
              "veo-3.1-quality-official"
            ]
          },
          "status": {
            "enum": [
              "processing",
              "completed",
              "failed"
            ]
          },
          "created_at": {
            "type": "integer"
          },
          "finished_at": {
            "type": "integer"
          },
          "output": {
            "type": "object",
            "properties": {
              "video_url": {
                "type": "string",
                "format": "uri",
                "description": "An MP4, or a GIF when enable_gif was set."
              }
            }
          },
          "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"
          }
        }
      }
    }
  }
}
