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

# Text-to-Speech (Bytes)

> Generate audio from text and return the **complete audio file in a single response** — the body is the raw audio in the requested format. Use this when you want the whole clip at once; for incremental low-latency playback use `/tts/sse` or the WebSocket endpoint instead. The `wav` container is available on this endpoint only.



## OpenAPI

````yaml api-reference/openapi.json POST /tts/bytes
openapi: 3.1.0
info:
  title: Nineninesix TTS API
  description: >-
    Cartesia-compatible Text-to-Speech API for voice agents and real-time
    dialogue. Point the official Cartesia SDKs at this base URL and they just
    work.
  version: 0.3.0
  contact:
    name: Nineninesix Support
    email: ulan@nineninesix.ai
servers:
  - url: https://api.nineninesix.ai
    description: Production
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Speech
    description: Generate audio from text.
  - name: Voices
    description: List, fetch, and clone voices.
paths:
  /tts/bytes:
    post:
      tags:
        - Speech
      summary: Text-to-Speech (Bytes)
      description: >-
        Generate audio from text and return the **complete audio file in a
        single response** — the body is the raw audio in the requested format.
        Use this when you want the whole clip at once; for incremental
        low-latency playback use `/tts/sse` or the WebSocket endpoint instead.
        The `wav` container is available on this endpoint only.
      operationId: createSpeechBytes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TTSRequest'
            examples:
              wav:
                summary: WAV (PCM) at 22050 Hz
                value:
                  model_id: gepard-1.0
                  transcript: Today is a wonderful day to build something people love!
                  voice:
                    mode: id
                    id: a0e99841-438c-4a64-b679-ae501e7d6091
                  output_format:
                    container: wav
                    encoding: pcm_s16le
                    sample_rate: 22050
              telephony:
                summary: 8 kHz μ-law for Twilio/SIP
                value:
                  model_id: gepard-1.0
                  transcript: Thanks for calling. How can I help?
                  voice:
                    mode: id
                    id: a0e99841-438c-4a64-b679-ae501e7d6091
                  output_format:
                    container: raw
                    encoding: pcm_mulaw
                    sample_rate: 8000
      responses:
        '200':
          description: >-
            The audio file in the requested format. A `wav` container is
            returned as `Content-Type: audio/wav` (the playground renders an
            audio player); a `raw` container is returned as
            `application/octet-stream` (raw PCM has no header and won't play in
            a browser).
          content:
            audio/wav:
              schema:
                type: string
                format: binary
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/UpstreamUnavailable'
components:
  schemas:
    TTSRequest:
      type: object
      required:
        - model_id
        - transcript
        - voice
        - output_format
      properties:
        model_id:
          type: string
          enum:
            - gepard-1.0
          description: The TTS model. Currently `gepard-1.0`.
        transcript:
          type: string
          description: The text to synthesize. Billed at 1 credit per character.
        voice:
          $ref: '#/components/schemas/VoiceSpecifier'
        output_format:
          $ref: '#/components/schemas/OutputFormat'
        language:
          type: string
          description: Optional language code (e.g. `en`).
          example: en
    VoiceSpecifier:
      type: object
      required:
        - mode
        - id
      properties:
        mode:
          type: string
          enum:
            - id
          description: Voice selection mode.
        id:
          type: string
          description: The voice ID.
          example: a0e99841-438c-4a64-b679-ae501e7d6091
    OutputFormat:
      type: object
      description: >-
        Output audio format. Each field is validated against a fixed set;
        anything outside these values returns 400 with no silent fallback.
      required:
        - container
        - encoding
        - sample_rate
      properties:
        container:
          type: string
          enum:
            - raw
            - wav
          description: >-
            `wav` is available on `/tts/bytes` only; streaming endpoints are
            `raw`-only.
        encoding:
          type: string
          enum:
            - pcm_s16le
            - pcm_mulaw
            - pcm_alaw
          description: '`pcm_mulaw`/`pcm_alaw` are 8-bit G.711 telephony codecs.'
        sample_rate:
          type: integer
          enum:
            - 8000
            - 16000
            - 22050
          description: >-
            The model is natively 22050 Hz; 8000/16000 are resampled
            server-side.
    Error:
      type: object
      properties:
        error:
          type: string
          description: Machine-readable error code.
          example: payment_required
        message:
          type: string
          description: Human-readable description.
          example: insufficient credits
  responses:
    BadRequest:
      description: >-
        Malformed request or unsupported `output_format` (bad container,
        encoding, or sample rate).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid_output_format
            message: unsupported sample_rate
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
            message: invalid API key
    PaymentRequired:
      description: Insufficient credits.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: payment_required
            message: insufficient credits
    RateLimited:
      description: >-
        Per-org rate or concurrency limit reached. Honor the `Retry-After`
        header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: rate_limited
            message: requests/min limit exceeded for your tier
    UpstreamUnavailable:
      description: The synthesis backend errored. Any pre-charge is refunded automatically.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: upstream_unavailable
            message: synthesis backend error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Pass your API key as a Bearer token: `Authorization: Bearer sk_996_...`.'
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: Alternatively, pass your API key in the `X-API-Key` header.

````