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

# Stream synthesized speech

> OpenAI-compatible text-to-speech. Use `Authorization: Bearer <API_KEY>`
and a JSON body. The response is a raw audio byte stream forwarded
progressively (no prediction polling); the negotiated content type is
returned verbatim (`audio/mpeg` for mp3, `audio/pcm;rate=…;channels=…`
for pcm). An omitted `response_format` defaults to `mp3`.

The accepted model/voice/format set is a curated per-environment
catalog that a model joins only after passing contract qualification;
`deepgram/aura-2` is the launch model. An unsupported model, voice, or
format, or a `speed`/`instructions` value for a model that does not
support it, returns a 400 without dispatching a synthesis.

This endpoint is independently feature-gated during preview rollout. A
disabled deployment returns an OpenAI-shaped 404 without dispatching.




## OpenAPI

````yaml /openapi_specs/models.json post /v1/audio/speech
openapi: 3.0.3
info:
  title: each::labs Official API v1
  description: >
    Official each::labs API V1.

    This API provides access to our comprehensive AI model catalog and other
    resources.


    ## Public contract notes


    - Public API routes handled by request logging include `X-Request-Id` for
      support and log correlation. Clients may send `X-Request-Id`; otherwise
      api-service generates one. Root, health, and metrics endpoints are excluded.
    - REST error bodies keep the backward-compatible JSON shape used by existing
      clients. Most errors include at least `error`; some shared error paths also
      include `status` and `details`. Use the HTTP status code as the primary
      programmatic signal unless an endpoint documents a richer envelope.
    - Rate-limit and retry headers are endpoint-dependent. If a response
    includes
      `Retry-After`, honor it before retrying; otherwise use bounded exponential
      backoff for retryable 429/5xx responses.
  version: 1.0.0
  contact:
    name: API Support
    email: support@eachlabs.ai
  x-logo:
    url: ./logo-white.svg
    altText: each::labs
servers:
  - url: https://api.eachlabs.ai
    description: Production server
security: []
tags:
  - name: AI Models
    description: Endpoints for listing and retrieving AI models and other resources.
  - name: AI Models Prediction
    description: Endpoints for managing model predictions
  - name: Uploads
    description: Endpoints for uploading files that can be used as model inputs.
  - name: Executions
    description: Endpoints for listing execution history.
  - name: Workflows
    description: >-
      Endpoints for creating workflows and triggering workflow executions
      through api-service.
  - name: OpenAI Compatibility
    description: OpenAI-compatible endpoints for LLM Router requests.
  - name: Webhooks
    description: >
      Endpoints for retrieving webhook information and delivery history.


      **Note:** Currently, webhooks are only supported for Workflows V2. We are
      actively expanding webhook support to other services and will update this
      documentation as new integrations become available.
paths:
  /v1/audio/speech:
    post:
      tags:
        - OpenAI Compatibility
      summary: Stream synthesized speech
      description: |
        OpenAI-compatible text-to-speech. Use `Authorization: Bearer <API_KEY>`
        and a JSON body. The response is a raw audio byte stream forwarded
        progressively (no prediction polling); the negotiated content type is
        returned verbatim (`audio/mpeg` for mp3, `audio/pcm;rate=…;channels=…`
        for pcm). An omitted `response_format` defaults to `mp3`.

        The accepted model/voice/format set is a curated per-environment
        catalog that a model joins only after passing contract qualification;
        `deepgram/aura-2` is the launch model. An unsupported model, voice, or
        format, or a `speed`/`instructions` value for a model that does not
        support it, returns a 400 without dispatching a synthesis.

        This endpoint is independently feature-gated during preview rollout. A
        disabled deployment returns an OpenAI-shaped 404 without dispatching.
      operationId: createAudioSpeech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudioSpeechRequest'
      responses:
        '200':
          description: |
            Raw audio byte stream. Bytes are forwarded progressively as the
            provider synthesizes them; the content type is the negotiated
            format (`audio/mpeg` or `audio/pcm;rate=…;channels=…`).
          headers:
            X-Generation-Id:
              description: >-
                Upstream generation identifier for out-of-band billing
                reconciliation.
              schema:
                type: string
            X-Execution-ID:
              description: Eachlabs execution identifier for the synthesis.
              schema:
                type: string
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
            audio/pcm:
              schema:
                type: string
                format: binary
        '400':
          description: Unsupported model/voice/format/param or invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '402':
          description: Insufficient balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '404':
          description: Capability disabled for this deployment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '413':
          description: Request body exceeds the maximum size
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '429':
          description: Provider rate limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '503':
          description: Authentication or speech service temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '504':
          description: Speech request timed out
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    AudioSpeechRequest:
      type: object
      required:
        - model
        - input
        - voice
      properties:
        model:
          type: string
          example: deepgram/aura-2
          description: >-
            Must be in the environment's speech catalog. An unlisted model
            returns 400 without dispatching a synthesis.
        input:
          type: string
          description: >-
            Text to synthesize. Bounded by the model's per-character limit
            (counted in Unicode runes).
        voice:
          type: string
          example: aura-2-thalia-en
          description: >-
            Model-specific, namespaced voice id. Must be allowlisted for the
            model.
        response_format:
          type: string
          default: mp3
          description: >-
            Audio format. Omitted defaults to `mp3`. Allowed values are
            per-model (e.g. `mp3`, `pcm`).
          example: mp3
        speed:
          type: number
          minimum: 0.25
          maximum: 4
          description: >-
            Playback speed. Accepted only for models that declare support;
            otherwise 400.
        instructions:
          type: string
          description: >-
            Steering instructions. Accepted only for models that declare
            support; otherwise 400.
        stream_format:
          type: string
          enum:
            - audio
          description: Only raw audio streaming is supported. `sse` is rejected with 400.
    OpenAIErrorResponse:
      type: object
      description: >-
        OpenAI-compatible error envelope used by chat, audio, and realtime
        compatibility endpoints.
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid API key
            type:
              type: string
              example: authentication_error
            param:
              type: string
              example: model
            code:
              type: string
              example: invalid_api_key
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key passed as an Authorization Bearer token: `Authorization: Bearer
        YOUR_API_KEY`

````