{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cliponit-app/json-schema/cliponit-app-subtitles-schema.json",
  "title": "Subtitles",
  "description": "Burned-in subtitles. All fields except the required ones have defaults and are always returned by `getClip`.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cliponit-app-openapi.yml#/components/schemas/Subtitles",
  "type": "object",
  "required": [
    "enabled",
    "color",
    "case",
    "lang"
  ],
  "properties": {
    "enabled": {
      "type": "boolean"
    },
    "color": {
      "type": "string",
      "enum": [
        "yellow",
        "white",
        "green",
        "cyan",
        "pink",
        "orange",
        "rainbow"
      ],
      "description": "Accent colour (current word in karaoke, text otherwise)"
    },
    "case": {
      "type": "string",
      "enum": [
        "normal",
        "upper",
        "lower"
      ]
    },
    "lang": {
      "type": "string",
      "default": "original",
      "description": "`original` or an ISO 639-1 code (`en`, `es`…) to translate — requires `translate` in the plan"
    },
    "overrides": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SubtitleOverride"
      },
      "default": []
    },
    "style": {
      "type": "string",
      "enum": [
        "karaoke",
        "boxed",
        "outline",
        "glow",
        "minimal"
      ],
      "default": "karaoke"
    },
    "font": {
      "type": "string",
      "enum": [
        "Inter",
        "Montserrat",
        "Bangers",
        "Poppins",
        "Arial"
      ],
      "default": "Inter"
    },
    "position": {
      "type": "string",
      "enum": [
        "bottom",
        "middle",
        "top"
      ],
      "default": "bottom"
    },
    "size": {
      "type": "integer",
      "enum": [
        1,
        2,
        3
      ],
      "default": 2,
      "description": "52/64/80 px in 9:16 (×7/8 in 16:9)"
    },
    "words_per_line": {
      "type": "integer",
      "minimum": 3,
      "maximum": 8,
      "default": 5
    },
    "animate": {
      "type": "boolean",
      "default": false,
      "description": "Pop ×1.10 on the current word"
    },
    "hook": {
      "$ref": "#/$defs/Hook"
    }
  },
  "$defs": {
    "Hook": {
      "type": "object",
      "description": "Title card burned at the top of the frame during the first `duration_s` seconds.",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": false
        },
        "text": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 120,
          "description": "null = the clip title"
        },
        "duration_s": {
          "type": "number",
          "minimum": 0.5,
          "maximum": 10,
          "default": 2.5
        },
        "style": {
          "type": "string",
          "enum": [
            "card",
            "plain"
          ],
          "default": "card"
        }
      }
    },
    "SubtitleOverride": {
      "type": "object",
      "required": [
        "start",
        "end",
        "text"
      ],
      "description": "Replaces the transcript text for a range (absolute seconds). Requires `edit_captions`.",
      "properties": {
        "start": {
          "type": "number"
        },
        "end": {
          "type": "number"
        },
        "text": {
          "type": "string"
        }
      }
    }
  }
}