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

# Stream text-to-speech audio

> Convert text to speech using ElevenLabs AI voices with streaming for real-time playback. Returns audio data as an MP3 stream for immediate playback with minimal latency. Perfect for legal document narration, client presentations, or accessibility features.



## OpenAPI

````yaml /openapi.json post /voice/v1/speak/stream
openapi: 3.1.0
info:
  title: Case.dev API
  description: >-
    The AI-native platform for legal technology. Build smarter legal
    applications with our suite of AI-powered APIs.
  version: 1.0.0
  contact:
    name: Case.dev Support
    email: support@casemark.com
    url: https://case.dev
  license:
    name: Proprietary
    url: https://case.dev/terms
servers:
  - url: https://api.case.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Vaults
    description: Secure document storage with semantic search and GraphRAG
  - name: Memory
    description: >-
      Persistent memory for AI agents with semantic search and 12 generic
      indexed tag fields
  - name: OCR
    description: Extract text from PDFs, images, and scanned documents
  - name: Voice
    description: Audio transcription and text-to-speech
  - name: LLMs
    description: Access 40+ language models through a unified API
  - name: Search
    description: Web search, AI answers, and deep research
  - name: Mail
    description: Managed inboxes for agent email workflows
  - name: Media
    description: Transcript retrieval and captioned media clip generation
  - name: Legal
    description: Legal research tools including citation verification
  - name: Privilege
    description: Privilege detection for e-discovery and litigation workflows
  - name: Compute
    description: Serverless GPU and CPU infrastructure
  - name: Format
    description: Document formatting and template rendering (MD/JSON to PDF/DOCX)
  - name: SuperDoc
    description: Document conversion and template automation
  - name: Webhooks
    description: Webhook endpoint management
  - name: System
    description: Public system metadata and discovery endpoints
  - name: Usage
    description: Usage reporting and webhook subscriptions
  - name: Database
    description: Serverless PostgreSQL databases with instant branching
  - name: Translation
    description: Language detection and translation for multilingual legal workflows
  - name: Skills
    description: Search and read legal AI skills for agents
  - name: Agents
    description: >-
      Create, manage, and execute AI agents with tool access, sandbox
      environments, and async run workflows
  - name: Matters
    description: Matter-native legal workspaces and orchestration primitives
  - name: Applications Projects
    description: Web application project management
  - name: Applications Deployments
    description: Web application deployment management
  - name: Applications Domains
    description: Custom domain configuration for applications
  - name: Applications Env Vars
    description: Environment variable management for applications
paths:
  /voice/v1/speak/stream:
    post:
      tags:
        - Voice
      summary: Stream text-to-speech audio
      description: >-
        Convert text to speech using ElevenLabs AI voices with streaming for
        real-time playback. Returns audio data as an MP3 stream for immediate
        playback with minimal latency. Perfect for legal document narration,
        client presentations, or accessibility features.
      operationId: streamTextToSpeech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                  description: Text to convert to speech
                  maxLength: 5000
                voice_id:
                  type: string
                  description: >-
                    ElevenLabs voice ID (defaults to Rachel for professional
                    clarity)
                  default: EXAVITQu4vr4xnSDxMaL
                model_id:
                  type: string
                  description: TTS model to use
                  default: eleven_multilingual_v2
                  enum:
                    - eleven_monolingual_v1
                    - eleven_multilingual_v1
                    - eleven_multilingual_v2
                    - eleven_turbo_v2
                voice_settings:
                  type: object
                  description: >-
                    Optional voice tuning controls for delivery, consistency,
                    and emphasis
                  properties:
                    stability:
                      type: number
                      minimum: 0
                      maximum: 1
                      description: Voice stability (0-1)
                    similarity_boost:
                      type: number
                      minimum: 0
                      maximum: 1
                      description: Similarity boost (0-1)
                    style:
                      type: number
                      minimum: 0
                      maximum: 1
                      description: Style exaggeration (0-1)
                    use_speaker_boost:
                      type: boolean
                      description: Enable speaker boost
                language_code:
                  type: string
                  description: Language code (e.g., 'en', 'es', 'fr')
                output_format:
                  type: string
                  description: Audio output format
                  enum:
                    - mp3_44100_128
                    - mp3_22050_32
                    - pcm_16000
                    - pcm_22050
                    - pcm_24000
                    - pcm_44100
                  default: mp3_44100_128
                optimize_streaming_latency:
                  type: integer
                  description: Optimize for streaming latency (0-4)
                  minimum: 0
                  maximum: 4
                seed:
                  type: integer
                  description: Random seed for reproducible generation
                previous_text:
                  type: string
                  description: Previous text for context
                next_text:
                  type: string
                  description: Next text for context
                apply_text_normalization:
                  type: boolean
                  description: Apply text normalization
                  default: true
                enable_logging:
                  type: boolean
                  description: Enable request logging
                  default: true
      responses:
        '200':
          description: Audio stream successfully generated
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
                description: MP3 audio stream
          headers:
            Content-Type:
              description: Audio MIME type
              schema:
                type: string
                example: audio/mpeg
            Transfer-Encoding:
              description: Chunked encoding for streaming
              schema:
                type: string
                example: chunked
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: text is required
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Invalid API key
                  data:
                    type: object
                    properties:
                      code:
                        type: string
                        example: AUTH_INVALID
        '403':
          description: Insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: API key does not have access to voice/TTS service
                  data:
                    type: object
                    properties:
                      code:
                        type: string
                        example: PERMISSION_DENIED
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key starting with `sk_case_`

````