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

# Extract transcription from voice audio

> Extract a text transcription from a voice audio sample.



## OpenAPI

````yaml /api-reference/openapi.json post /v2/tts/voices/extract-transcription
openapi: 3.0.1
info:
  title: Hamsa API
  description: Trying out our transcription and media-to-text APIs
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v2/tts/voices/extract-transcription:
    post:
      summary: Extract transcription from voice audio
      description: Extract a text transcription from a voice audio sample.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtractTranscriptionRequest'
      responses:
        '200':
          description: Transcription extracted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractTranscriptionResponse'
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ExtractTranscriptionRequest:
      type: object
      required:
        - projectId
        - audioUrl
      properties:
        projectId:
          type: string
          format: uuid
          example: ae6d58c6-c6bd-4ae0-ad74-b8b39c29928b
        audioUrl:
          type: string
          format: uri
          example: https://cdn.tryhamsa.com/uploads/voice.wav
        language:
          type: string
          description: Optional language hint for transcription.
          example: en
    ExtractTranscriptionResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/SuccessResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                transcription:
                  type: string
                  example: Hello, this is a transcription of your audio.
    ValidationErrorResponse:
      type: object
      properties:
        code:
          type: integer
          example: 9400
        message:
          type: string
          example: Field must be a string!
        messageKey:
          type: string
          example: FieldMustBeString
    InternalServerErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: integer
          example: 500
        message:
          type: string
          example: Internal server error
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Operation completed successfully
        messageKey:
          type: string
          example: OPERATION_SUCCESSFUL
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````