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

# Audio To Text

> Transcribe audio files to text.

<Info>
  The default Gateway used in this guide is the public
  [Livepeer.cloud](https://www.livepeer.cloud/) Gateway. It is free to use but
  not intended for production-ready applications. For production-ready
  applications, consider using the [Livepeer Studio](https://livepeer.studio/)
  Gateway, which requires an API token. Alternatively, you can set up your own
  Gateway node or partner with one via the `ai-video` channel on
  [Discord](https://discord.gg/livepeer).
</Info>

<Note>
  Please note that the exact parameters, default values, and responses may vary
  between models. For more information on model-specific parameters, please
  refer to the respective model documentation available in the [audio-to-text
  pipeline](/ai/pipelines/audio-to-text). Not all parameters might be available
  for a given model.
</Note>


## OpenAPI

````yaml post /audio-to-text
openapi: 3.1.0
info:
  title: Livepeer AI Runner
  description: An application to run AI pipelines
  version: 0.0.0
servers:
  - url: https://dream-gateway.livepeer.cloud
    description: Livepeer Cloud Community Gateway
  - url: https://livepeer.studio/api/beta/generate
    description: Livepeer Studio Gateway
security: []
paths:
  /audio-to-text:
    post:
      tags:
        - generate
      summary: Audio To Text
      description: Transcribe audio files to text.
      operationId: genAudioToText
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_genAudioToText'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextResponse'
                x-speakeasy-name-override: data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_genAudioToText:
      properties:
        audio:
          type: string
          format: binary
          title: Audio
          description: Uploaded audio file to be transcribed.
        model_id:
          type: string
          title: Model Id
          description: Hugging Face model ID used for transcription.
          default: ''
        return_timestamps:
          type: string
          title: Return Timestamps
          description: >-
            Return timestamps for the transcribed text. Supported values:
            'sentence', 'word', or a string boolean ('true' or 'false'). Default
            is 'true' ('sentence'). 'false' means no timestamps. 'word' means
            word-based timestamps.
          default: 'true'
        metadata:
          type: string
          title: Metadata
          description: Additional job information to be passed to the pipeline.
          default: '{}'
      type: object
      required:
        - audio
      title: Body_genAudioToText
    TextResponse:
      properties:
        text:
          type: string
          title: Text
          description: The generated text.
        chunks:
          items:
            $ref: '#/components/schemas/Chunk'
          type: array
          title: Chunks
          description: The generated text chunks.
      type: object
      required:
        - text
        - chunks
      title: TextResponse
      description: Response model for text generation.
    HTTPError:
      properties:
        detail:
          allOf:
            - $ref: '#/components/schemas/APIError'
          description: Detailed error information.
      type: object
      required:
        - detail
      title: HTTPError
      description: HTTP error response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Chunk:
      properties:
        timestamp:
          items: {}
          type: array
          title: Timestamp
          description: The timestamp of the chunk.
        text:
          type: string
          title: Text
          description: The text of the chunk.
      type: object
      required:
        - timestamp
        - text
      title: Chunk
      description: A chunk of text with a timestamp.
    APIError:
      properties:
        msg:
          type: string
          title: Msg
          description: The error message.
      type: object
      required:
        - msg
      title: APIError
      description: API error response model.
    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

````