{
  "info": {
    "title": "AtlasCloud API",
    "version": "1.0.0",
    "description": "Seedance 2.5 Flash text-to-video with optional post-generation 720p and 1080p enhancement."
  },
  "paths": {
    "/api/v1/model/prediction/{request_id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "request_id",
            "required": true,
            "schema": {
              "description": "Request ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictionResponse"
                }
              }
            },
            "description": "Result of the request."
          }
        }
      },
      "x-api-name": "model_result"
    },
    "/api/v1/model/generateVideo": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Input"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictionResponse"
                }
              }
            },
            "description": "The request status."
          }
        }
      },
      "x-api-name": "model_run"
    }
  },
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://api.atlascloud.ai"
    }
  ],
  "components": {
    "schemas": {
      "Input": {
        "type": "object",
        "required": [
          "model",
          "prompt"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "Model name.",
            "default": "bytedance/seedance-2.5-flash/text-to-video"
          },
          "prompt": {
            "type": "string",
            "default": "A golden retriever running on a sunny beach, waves crashing in the background, cinematic lighting",
            "description": "Text prompt describing the desired video. Supports Chinese and English. Recommended length: Chinese < 500 characters, English < 1000 words."
          },
          "duration": {
            "type": "integer",
            "default": 5,
            "enum": [
              -1,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              14,
              15,
              16,
              17,
              18,
              19,
              20,
              21,
              22,
              23,
              24,
              25,
              26,
              27,
              28,
              29,
              30
            ],
            "description": "Video duration in seconds (4-30), or -1 for model to choose automatically.",
            "x-ui-component": "slider"
          },
          "resolution": {
            "type": "string",
            "default": "720p",
            "enum": [
              "480p",
              "720p",
              "720p-esr",
              "1080p-esr"
            ],
            "description": "480p and 720p are native outputs. 720p-esr generates a native 480p source and enhances it to a 720-pixel short edge. 1080p-esr generates a native 720p source and enhances it to a 1080-pixel short edge. Both ESR tiers are enhanced delivery, not native generation at the delivery resolution; source tokens determine billing."
          },
          "ratio": {
            "type": "string",
            "default": "adaptive",
            "enum": [
              "16:9",
              "4:3",
              "1:1",
              "3:4",
              "9:16",
              "21:9",
              "adaptive"
            ],
            "description": "Aspect ratio. 'adaptive' automatically selects based on prompt context."
          },
          "generate_audio": {
            "type": "boolean",
            "default": true,
            "description": "Whether to generate synchronized audio (voice, sound effects, background music)."
          },
          "watermark": {
            "type": "boolean",
            "default": false,
            "description": "Whether to add a watermark."
          },
          "return_last_frame": {
            "type": "boolean",
            "default": false,
            "description": "Whether to return the last frame as a separate image."
          },
          "output_format": {
            "type": "string",
            "default": "mp4",
            "enum": [
              "mp4",
              "mov"
            ],
            "description": "Output video container format. 'mp4' is the default; 'mov' encodes yuv444p for higher color fidelity, suited to multi-round editing/extension pipelines where recompression loss accumulates."
          }
        },
        "x-order-properties": [
          "model",
          "prompt",
          "duration",
          "resolution",
          "ratio",
          "output_format",
          "generate_audio",
          "watermark",
          "return_last_frame"
        ]
      },
      "PredictionData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the prediction."
          },
          "urls": {
            "type": "object",
            "description": "Object containing related API endpoints."
          },
          "model": {
            "type": "string",
            "description": "Model ID used for the prediction."
          },
          "status": {
            "type": "string",
            "description": "Status: processing, completed, failed, or timeout."
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "URLs to generated content (video + optional last frame)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO timestamp of creation."
          },
          "completion_tokens": {
            "type": "integer",
            "description": "Tokens consumed for billing."
          },
          "total_tokens": {
            "type": "integer",
            "description": "Total tokens consumed."
          },
          "has_nsfw_contents": {
            "type": "array",
            "items": {
              "type": "boolean"
            },
            "description": "NSFW detection per output."
          }
        }
      },
      "PredictionResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/PredictionData"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "in": "header",
        "name": "Authorization",
        "type": "apiKey"
      }
    }
  }
}
