{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ditto-audio/json-schema/ditto-audio-create-custom-voice-dto-schema.json",
  "title": "CreateCustomVoiceDto",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ditto-audio-openapi.json#/components/schemas/CreateCustomVoiceDto",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "engine": {
      "type": "string",
      "enum": [
        "piper",
        "xtts",
        "kokoro",
        "pocket",
        "rvc",
        "system",
        "morpho"
      ],
      "description": "xtts (default) or rvc. RVC voices persist model.onnx + model.pth."
    },
    "sourceHash": {
      "type": "string",
      "description": "sha-256 of the source model.pth (for an in-browser pth→onnx voice). Stored so a future client can skip re-converting via GET /models/custom/by-source/:hash."
    },
    "baseSlug": {
      "type": "string",
      "description": "base XTTS voice to overlay (omit for a full self-contained bundle)"
    },
    "files": {
      "description": "the files to upload (full-bundle mode)",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomVoiceFileDto"
      }
    },
    "language": {
      "type": "string"
    },
    "sampleRate": {
      "type": "number"
    },
    "description": {
      "type": "string"
    },
    "gender": {
      "type": "string",
      "enum": [
        "female",
        "male",
        "neutral"
      ]
    },
    "age": {
      "type": "string",
      "enum": [
        "young",
        "middle-aged",
        "older"
      ]
    },
    "accent": {
      "type": "string"
    },
    "styles": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "useCases": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "name"
  ],
  "$defs": {
    "CustomVoiceFileDto": {
      "type": "object",
      "properties": {
        "fileName": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "enum": [
            "model",
            "config",
            "vocab",
            "speakers",
            "index",
            "sample",
            "archive",
            "other"
          ]
        },
        "contentHash": {
          "type": "string",
          "description": "sha-256 of the file — drives dedup (skip re-upload if present)"
        },
        "sizeBytes": {
          "type": "number"
        }
      },
      "required": [
        "fileName",
        "contentHash"
      ]
    }
  }
}