{
  "openapi": "3.1.0",
  "info": {
    "title": "1Route Seedance Per-request Video API",
    "version": "1.2.0",
    "description": "Verify key access with GET /v1/models. Prices and limits: /seedance-flat-models.json. No token or per-second billing."
  },
  "servers": [
    {
      "url": "https://video.1route.dev"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/v1/videos": {
      "post": {
        "operationId": "createSeedanceFlatVideo",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt",
                      "seconds"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "const": "seedance-2.0-mini-12s"
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      },
                      "seconds": {
                        "type": "integer",
                        "minimum": 12,
                        "maximum": 12
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "720p"
                        ]
                      },
                      "images": {
                        "type": "array",
                        "minItems": 0,
                        "maxItems": 0,
                        "items": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://"
                        }
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt",
                      "seconds"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "const": "seedance-2.5-30img"
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      },
                      "seconds": {
                        "type": "integer",
                        "minimum": 4,
                        "maximum": 30
                      },
                      "resolution": {
                        "type": "string",
                        "minLength": 1,
                        "default": "720p",
                        "description": "Fixed 720p output tier. Other nonempty resolution strings are normalized to 720p."
                      },
                      "images": {
                        "type": "array",
                        "minItems": 0,
                        "maxItems": 30,
                        "items": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://"
                        }
                      },
                      "audios": {
                        "type": "array",
                        "maxItems": 10,
                        "items": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://[^/?#]+/[^?#]*\\.[mM][pP]3(?:\\?[^#]*)?$"
                        },
                        "description": "MP3 audio references only. URL paths must end in .mp3; signed query parameters are allowed. Renaming a non-MP3 file is insufficient."
                      },
                      "ratio": {
                        "type": "string",
                        "enum": [
                          "16:9",
                          "9:16",
                          "1:1",
                          "4:3",
                          "3:4",
                          "21:9"
                        ]
                      },
                      "face": {
                        "type": "boolean",
                        "default": false,
                        "description": "Enable colored-pencil preprocessing of reference images; acceptance of every face reference is not guaranteed"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt",
                      "seconds",
                      "images"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "const": "seedance-2.0-15s-480p"
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      },
                      "seconds": {
                        "type": "integer",
                        "minimum": 15,
                        "maximum": 15
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "480p"
                        ]
                      },
                      "images": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 9,
                        "items": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://"
                        }
                      },
                      "audios": {
                        "type": "array",
                        "maxItems": 3,
                        "items": {
                          "type": "string",
                          "format": "uri",
                          "pattern": "^https?://[^/?#]+/[^?#]*\\.[mM][pP]3(?:\\?[^#]*)?$"
                        },
                        "description": "MP3 audio references only. URL paths must end in .mp3; signed query parameters are allowed. Renaming a non-MP3 file is insufficient."
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task response. A download URL may not be ready yet.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "queued",
                        "in_progress",
                        "completed",
                        "failed",
                        "expired"
                      ]
                    },
                    "progress": {
                      "type": "number"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error; do not automatically repeat an ambiguous POST"
          }
        }
      }
    },
    "/v1/videos/{id}": {
      "get": {
        "operationId": "retrieveSeedanceFlatVideo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task response. A download URL may not be ready yet.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "queued",
                        "in_progress",
                        "completed",
                        "failed",
                        "expired"
                      ]
                    },
                    "progress": {
                      "type": "number"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error; do not automatically repeat an ambiguous POST"
          }
        }
      }
    },
    "/v1/videos/{id}/content": {
      "get": {
        "operationId": "downloadSeedanceFlatVideo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Prefer the exact signed metadata.url from a completed task, without forwarding a key. This authenticated path is an alternative while the artifact remains available.",
        "responses": {
          "200": {
            "description": "Video bytes",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "410": {
            "description": "Video expired"
          }
        }
      }
    }
  }
}
