{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/distribea-com/json-schema/distribea-com-models-response-schema.json",
  "title": "ModelsResponse",
  "description": "Read `type` first: it says which model schema the `models` items follow.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/distribea-com-openapi.json#/components/schemas/ModelsResponse",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "type",
        "count",
        "models"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "image"
        },
        "count": {
          "type": "integer"
        },
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ImageModel"
          }
        },
        "generate_with": {
          "type": "string",
          "const": "POST /api/v1/generate/image"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "type",
        "count",
        "models"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "video"
        },
        "count": {
          "type": "integer"
        },
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/VideoModel"
          }
        },
        "generate_with": {
          "type": "string",
          "const": "POST /api/v1/generate/video"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "type",
        "count",
        "models"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "music"
        },
        "count": {
          "type": "integer"
        },
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MusicModel"
          }
        },
        "generate_with": {
          "type": "string",
          "const": "POST /api/v1/generate/music"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "type",
        "count",
        "models"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "voice"
        },
        "count": {
          "type": "integer"
        },
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/VoiceModel"
          }
        },
        "generate_with": {
          "type": "string",
          "const": "POST /api/v1/generate/voice"
        }
      }
    }
  ],
  "$defs": {
    "ImageModel": {
      "type": "object",
      "required": [
        "id",
        "label",
        "tier",
        "qualities",
        "aspect_ratios",
        "max_images",
        "price_credits"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Pass it as `model`."
        },
        "label": {
          "type": "string"
        },
        "tagline": {
          "type": "string"
        },
        "tier": {
          "type": "string",
          "enum": [
            "fast",
            "premium"
          ]
        },
        "price_credits": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Starting price for one default output. `dry_run` gives the exact price."
        },
        "qualities": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pass one as `quality`."
        },
        "aspect_ratios": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pass one as `aspect_ratio`."
        },
        "max_images": {
          "type": "integer",
          "description": "Upper bound for `count`."
        }
      }
    },
    "MusicModel": {
      "type": "object",
      "required": [
        "id",
        "label",
        "tier",
        "durations_seconds",
        "price_credits"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Pass it as `model`."
        },
        "label": {
          "type": "string"
        },
        "tagline": {
          "type": "string"
        },
        "tier": {
          "type": "string",
          "enum": [
            "fast",
            "premium"
          ]
        },
        "price_credits": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Starting price for one default output. `dry_run` gives the exact price."
        },
        "durations_seconds": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Pass one as `duration_seconds`. Empty: the model picks the length."
        },
        "default_duration_seconds": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "VideoModel": {
      "type": "object",
      "required": [
        "id",
        "label",
        "tier",
        "durations_seconds",
        "resolutions",
        "aspect_ratios",
        "price_credits"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Pass it as `model`."
        },
        "label": {
          "type": "string"
        },
        "tagline": {
          "type": "string"
        },
        "tier": {
          "type": "string",
          "enum": [
            "fast",
            "premium"
          ]
        },
        "price_credits": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Starting price for one default output. `dry_run` gives the exact price."
        },
        "durations_seconds": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Pass one as `duration_seconds`. Empty: the model picks the length."
        },
        "default_duration_seconds": {
          "type": [
            "integer",
            "null"
          ]
        },
        "resolutions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pass one as `resolution`."
        },
        "aspect_ratios": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pass one as `aspect_ratio`."
        }
      }
    },
    "VoiceModel": {
      "type": "object",
      "required": [
        "id",
        "label",
        "tier",
        "languages",
        "sample_voices",
        "price_credits"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Pass it as `model`."
        },
        "label": {
          "type": "string"
        },
        "tagline": {
          "type": "string"
        },
        "tier": {
          "type": "string",
          "enum": [
            "fast",
            "premium"
          ]
        },
        "price_credits": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Starting price for one default output. `dry_run` gives the exact price."
        },
        "languages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pass one as `language`."
        },
        "voice_count": {
          "type": "integer"
        },
        "sample_voices": {
          "type": "array",
          "description": "Pass an `id` as `voice`.",
          "items": {
            "type": "object",
            "required": [
              "id",
              "name"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "gender": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}