> ## Documentation Index
> Fetch the complete documentation index at: https://blackbox.dasha.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Synthesize text to speech

> Converts text to speech audio using the specified voice configuration. Returns MP3 audio
ready for playback or download. Useful for voice preview during agent configuration and
testing voice quality before deployment.



## OpenAPI

````yaml https://blackbox.dasha.ai/swagger/v1/swagger.json post /api/v1/voice/synthesize
openapi: 3.0.4
info:
  title: Dasha BlackBox Agent API
  description: API for managing AI agents and calls
  contact:
    name: DashaAI Team
    email: support@dasha.ai
  version: v1
servers:
  - url: https://blackbox.dasha.ai
    description: Dasha BlackBox Agent API
security:
  - ApiKey: []
  - OAuth: []
tags:
  - name: ActivityLogs
  - name: Agents
  - name: AgentTestCases
  - name: CallResults
  - name: Calls
  - name: Chats
  - name: Copilot
  - name: CustomerData
  - name: Mcp
  - name: Media
  - name: Misc
  - name: PronunciationDictionaries
  - name: Providers
  - name: SipAliases
  - name: SipCredentials
  - name: SipPhoneNumbers
  - name: TextChat
  - name: TwilioProvider
  - name: Voice
  - name: WebhookTest
  - name: WebIntegrations
  - name: WebSocket
    description: WebSocket endpoints for real-time communication
