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

# POST Generate speech

> Generate speech audio from text via /v1/audio/speech (OpenAI TTS models). For Gemini TTS, use native `/v1beta/`.

<div className="flex items-center gap-3 mb-6">
  <span className="inline-flex items-center px-3 py-1 rounded-full text-sm font-semibold bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 border border-green-200 dark:border-green-800">
    POST
  </span>

  <span className="text-lg font-medium text-gray-900 dark:text-gray-100">
    Generate speech
  </span>
</div>

## OpenAPI

```yaml /openapi.yaml post /audio/speech theme={null}
openapi: 3.1.0
info:
  title: ClearMaas API
  version: '2026.04'
  description: ClearMaas is an OpenAI-compatible API gateway.
  contact:
    name: ClearMaas Support
    email: support@clearmaas.com
    url: https://clearmaas.com
servers:
  - url: https://api.clearmaas.com/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /audio/speech:
    post:
      tags:
        - Audio
      summary: Generate speech
      operationId: createSpeech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudioSpeechRequest'
      responses:
        '200':
          description: Binary audio content.
          content:
            audio/mpeg: {}
            audio/wav: {}
            audio/opus: {}
            audio/flac: {}
components:
  schemas:
    AudioSpeechRequest:
      type: object
      required:
        - model
        - input
        - voice
      properties:
        model:
          type: string
          example: openai/tts-1
          description: OpenAI TTS model �?tts-1, tts-1-hd, gpt-4o-mini-tts.
        input:
          type: string
        voice:
          type: string
          example: alloy
          description: Voice identifier (e.g. alloy, echo, fable, onyx, nova, shimmer).
        instructions:
          type: string
          description: Optional voice direction (style, tone).
        speed:
          type: number
          minimum: 0.25
          maximum: 4
          default: 1.0
        response_format:
          type: string
          enum: [mp3, opus, aac, flac, wav, pcm]
          default: mp3
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key (sk-...)
      description: Pass `Authorization: Bearer sk-...` header.
```
