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

# Openai Audio Speech



## OpenAPI

````yaml https://api.deepinfra.com/openapi.json post /v1/audio/speech
openapi: 3.1.0
info:
  title: DeepInfra API
  description: >-
    The DeepInfra API provides serverless AI inference, custom model
    deployments, and GPU rentals.
  version: 1.0.0
servers:
  - url: https://api.deepinfra.com
security: []
tags:
  - name: Chat Completions
    description: OpenAI and Anthropic-compatible chat completion endpoints for LLMs.
  - name: Text Completions
    description: OpenAI-compatible text completion endpoints.
  - name: Embeddings
    description: Generate text embeddings for search and RAG.
  - name: Image Generation
    description: Generate, edit, and create variations of images.
  - name: Audio
    description: OpenAI-compatible speech synthesis, transcription, and translation.
  - name: Text to Speech
    description: ElevenLabs-compatible TTS endpoints and voice management.
  - name: Inference
    description: Native DeepInfra inference API for models and deployments.
  - name: Dedicated Models
    description: Deploy and manage private model instances with autoscaling.
  - name: GPU Rentals
    description: Rent dedicated GPU containers.
  - name: Models
    description: Browse, search, and manage AI models.
  - name: Files & Batches
    description: File uploads and batch processing.
  - name: LoRA Adapters
    description: Create, manage, and query LoRA adapter models.
  - name: Agents
    description: Manage agent-framework instances (OpenClaw and friends).
  - name: Sandboxes
    description: Create and manage isolated sandbox environments.
  - name: Account
    description: User profile, team management, and rate limits.
  - name: Authentication
    description: API tokens, SSH keys, scoped JWTs, and login flows.
  - name: Billing
    description: Payment methods, usage tracking, and billing.
  - name: Logs & Metrics
    description: Query inference logs, deployment logs, and usage metrics.
  - name: Utilities
    description: Feedback submission and CLI version.
paths:
  /v1/audio/speech:
    post:
      tags:
        - Audio
      summary: Openai Audio Speech
      operationId: openai_audio_speech_v1_audio_speech_post
      parameters:
        - name: x-deepinfra-source
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Deepinfra-Source
        - name: xi-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Xi-Api-Key
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenAITextToSpeechIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    OpenAITextToSpeechIn:
      properties:
        service_tier:
          anyOf:
            - $ref: '#/components/schemas/ServiceTier'
            - type: 'null'
          description: >-
            The service tier used for processing the request. 'priority'
            processes the request with higher priority (premium rate); 'flex'
            processes it at lower priority for a discount, served only when
            spare capacity exists and may be retried/timed out under load. Both
            apply only to models that support the respective tier.
        model:
          type: string
          title: Model
          description: model name
          examples:
            - deepinfra/tts
        input:
          type: string
          title: Input
          description: Text to convert to speech
          examples:
            - |-
              I'm beginnin' to feel like a Rap God, Rap God
              All my people from the front to the back nod, back nod
              Now, who thinks their arms are long enough to slap box, slap box?
              They said I rap like a robot, so call me Rap-bot
        voice:
          anyOf:
            - type: string
            - type: 'null'
          title: Voice
          description: Preset voices to use for the speech.
        response_format:
          $ref: '#/components/schemas/TtsResponseFormat'
          description: response format for the speech
        speed:
          type: number
          maximum: 4
          minimum: 0.25
          title: Speed
          description: speed of the speech
          default: 1
        extra_body:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extra Body
          description: Extra body parameters for the model.
      type: object
      required:
        - model
        - input
      title: OpenAITextToSpeechIn
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ServiceTier:
      type: string
      enum:
        - default
        - priority
        - flex
      title: ServiceTier
    TtsResponseFormat:
      type: string
      enum:
        - mp3
        - opus
        - flac
        - wav
        - pcm
      title: TtsResponseFormat
      description: >-
        Select the desired format for the speech output. Supported formats
        include mp3, opus, flac, wav, and pcm.
      default: wav
      examples:
        - mp3
        - opus
        - flac
        - wav
        - pcm
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````