{
  "info": {
    "title": "AtlasCloud API",
    "version": "1.0.0",
    "description": "The AtlasCloud API."
  },
  "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",
            "default": "kwaivgi/kling-v4.0/text-to-video",
            "enum": [
              "kwaivgi/kling-v4.0/text-to-video"
            ],
            "description": "Model name."
          },
          "prompt": {
            "type": "string",
            "default": "A single drop of water falls from the tip of a leaf into a shallow dish, creating concentric ripples; warm window light, macro cinematography, photorealistic.",
            "description": "Text prompt describing the video. Up to 26,000 English characters (11,000 non-English). Can include negative descriptions.",
            "x-ui-component": "textarea"
          },
          "duration": {
            "type": "integer",
            "default": 10,
            "minimum": 3,
            "maximum": 30,
            "step": 1,
            "description": "Length of the generated video in seconds, 3 to 30.",
            "x-ui-component": "slider"
          },
          "aspect_ratio": {
            "type": "string",
            "default": "16:9",
            "enum": [
              "16:9",
              "9:16",
              "1:1",
              "21:9"
            ],
            "description": "Aspect ratio of the output video.",
            "x-ui-component": "select"
          },
          "resolution": {
            "type": "string",
            "default": "1080p",
            "enum": [
              "720p",
              "1080p",
              "4k",
              "1080p-esr",
              "2k-esr",
              "4k-esr"
            ],
            "description": "720p, 1080p and 4k are native Kling outputs. 4k is native Kling 4K output. 1080p-esr enhances a 720p source to 1080p using Tencent ESR; 2k-esr enhances a 1080p source to 1440p (2560×1440 at 16:9); 4k-esr enhances a 1080p source to 4K (3840×2160 at 16:9). Original aspect ratio is preserved. ESR is billed as source generation plus enhancement of output seconds.",
            "x-ui-component": "select"
          },
          "dynamic_range": {
            "type": "string",
            "default": "sdr",
            "enum": [
              "sdr",
              "hdr"
            ],
            "description": "Output dynamic range. hdr produces 10-bit HDR video and is only supported with resolution 1080p or 4k (not 720p or the ESR resolutions). HDR adds a per-output-second charge.",
            "x-ui-component": "select",
            "x-depends-on": {
              "field": "resolution",
              "conditions": [
                {
                  "when": [
                    "1080p",
                    "4k"
                  ],
                  "enum": [
                    "sdr",
                    "hdr"
                  ]
                },
                {
                  "when": [
                    "720p",
                    "1080p-esr",
                    "2k-esr",
                    "4k-esr"
                  ],
                  "enum": [
                    "sdr"
                  ],
                  "default": "sdr",
                  "description": "HDR is only supported at native 1080p or 4k resolution."
                }
              ]
            }
          }
        },
        "x-order-properties": [
          "model",
          "prompt",
          "duration",
          "aspect_ratio",
          "resolution",
          "dynamic_range"
        ]
      },
      "PredictionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the prediction, the ID of the prediction to get."
          },
          "urls": {
            "type": "object",
            "description": "Object containing related API endpoints."
          },
          "model": {
            "type": "string",
            "description": "Model ID used for the prediction."
          },
          "status": {
            "type": "string",
            "description": "Status of the task: created, processing, completed, or failed."
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of URLs to the generated content (empty when status is not completed)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO timestamp of when the request was created."
          },
          "has_nsfw_contents": {
            "type": "array",
            "items": {
              "type": "boolean"
            },
            "description": "Array of boolean values indicating NSFW detection for each output."
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "in": "header",
        "name": "Authorization",
        "type": "apiKey"
      }
    }
  }
}
