{
  "openapi": "3.1.0",
  "info": {
    "title": "SANTO VIDEO API",
    "version": "1.0.0",
    "description": "Create AI videos, images and audio with SANTO VIDEO. Guides: https://santovideo.io/developers/",
    "contact": {
      "name": "SANTO VIDEO",
      "url": "https://santovideo.io/developers/"
    }
  },
  "servers": [
    {
      "url": "https://api.santovideo.io/v1"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "externalDocs": {
    "url": "https://santovideo.io/developers/"
  },
  "paths": {
    "/generations": {
      "post": {
        "operationId": "createGeneration",
        "summary": "Start a generation",
        "description": "Send either {model, …} (text to video) or {service, tier, inputs, …} (any SANTO service). URL inputs are copied into your uploads first. Charges the cost when the generation starts; refunded automatically if it fails. Requires generations:write.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "description": "Reuse on retries: the same key and body return the original generation without a second charge; the same key with another body returns 409. Use a new key for every new video."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "description": "A model id from GET /models.",
                        "examples": [
                          "seedance-2.5"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 5000,
                        "description": "What the video shows."
                      },
                      "duration": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Seconds, within the model's range. Default: the model's shortest."
                      },
                      "resolution": {
                        "type": "string",
                        "description": "One of the model's resolutions. Default: the model's lowest.",
                        "examples": [
                          "720p"
                        ]
                      },
                      "aspect_ratio": {
                        "type": "string",
                        "enum": [
                          "16:9",
                          "9:16",
                          "1:1",
                          "4:3",
                          "3:4",
                          "21:9"
                        ],
                        "default": "16:9"
                      },
                      "audio": {
                        "type": "boolean",
                        "default": false
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "service"
                    ],
                    "properties": {
                      "service": {
                        "type": "string",
                        "description": "A service id from GET /services.",
                        "examples": [
                          "video",
                          "face-swap",
                          "lipsync",
                          "image",
                          "music"
                        ]
                      },
                      "tier": {
                        "type": "string",
                        "enum": [
                          "standard",
                          "pro"
                        ],
                        "default": "standard"
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 5000,
                        "description": "What to make or change. Required for services that take no input file."
                      },
                      "duration": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 600,
                        "description": "Seconds, within the service's range (per-second services only). Default: the shortest."
                      },
                      "aspect_ratio": {
                        "type": "string",
                        "enum": [
                          "16:9",
                          "9:16",
                          "1:1",
                          "21:9"
                        ],
                        "description": "Only for services that list aspect ratios. Default: the first one."
                      },
                      "audio": {
                        "type": "boolean",
                        "default": false
                      },
                      "inputs": {
                        "type": "array",
                        "maxItems": 8,
                        "items": {
                          "$ref": "#/components/schemas/Input"
                        }
                      },
                      "params": {
                        "type": "object",
                        "description": "Service options (short strings, numbers or booleans), e.g. script, effect, language, voiceId.",
                        "additionalProperties": {
                          "type": [
                            "string",
                            "number",
                            "boolean"
                          ]
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replay of an earlier request with the same Idempotency-Key (header Idempotent-Replayed: true)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "201": {
            "description": "Started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Not enough credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the needed permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily credit limit reached (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Maintenance or no capacity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listGenerations",
        "summary": "List generations",
        "description": "Newest first. Requires generations:read.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The last id of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of generations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data",
                    "has_more"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Generation"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the needed permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily credit limit reached (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/generations/{id}": {
      "get": {
        "operationId": "getGeneration",
        "summary": "Get a generation",
        "description": "Requires generations:read.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "wait",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 25,
              "default": 0
            },
            "description": "Wait up to this many seconds for the generation to finish."
          }
        ],
        "responses": {
          "200": {
            "description": "The generation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the needed permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No generation with this id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily credit limit reached (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/estimates": {
      "post": {
        "operationId": "createEstimate",
        "summary": "Price a generation without starting it",
        "description": "Same body as POST /generations (URL inputs are not downloaded). Requires models:read.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "description": "A model id from GET /models.",
                        "examples": [
                          "seedance-2.5"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 5000,
                        "description": "What the video shows."
                      },
                      "duration": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Seconds, within the model's range. Default: the model's shortest."
                      },
                      "resolution": {
                        "type": "string",
                        "description": "One of the model's resolutions. Default: the model's lowest.",
                        "examples": [
                          "720p"
                        ]
                      },
                      "aspect_ratio": {
                        "type": "string",
                        "enum": [
                          "16:9",
                          "9:16",
                          "1:1",
                          "4:3",
                          "3:4",
                          "21:9"
                        ],
                        "default": "16:9"
                      },
                      "audio": {
                        "type": "boolean",
                        "default": false
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "service"
                    ],
                    "properties": {
                      "service": {
                        "type": "string",
                        "description": "A service id from GET /services.",
                        "examples": [
                          "video",
                          "face-swap",
                          "lipsync",
                          "image",
                          "music"
                        ]
                      },
                      "tier": {
                        "type": "string",
                        "enum": [
                          "standard",
                          "pro"
                        ],
                        "default": "standard"
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 5000,
                        "description": "What to make or change. Required for services that take no input file."
                      },
                      "duration": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 600,
                        "description": "Seconds, within the service's range (per-second services only). Default: the shortest."
                      },
                      "aspect_ratio": {
                        "type": "string",
                        "enum": [
                          "16:9",
                          "9:16",
                          "1:1",
                          "21:9"
                        ],
                        "description": "Only for services that list aspect ratios. Default: the first one."
                      },
                      "audio": {
                        "type": "boolean",
                        "default": false
                      },
                      "inputs": {
                        "type": "array",
                        "maxItems": 8,
                        "items": {
                          "$ref": "#/components/schemas/Input"
                        }
                      },
                      "params": {
                        "type": "object",
                        "description": "Service options (short strings, numbers or booleans), e.g. script, effect, language, voiceId.",
                        "additionalProperties": {
                          "type": [
                            "string",
                            "number",
                            "boolean"
                          ]
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The price",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Estimate"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the needed permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily credit limit reached (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List video models",
        "description": "Requires models:read.",
        "responses": {
          "200": {
            "description": "Models",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Model"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the needed permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily credit limit reached (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/services": {
      "get": {
        "operationId": "listServices",
        "summary": "List every SANTO service",
        "description": "Inputs, durations, aspect ratios and credit prices per tier. Requires models:read.",
        "responses": {
          "200": {
            "description": "Services",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Service"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the needed permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily credit limit reached (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/uploads": {
      "post": {
        "operationId": "createUpload",
        "summary": "Get a one-time upload URL for an input file",
        "description": "Reserves the file in your storage quota. PUT the file to upload_url (with its Content-Type), then use path in inputs. Requires generations:write.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "filename",
                  "content_type",
                  "size"
                ],
                "properties": {
                  "filename": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "content_type": {
                    "type": "string",
                    "pattern": "^(image|video|audio)/",
                    "examples": [
                      "image/png",
                      "video/mp4",
                      "audio/mpeg"
                    ]
                  },
                  "size": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 209715200,
                    "description": "Bytes. Storage also applies its per-file limit and your plan quota."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Upload URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the needed permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "File too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily credit limit reached (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account": {
      "get": {
        "operationId": "getAccount",
        "summary": "Balance and this key's daily usage",
        "description": "Requires account:read.",
        "responses": {
          "200": {
            "description": "Account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the needed permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily credit limit reached (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "svk_live_…",
        "description": "Create keys in SANTO → Developers → Keys and apps."
      }
    },
    "schemas": {
      "Generation": {
        "type": "object",
        "required": [
          "id",
          "object",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "generation"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "succeeded",
              "failed"
            ]
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "model": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "resolution": {
            "type": "string"
          },
          "aspect_ratio": {
            "type": "string"
          },
          "audio": {
            "type": "boolean"
          },
          "cost_credits": {
            "type": "integer"
          },
          "credits_status": {
            "type": "string",
            "enum": [
              "reserved",
              "charged",
              "refunded",
              "on_hold"
            ]
          },
          "video_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Private link, valid until video_url_expires_at (6 hours)."
          },
          "video_url_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "service": {
            "type": "string"
          },
          "tier": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "video",
              "image",
              "audio"
            ]
          },
          "output_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The result (any kind), valid until output_url_expires_at."
          },
          "output_url_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "app",
              "api",
              "mcp"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Estimate": {
        "type": "object",
        "properties": {
          "object": {
            "const": "estimate"
          },
          "model": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "tier": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "resolution": {
            "type": "string"
          },
          "aspect_ratio": {
            "type": "string"
          },
          "audio": {
            "type": "boolean"
          },
          "cost_credits": {
            "type": "integer"
          },
          "balance": {
            "type": "integer"
          },
          "enough_credits": {
            "type": "boolean"
          }
        }
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "model"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "const": "video"
          },
          "available": {
            "type": "boolean"
          },
          "resolutions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "duration_seconds": {
            "type": "object",
            "properties": {
              "min": {
                "type": "integer"
              },
              "max": {
                "type": "integer"
              }
            }
          },
          "aspect_ratios": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "credits_per_second": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          }
        }
      },
      "Input": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "role"
        ],
        "description": "Exactly one of path or url.",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "first_frame",
              "last_frame",
              "middle_frame",
              "ref_image",
              "face",
              "product",
              "person",
              "garment",
              "video",
              "audio"
            ]
          },
          "path": {
            "type": "string",
            "description": "A path from POST /uploads (or one of your results)."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "A public https URL (no IP addresses, ports or private hosts); image, video or audio up to 200 MB."
          }
        }
      },
      "Service": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "service"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "video",
              "image",
              "audio",
              "element"
            ]
          },
          "unit": {
            "type": "string",
            "enum": [
              "second",
              "item",
              "kchar"
            ]
          },
          "duration_seconds": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "min": {
                "type": "integer"
              },
              "max": {
                "type": "integer"
              }
            }
          },
          "aspect_ratios": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "required_inputs": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Each inner list: at least one input with one of these roles."
          },
          "input_roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "min_credits": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tiers": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "credits_per_unit": {
                  "type": "number"
                },
                "resolution": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "live": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "Upload": {
        "type": "object",
        "properties": {
          "object": {
            "const": "upload"
          },
          "path": {
            "type": "string"
          },
          "upload_url": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "const": "PUT"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "expires_in": {
            "type": "integer",
            "description": "Seconds."
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "object": {
            "const": "account"
          },
          "credits": {
            "type": "integer"
          },
          "plan": {
            "type": "string"
          },
          "daily_credit_limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "credits_used_today": {
            "type": "integer"
          },
          "caller": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "api_key",
                  "oauth_app"
                ]
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "type",
              "code",
              "message",
              "request_id"
            ],
            "properties": {
              "type": {
                "type": "string"
              },
              "code": {
                "type": "string",
                "description": "Stable, machine-readable."
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "docs": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}