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

# Text to speech

> Convert text to audio



## OpenAPI

````yaml /ja/api-reference/openapi.json post /v1/audio/speech
openapi: 3.0.1
info:
  title: Rock API AI モデル API
  version: 1.0.0
  description: Rock API の OpenAI 互換 AI モデル API リファレンスです。
servers:
  - url: https://rockapi.ai
security:
  - BearerAuth: []
tags:
  - name: List models
  - name: OpenAI format (Chat)
  - name: OpenAI format (Responses)
  - name: Image generation
  - name: Image generation/OpenAI-compatible format
  - name: Image generation/Qwen
  - name: Video generation
  - name: Video generation/Sora-compatible format
  - name: Video generation/Kling format
  - name: Video generation/Jimeng format
  - name: Claude format (Messages)
  - name: Gemini format
  - name: OpenAI format (Embeddings)
  - name: Text completions
  - name: OpenAI audio
  - name: Rerank
  - name: Moderations
  - name: Realtime
  - name: Not implemented
  - name: Not implemented/Fine-tunes
  - name: Not implemented/Files
paths:
  /v1/audio/speech:
    post:
      tags:
        - OpenAI audio
      summary: Text to speech
      description: Convert text to audio
      operationId: createSpeech
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpeechRequest'
        required: true
      responses:
        '200':
          description: Audio generated successfully
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    SpeechRequest:
      type: object
      required:
        - model
        - input
        - voice
      properties:
        model:
          type: string
          example: tts-1
        input:
          type: string
          description: Text to convert
          maxLength: 4096
        voice:
          type: string
          enum:
            - alloy
            - echo
            - fable
            - onyx
            - nova
            - shimmer
        response_format:
          type: string
          enum:
            - mp3
            - opus
            - aac
            - flac
            - wav
            - pcm
          default: mp3
        speed:
          type: number
          minimum: 0.25
          maximum: 4
          default: 1
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        Authenticate with a Bearer Token.
        Format: `Authorization: Bearer sk-xxxxxx`

````