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

# Stream a design preview

> Generate one temporary voice preview and stream its audio while it is being created.



## OpenAPI

````yaml /openapi.json post /v1/voice-previews/design/stream
openapi: 3.1.0
info:
  title: Breeze Developer API
  description: >-
    Breeze Developer API for models, voices, text-to-speech, history, balance,
    usage, and browser-managed API keys.
  version: 1.0.0
servers:
  - url: https://api.breeze.blue
security: []
tags:
  - name: Models
    description: Supported TTS models.
  - name: Text to Speech
    description: Text-to-speech synthesis and instruction enhancement.
  - name: Voices
    description: Saved voices and voice settings.
  - name: Voice Previews
    description: Create, audition, and save temporary voice previews.
  - name: Account
    description: Balance, usage, and API keys.
  - name: History
    description: Generated audio history.
paths:
  /v1/voice-previews/design/stream:
    post:
      tags:
        - Voice Previews
      summary: Stream a design preview
      description: >-
        Generate one temporary voice preview and stream its audio while it is
        being created.
      operationId: voice_previews_design_stream
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoiceDesignStreamRequest'
        required: true
      responses:
        '200':
          description: >-
            Live 24 kHz mono signed 16-bit little-endian PCM audio. A clean EOF
            means the preview is persisted and can be saved.
          content:
            audio/pcm:
              schema:
                type: string
                format: binary
          headers:
            history-item-id:
              description: History item ID for the generated audio.
              schema:
                type: string
            generated-voice-id:
              description: >-
                Temporary generated voice ID. It can be saved after the stream
                finishes cleanly.
              schema:
                type: string
            x-breeze-audio-codec:
              description: Audio codec. Fixed to pcm_s16le.
              schema:
                type: string
                enum:
                  - pcm_s16le
            x-breeze-sample-rate:
              description: Audio sample rate in hertz. Fixed to 24000.
              schema:
                type: integer
                enum:
                  - 24000
            x-breeze-channels:
              description: Audio channel count. Fixed to mono (1).
              schema:
                type: integer
                enum:
                  - 1
            x-breeze-sample-width-bytes:
              description: PCM sample width in bytes. Fixed to 2.
              schema:
                type: integer
                enum:
                  - 2
            x-breeze-api-key-id:
              description: >-
                Public API key identifier used to authenticate the request, when
                an API key was used.
              schema:
                type: string
        '400':
          description: HTTP 400 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: HTTP 401 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: HTTP 422 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '429':
          description: HTTP 429 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: HTTP 502 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: HTTP 503 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: HTTP 504 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl \
              --request POST \
              --url "https://api.breeze.blue/v1/voice-previews/design/stream" \
              --header "xi-api-key: $BREEZE_API_KEY" \
              --header "Content-Type: application/json" \
              --data '{
              "voice_description": "Warm, intimate narrator with crisp diction.",
              "text": "Welcome to Breeze Blue.",
              "language_code": "en",
              "guidance_scale": 4.0
            }'
        - lang: Python
          label: Python SDK
          source: |-
            from breeze_blue import stream

            import os

            from breeze_blue import BreezeBlue

            client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])

            audio = client.voices.stream_design_preview(
                voice_description="Warm, intimate narrator with crisp diction.",
                text="Welcome to Breeze Blue.",
                guidance_scale=4.0,
            )
            print(audio.generated_voice_id)
            stream(audio)
        - lang: TypeScript
          label: TypeScript SDK
          source: |-
            import { stream } from "@breeze.blue/sdk/node";
            import { BreezeBlueClient } from "@breeze.blue/sdk";

            const client = new BreezeBlueClient({
              apiKey: process.env.BREEZE_API_KEY!,
            });

            const audio = await client.voices.streamDesignPreview({
              voiceDescription: "Warm, intimate narrator with crisp diction.",
              text: "Welcome to Breeze Blue.",
              guidanceScale: 4.0,
            });
            console.log(audio.generatedVoiceId);
            await stream(audio);
components:
  schemas:
    VoiceDesignStreamRequest:
      properties:
        voice_description:
          type: string
          maxLength: 500
          minLength: 3
          title: Voice Description
          description: Text description of the desired voice.
        text:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 3
            - type: 'null'
          title: Text
          description: Preview script. Breeze uses a default script when omitted.
        model_id:
          anyOf:
            - type: string
              maxLength: 120
              minLength: 1
            - type: 'null'
          title: Model Id
          description: Optional model identifier to use for generation.
        language_code:
          anyOf:
            - type: string
              maxLength: 2
              minLength: 2
              pattern: ^[A-Za-z]{2}$
            - type: 'null'
          title: Language Code
          description: Optional ISO 639-1 two-letter preview language.
        guidance_scale:
          anyOf:
            - type: number
              maximum: 10
              minimum: 1
            - type: 'null'
          title: Guidance Scale
          description: >-
            Optional generation guidance strength for preview generation.
            Accepted range: 1.0 to 10.0. When provided, that exact value is
            used; when omitted, Breeze picks a random value between 1.0 and 10.0
            for the request.
      additionalProperties: false
      type: object
      required:
        - voice_description
      title: VoiceDesignStreamRequest
      description: Single-preview request contract for live PCM voice design audio.
    ErrorResponse:
      properties:
        ok:
          default: false
          title: Ok
          type: boolean
        code:
          title: Code
          type: string
        detail:
          title: Detail
          type: string
        error:
          title: Error
          type: string
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Meta
      required:
        - code
        - detail
        - error
      title: ErrorResponse
      type: object
    ValidationErrorResponse:
      properties:
        ok:
          default: false
          title: Ok
          type: boolean
        code:
          title: Code
          type: string
        detail:
          title: Detail
          type: string
        error:
          title: Error
          type: string
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - code
        - detail
        - error
      title: ValidationErrorResponse
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: xi-api-key
      description: Breeze Developer API key.

````