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

# Synthesize speech

> Synthesize speech from text using grok-tts. Synchronous — returns raw MP3 bytes (`audio/mpeg`). Billed per Unicode code point at the grok-tts rate. Max 4,096 characters per request; only `mp3` response_format is supported in this release. Use a built-in voice ID from `GET /v1/voices` or a custom voice ID from `GET /v1/custom-voices`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/audio/speech
openapi: 3.0.3
info:
  title: AI Reserve Gateway API
  description: >-
    The AI Reserve API surface — OpenAI-compatible chat completions,
    Anthropic-compatible messages, Bedrock Converse, images, video, files,
    text-to-speech, realtime voice sessions, and GPU Compute pod/volume
    management — all behind one endpoint and one API key.
  version: 1.0.0
servers:
  - url: https://api.aireserve.com
security:
  - bearerAuth: []
paths:
  /v1/audio/speech:
    post:
      tags:
        - Audio
      summary: Synthesize speech
      description: >-
        Synthesize speech from text using grok-tts. Synchronous — returns raw
        MP3 bytes (`audio/mpeg`). Billed per Unicode code point at the grok-tts
        rate. Max 4,096 characters per request; only `mp3` response_format is
        supported in this release. Use a built-in voice ID from `GET /v1/voices`
        or a custom voice ID from `GET /v1/custom-voices`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
                - voice
              properties:
                model:
                  type: string
                  enum:
                    - grok-tts
                  description: Must be `grok-tts`.
                input:
                  type: string
                  maxLength: 4096
                  description: Text to synthesize — max 4,096 Unicode code points.
                voice:
                  type: string
                  description: >-
                    Built-in voice ID (from `GET /v1/voices`) or your
                    organization's custom voice ID (from `GET
                    /v1/custom-voices`).
                language:
                  type: string
                  description: >-
                    BCP-47 language hint (e.g. `en`, `en-US`, `es`). Defaults to
                    the voice's primary language when omitted.
                response_format:
                  type: string
                  enum:
                    - mp3
                  description: Output format. Only `mp3` is accepted in this release.
            example:
              model: grok-tts
              input: Welcome to AI Reserve. How can I help you today?
              voice: ara
              language: en
      responses:
        '200':
          description: Raw MP3 audio stream.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '400':
          description: Validation error — check `message` in the response body.
        '401':
          description: Missing or invalid API key.
        '402':
          description: Wallet balance insufficient for this request.
        '403':
          description: >-
            No client context attached to the key, or `customVoicesEnabled` gate
            is off for a custom voice.
        '404':
          description: Voice ID not found (or owned by another organization).
        '429':
          description: Rate limit exceeded.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your AI Reserve API key (aireserve_api_…) from the API Keys page in the
        portal (https://portal.aireserve.com/keys).

````