{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sunbird-ai/json-schema/sunbird-ai-speech-request-schema.json",
  "title": "SpeechRequest",
  "description": "Text-to-speech request for the RunPod Orpheus-3B endpoint.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/sunbird-ai-api-openapi.json#/components/schemas/SpeechRequest",
  "properties": {
    "text": {
      "type": "string",
      "minLength": 1,
      "title": "Text",
      "description": "Text to synthesize."
    },
    "voice": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Voice",
      "description": "Speaker name (see GET /tasks/voice/speakers); requires `language`, since names are scoped per language. If omitted, a speaker is chosen for `language` (Luganda by default). Legacy speaker ids (e.g. 'salt_lug_0001') are still accepted with a deprecation warning."
    },
    "response_mode": {
      "$ref": "#/$defs/TTSResponseMode",
      "description": "url (signed GCS URL), stream (raw audio bytes from RunPod), or both (raw audio bytes with the signed URL in the X-Audio-Url header).",
      "default": "url"
    },
    "language": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Language",
      "description": "ISO 639-3 code (e.g. 'lug')."
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Temperature",
      "description": "Sampling knob."
    },
    "top_p": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top P",
      "description": "Sampling knob."
    },
    "repetition_penalty": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Repetition Penalty",
      "description": "Sampling knob."
    },
    "max_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Tokens",
      "description": "Max tokens per chunk."
    },
    "seed": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Seed",
      "description": "Deterministic seed."
    }
  },
  "type": "object",
  "required": [
    "text"
  ],
  "$defs": {
    "TTSResponseMode": {
      "type": "string",
      "enum": [
        "url",
        "stream",
        "both"
      ],
      "title": "TTSResponseMode",
      "description": "How the TTS endpoint returns audio.\n\n- `url` — return a signed URL once generation completes\n- `stream` — stream audio chunks directly to the client\n- `both` — stream audio chunks and return a signed URL at the end"
    }
  }
}