{
  "info": {
    "title": "AtlasCloud API",
    "version": "1.0.0",
    "description": "The AtlasCloud API."
  },
  "paths": {
    "/api/v1/model/generateVideo": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictionResponse"
                }
              }
            },
            "description": "The request status."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Input"
              }
            }
          },
          "required": true
        }
      },
      "x-api-name": "model_run"
    },
    "/api/v1/model/prediction/{request_id}": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictionResponse"
                }
              }
            },
            "description": "Result of the request."
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "request_id",
            "schema": {
              "type": "string",
              "description": "Request ID"
            },
            "required": true
          }
        ]
      },
      "x-api-name": "model_result"
    }
  },
  "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": "xai/grok-imagine-video-v1.5/text-to-video"
          },
          "prompt": {
            "type": "string",
            "description": "Natural-language description of the video to generate, including subject, motion, camera work, and audio direction. Native synchronized audio is generated in the same pass."
          },
          "duration": {
            "type": "integer",
            "default": 8,
            "minimum": 1,
            "maximum": 15,
            "description": "Length of generated video in seconds. Range: 1–15."
          },
          "resolution": {
            "type": "string",
            "default": "720p",
            "enum": [
              "480p",
              "720p",
              "1080p"
            ],
            "description": "Output resolution."
          },
          "aspect_ratio": {
            "type": "string",
            "default": "16:9",
            "enum": [
              "1:1",
              "16:9",
              "9:16",
              "4:3",
              "3:4",
              "3:2",
              "2:3"
            ],
            "description": "Output aspect ratio."
          }
        },
        "x-order-properties": [
          "model",
          "prompt",
          "duration",
          "resolution",
          "aspect_ratio"
        ]
      },
      "PredictionResponse": {
        "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 of the task: created, processing, completed, or failed."
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of URLs to the generated video (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"
      }
    }
  }
}