paths:
  /api/v1/voice/synthesize:
    post:
      tags:
        - Voice
      summary: Synthesize text to speech
      description: >-
        Converts text to speech audio using the specified voice configuration.
        Returns MP3 audio

        ready for playback or download. Useful for voice preview during agent
        configuration and

        testing voice quality before deployment.
      requestBody:
        description: Text synthesis configuration
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/TTSSynthesisRequest'
              description: Text-to-speech synthesis request configuration
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/TTSSynthesisRequest'
              description: Text-to-speech synthesis request configuration
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/TTSSynthesisRequest'
              description: Text-to-speech synthesis request configuration
      responses:
        '200':
          description: Returns synthesized audio as MP3 successfully
          content:
            application/json:
              schema:
                type: string
                format: binary
        '400':
          description: Invalid configuration or validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Authentication failed or API key is missing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Access denied to synthesis or voice resources
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '413':
          description: Text content exceeds maximum length
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Server error occurred during synthesis
components:
  schemas:
    TTSSynthesisRequest:
      required:
        - language
        - model
        - provider
        - text
        - voiceId
      type: object
      properties:
        text:
          maxLength: 5000
          minLength: 1
          type: string
          description: Text content to convert to speech
        voiceId:
          minLength: 1
          type: string
          description: >-
            Voice identifier for synthesis. Use a cloned voice ID or public
            voice ID from the available voices.
        model:
          type: string
          description: >-
            TTS model to use for synthesis. Model availability depends on the
            provider.
          nullable: true
        language:
          minLength: 1
          type: string
          description: >-
            Language code for synthesis. Format depends on provider (e.g., "en",
            "en-US").
        speed:
          type: number
          description: >-
            Speech speed multiplier. Value of 1.0 is normal speed, values less
            than 1.0 are slower, values greater than 1.0 are faster.
          format: double
        provider:
          minLength: 1
          type: string
          description: TTS provider name to use for synthesis
        vendorSpecific:
          type: object
          additionalProperties:
            type: string
          description: >-
            Provider-specific configuration options. Each provider supports
            different options. Consult provider documentation for available
            settings.
          nullable: true
        inlinePronunciationRules:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/AliasPronunciationRule'
              - $ref: '#/components/schemas/PhonemePronunciationRule'
            description: >-
              Base class for pronunciation rules that control how specific text
              is spoken during TTS synthesis. Rules use polymorphic
              serialization with a type discriminator to support different
              pronunciation methods (alias or phonetic).
          description: >-
            Inline pronunciation rules for preview support.

            These rules are applied during synthesis without being stored in a
            dictionary.
          nullable: true
        pronunciationDictionaryId:
          type: string
          description: >-
            Pronunciation dictionary ID to use for synthesis.

            When provided, the dictionary rules will be applied during
            synthesis.
          nullable: true
      additionalProperties: false
      description: Text-to-speech synthesis request configuration
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    AliasPronunciationRule:
      allOf:
        - $ref: '#/components/schemas/PronunciationRuleBase'
        - required:
            - alias
            - type
          type: object
          properties:
            type:
              enum:
                - alias
              type: string
              description: >-
                Rule type discriminator indicating this is an alias-based
                pronunciation rule.
              readOnly: true
            alias:
              minLength: 1
              type: string
              description: >-
                Alternative text to speak instead of the matched text. The TTS
                engine will pronounce this replacement text using its natural
                language processing. For example, "HTTP" could be aliased to "H
                T T P" for letter-by-letter pronunciation, or "SQL" to "sequel"
                for word pronunciation.
          additionalProperties: false
      description: >-
        Alias pronunciation rule that replaces matched text with alternative
        text during TTS synthesis. Useful for expanding acronyms, replacing
        technical terms with pronounceable alternatives, or substituting brand
        names with phonetic spellings. The TTS engine will then pronounce the
        alias text naturally.
    PhonemePronunciationRule:
      allOf:
        - $ref: '#/components/schemas/PronunciationRuleBase'
        - required:
            - phoneme
            - type
          type: object
          properties:
            type:
              enum:
                - phoneme
              type: string
              description: >-
                Rule type discriminator indicating this is a phoneme-based
                pronunciation rule.
              readOnly: true
            phoneme:
              type: array
              items:
                type: string
              description: >-
                List of phoneme symbols representing how the text should be
                pronounced. Each string in the list is a phoneme from the
                specified phonetic alphabet. The TTS engine will synthesize
                these phonemes directly, bypassing its natural language
                processing for precise pronunciation control.
            alphabet:
              type: string
              description: >-
                Phonetic alphabet system used for the phoneme symbols. Supported
                values vary by provider but commonly include "ipa"
                (International Phonetic Alphabet). When not specified, the
                provider's default alphabet is used.
              nullable: true
          additionalProperties: false
      description: >-
        Phoneme pronunciation rule that specifies exact phonetic pronunciation
        for matched text using phonetic alphabet symbols. Provides precise
        control over pronunciation, useful for words that TTS engines commonly
        mispronounce, foreign words, or specialized terminology requiring
        specific pronunciation.
    PronunciationRuleBase:
      required:
        - text
        - type
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/PronunciationRuleType'
          description: >-
            Rule type discriminator determining the pronunciation method.
            Supported values: alias (text replacement), phoneme (phonetic
            representation).
          readOnly: true
        text:
          minLength: 1
          type: string
          description: >-
            Word or phrase to match in the input text. When this text is
            encountered during TTS synthesis, it will be pronounced according to
            the rule's pronunciation specification. Matching is typically
            case-insensitive.
      additionalProperties: false
      description: >-
        Base class for pronunciation rules that control how specific text is
        spoken during TTS synthesis. Rules use polymorphic serialization with a
        type discriminator to support different pronunciation methods (alias or
        phonetic).
    PronunciationRuleType:
      enum:
        - unspecified
        - alias
        - phoneme
      type: string
      description: >-
        Pronunciation rule type determining how matched text is pronounced
        during TTS synthesis. Each type uses a different method to specify
        pronunciation: alias substitutes alternative text, while phoneme uses
        phonetic symbols for precise pronunciation control.
  securitySchemes:
    ApiKey:
      type: http
      description: API Key Authentication (Bearer {key})
      scheme: Bearer
    OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://auth.dasha.ai/connect/authorize
          scopes:
            platform_api: Platform API

````