{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatra-ai/json-schema/beatra-ai-voice-list-schema.json",
  "title": "VoiceList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beatra-ai-voices-api-openapi.yml#/components/schemas/VoiceList",
  "properties": {
    "object": {
      "type": "string",
      "const": "list",
      "title": "Object",
      "default": "list"
    },
    "data": {
      "items": {
        "$ref": "#/$defs/Voice"
      },
      "type": "array",
      "title": "Data"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Cursor",
      "description": "voice_id of the last voice in this page. Null when there is no next page"
    },
    "total_count": {
      "type": "integer",
      "title": "Total Count",
      "description": "Number of voices that match the filters, across every page",
      "default": 0
    }
  },
  "type": "object",
  "required": [
    "data"
  ],
  "$defs": {
    "Voice": {
      "properties": {
        "voice_id": {
          "type": "string",
          "title": "Voice Id",
          "description": "Opaque beatra voice handle"
        },
        "display_name": {
          "type": "string",
          "title": "Display Name"
        },
        "category": {
          "type": "string",
          "enum": [
            "preset",
            "cloned"
          ],
          "title": "Category"
        },
        "language": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Language"
        },
        "languages_supported": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Languages Supported"
        },
        "gender": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "male",
                "female",
                "neutral"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Gender"
        },
        "age_group": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Age Group",
          "description": "Age group: child, youth, adult, or senior"
        },
        "accent": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Accent"
        },
        "use_case": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Use Case"
        },
        "persona": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Persona",
          "description": "Short description of how the voice sounds and where it fits"
        },
        "preview_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Preview Url"
        },
        "preview_url_scene": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Preview Url Scene",
          "description": "Scene sample URL. Null until a sample has been published"
        },
        "compatible_models": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Compatible Models",
          "description": "Models this voice currently resolves on (informational; 'auto' always works)"
        },
        "status": {
          "type": "string",
          "enum": [
            "processing",
            "ready",
            "failed",
            "pending_activation",
            "expired"
          ],
          "title": "Status",
          "default": "ready"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "preview": {
          "anyOf": [
            {
              "$ref": "#/$defs/VoicePreview"
            },
            {
              "type": "null"
            }
          ]
        },
        "activation": {
          "anyOf": [
            {
              "$ref": "#/$defs/VoiceActivation"
            },
            {
              "type": "null"
            }
          ]
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expires At"
        },
        "clone_model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Clone Model"
        }
      },
      "type": "object",
      "required": [
        "voice_id",
        "display_name",
        "category"
      ],
      "title": "Voice"
    },
    "VoiceActivation": {
      "properties": {
        "required": {
          "type": "boolean",
          "title": "Required"
        },
        "price_credits": {
          "type": "integer",
          "title": "Price Credits"
        },
        "quote": {
          "anyOf": [
            {
              "$ref": "#/$defs/VoiceActivationQuote"
            },
            {
              "type": "null"
            }
          ],
          "description": "The activation quote, on the clone task's result. Show the price and terms to the user and, with their consent, call activate once with quote.confirmation_token and confirm_credits = price_credits (valid for 24 hours; without a token, activate returns a new quote)."
        }
      },
      "type": "object",
      "required": [
        "required",
        "price_credits"
      ],
      "title": "VoiceActivation",
      "description": "What it costs to make a preview voice usable for speech."
    },
    "VoiceActivationQuote": {
      "properties": {
        "voice_id": {
          "type": "string",
          "title": "Voice Id"
        },
        "price_credits": {
          "type": "integer",
          "title": "Price Credits"
        },
        "balance_credits": {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
          "title": "Balance Credits"
        },
        "sufficient_balance": {
          "type": "boolean",
          "title": "Sufficient Balance"
        },
        "preview": {
          "anyOf": [
            {
              "$ref": "#/$defs/VoicePreview"
            },
            {
              "type": "null"
            }
          ]
        },
        "confirmation_token": {
          "type": "string",
          "title": "Confirmation Token"
        },
        "token_expires_at": {
          "type": "string",
          "format": "date-time",
          "title": "Token Expires At"
        },
        "terms_version": {
          "type": "string",
          "title": "Terms Version"
        },
        "terms": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": "object",
          "title": "Terms",
          "description": "The activation terms in zh, en and ja"
        },
        "message": {
          "type": "string",
          "title": "Message"
        }
      },
      "type": "object",
      "required": [
        "voice_id",
        "price_credits",
        "balance_credits",
        "sufficient_balance",
        "confirmation_token",
        "token_expires_at",
        "terms_version",
        "terms",
        "message"
      ],
      "title": "VoiceActivationQuote",
      "description": "The price of activating one preview voice. Nothing is charged until it is confirmed."
    },
    "VoicePreview": {
      "properties": {
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        },
        "language": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Language"
        },
        "version": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Version"
        }
      },
      "type": "object",
      "title": "VoicePreview",
      "description": "The stored preview of a cloned voice that is not yet activated."
    }
  }
}