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

# Audio Transcribe

> Processes an audio file to generate a transcription of the spoken content with support for language detection, translation, and multiple output formats.

Convert your audio recordings into high-accuracy text using AI.

**Audio Transcribe** enables seamless transcription for podcasts, interviews, lectures, meetings, and more.

* Fast and accurate speech-to-text conversion
* Supports multiple languages
* Instant or asynchronous transcription with webhook support

Audio Transcribe ensures reliable, professional-grade transcripts for your audio content.

***

## Endpoint

```http theme={null}
POST /audio_transcribe
```

Use this endpoint to transcribe audio recordings into text.

***

## Sample Output

Transcript Output of Charlie Puth and Wiz Khalifa's See You Again:

> "It's been a long day without you, my friend, and I'll tell you all about it when I see you again. We've come a long way from where we began. Oh, I'll tell you all about it when I see you again, when I see you again. Damn, you know, all the planes we flew, good things we've been through. And I'll be standing right here talking to you about another pap. I know we love to hit the road and laugh, but something told me that it wouldn't last. Had to switch up, looking things different, see the bigger picture. Those were the days, hard work for ever pays. Now I see you in a better place. See you in a better place. Oh, after we not talk about family, we family is all that we got. Everything I would do, you would stand in there by my side. And now you've got me with me for the last ride. It's been a long day without you, my friend, and I'll tell you all about it when I see you again. We've come a long way from where we began. Oh, I'll tell you all about it when I see you again, when I see you again. First you both go out your way and the vibe is feeling stronger. It was small, turned to a friendship, but friendship turned to a bond. And that bond will never be broken. The love will never get lost. And when brotherhood comes first, then the land will never be crossed. It's never stood on our own when that land had to be drawn. And that land is where we reach. So remember me when I'm gone. How can we not talk about family, we family is all that we got. Everything I would do, you would stand in there by my side. And now you've got me with me for the last ride. Let the light go on your way. Hold every memory as you go. And every road you take will always be true. Oh, it's been a long day without you, my friend. And I'll tell you all about it when I see you again. We've come a long way from where we began. Oh, I'll tell you all about it when I see you again. When I see you again. Oh, I'll tell you all about it when I see you again. Oh, I'll tell you all about it when I see you again."

***

## Try it Yourself

Visit the [Audio Transcribe Endpoint Explorer](/api-documentation/endpoint/audio_transcribe) to upload audio files and get instant transcripts.

> 🚀 Try uploading different languages or noisy audio recordings to test the transcription quality!

***

## Request Parameters

| Parameter     | Type   | Required | Description                                                  |
| ------------- | ------ | -------- | ------------------------------------------------------------ |
| `audio_url`   | String | Yes      | URL to the audio file you want to transcribe                 |
| `language`    | String | Optional | Language code (e.g., `en`, `es`, `fr`) for targeted accuracy |
| `webhook_url` | String | Optional | Webhook URL to receive the transcription asynchronously      |
| `user_id`     | String | Optional | Optional user ID for tracking purposes                       |

> **content-type:** multipart/form-data

***

## Sample Request

### Python

```python theme={null}
import requests

url = "https://api.musicgpt.com/api/public/v1/audio_transcribe"
headers = {"Authorization": "<<<api key>>>"}

# Option 1: URL
payload = {
    "audio_url": "https://example.com/audio.mp3",
    "language": "en",
    "translate": True,
    "transcription_format": "srt",
    "word_timestamps": True
}
response = requests.post(url, headers=headers, data=payload)
print(response.json())

# Option 2: File Upload
# payload = {
#     "language": "en",
#     "translate": False,
#     "transcription_format": "plain_text",
#     "word_timestamps": True
# }
# with open("audio.mp3", "rb") as f:
#     files = {"audio_file": f}
#     response = requests.post(url, headers=headers, data=payload, files=files)
# print(response.json())
```

***

## Sample Response

### Success (200 OK)

```json theme={null}
{
    "success":true,
    "task_id":"cade1dea-a9fb-49d3-a5b2-52f786ea5ad3",
    "conversion_id":"1c5a2543-5b99-499c-8bb4-28424497e60f",
    "eta":46,
    "credit_estimate":19.833,
    "message":"",
    "status":"IN_QUEUE"
}
```

***

## Webhook Response

When transcription completes, your webhook will receive:

```json theme={null}
{
    "success": true, 
    "conversion_type": "Audio Transcription", 
    "task_id": "cade1dea-a9fb-49d3-a5b2-52f786ea5ad3", 
    "conversion_id": "1c5a2543-5b99-499c-8bb4-28424497e60f", 
    "transcription": "It's been a long day without you, my friend, and I'll tell you all about it when I see you again. We've come a long way from where we began. Oh, I'll tell you all about it when I see you again, when I see you again. Damn, you know, all the planes we flew, good things we've been through. And I'll be standing right here talking to you about another pap. I know we love to hit the road and laugh, but something told me that it wouldn't last. Had to switch up, looking things different, see the bigger picture. Those were the days, hard work for ever pays. Now I see you in a better place. See you in a better place. Oh, after we not talk about family, we family is all that we got. Everything I would do, you would stand in there by my side. And now you've got me with me for the last ride. It's been a long day without you, my friend, and I'll tell you all about it when I see you again. We've come a long way from where we began. Oh, I'll tell you all about it when I see you again, when I see you again. First you both go out your way and the vibe is feeling stronger. It was small, turned to a friendship, but friendship turned to a bond. And that bond will never be broken. The love will never get lost. And when brotherhood comes first, then the land will never be crossed. It's never stood on our own when that land had to be drawn. And that land is where we reach. So remember me when I'm gone. How can we not talk about family, we family is all that we got. Everything I would do, you would stand in there by my side. And now you've got me with me for the last ride. Let the light go on your way. Hold every memory as you go. And every road you take will always be true. Oh, it's been a long day without you, my friend. And I'll tell you all about it when I see you again. We've come a long way from where we began. Oh, I'll tell you all about it when I see you again. When I see you again. Oh, I'll tell you all about it when I see you again. Oh, I'll tell you all about it when I see you again. You", 
    "translation": null, 
    "detected_language": "en", 
    "message": "Transcription Completed"
}
```

> 🔊 If no webhook is provided, you can fetch the transcript manually later using the `conversion_id`.

***

## Payload and Request Formation


## OpenAPI

````yaml POST /v1/audio_transcribe
openapi: 3.1.0
info:
  title: Musicgpt API
  version: 1.0.0
  description: API for retrieving conversion details by ID.
servers:
  - url: https://api.musicgpt.com/api/public
    description: Production server
security: []
paths:
  /v1/audio_transcribe:
    post:
      summary: Transcribe Audio to Text
      description: >-
        Processes an audio file to generate a transcription of the spoken
        content with support for language detection, translation, and multiple
        output formats.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                audio_url:
                  type: string
                  description: URL of the audio file to transcribe.
                  example: https://example.com/audio.mp3
                audio_file:
                  type: string
                  format: binary
                  description: Audio file to upload and process directly.
                language:
                  type: string
                  description: Language spoken in the audio (empty for auto-detection).
                  example: en
                translate:
                  type: boolean
                  description: Whether to translate the transcription to English.
                  example: false
                transcription_format:
                  type: string
                  description: Format of the transcribed output.
                  enum:
                    - plain_text
                    - formatted_text
                    - srt
                    - vtt
                  example: plain_text
                translation_format:
                  type: string
                  description: Format of the translated output (currently unused).
                  enum:
                    - plain_text
                    - formatted_text
                    - srt
                    - vtt
                  example: plain_text
                word_timestamps:
                  type: boolean
                  description: Whether to include word-level timestamps.
                  example: false
                webhook_url:
                  type: string
                  description: Callback URL for async processing results.
                  example: http://your-webhook-url.com/callback
              anyOf:
                - required:
                    - audio_url
                - required:
                    - audio_file
      responses:
        '200':
          description: Successfully initiated transcription
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  task_id:
                    type: string
                  conversion_id:
                    type: string
                  eta:
                    type: integer
                  credit_estimate:
                    type: number
                    format: float
                  message:
                    type: string
                example:
                  success: true
                  task_id: transcribe123
                  conversion_id: conv456
                  eta: -1
                  credit_estimate: 100.1
                  message: Successfully published to queue
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Either audio_url or audio_file must be provided.
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Internal Server Error
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Python
          source: >-
            import requests


            url = "https://api.musicgpt.com/api/public/v1/audio_transcribe"

            headers = {"Authorization": "<<<api key>>>"}


            # Option 1: URL

            payload = {
                "audio_url": "https://example.com/audio.mp3",
                "language": "en",
                "translate": True,
                "transcription_format": "srt",
                "word_timestamps": True
            }

            response = requests.post(url, headers=headers, data=payload)

            print(response.json())


            # Option 2: File Upload

            # payload = {

            #     "language": "en",

            #     "translate": False,

            #     "transcription_format": "plain_text",

            #     "word_timestamps": True

            # }

            # with open("audio.mp3", "rb") as f:

            #     files = {"audio_file": f}

            #     response = requests.post(url, headers=headers, data=payload,
            files=files)

            # print(response.json())
        - lang: PHP
          source: |-
            <?php
            $url = 'https://api.musicgpt.com/api/public/v1/audio_transcribe';
            $headers = ['Authorization: <<<api key>>>'];

            // Option 1: URL
            $data = [
                'audio_url' => 'https://example.com/audio.mp3',
                'language' => 'en',
                'translate' => true,
                'transcription_format' => 'srt',
                'word_timestamps' => true
            ];
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $response = curl_exec($ch);
            curl_close($ch);
            echo $response;

            // Option 2: File Upload
            $data = [
                'language' => 'en',
                'translate' => false,
                'transcription_format' => 'plain_text',
                'word_timestamps' => true,
                'audio_file' => new CURLFile('audio.mp3')
            ];
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $response = curl_exec($ch);
            curl_close($ch);
            echo $response;
        - lang: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\turl := \"https://api.musicgpt.com/api/public/v1/audio_transcribe\"\n\tapiKey := \"<<<api key>>>\"\n\n\t// Option 1: URL\n\tpayload := \"audio_url=https://example.com/audio.mp3&language=en&translate=true&transcription_format=srt&word_timestamps=true\"\n\treq, _ := http.NewRequest(\"POST\", url, strings.NewReader(payload))\n\treq.Header.Add(\"Authorization\", apiKey)\n\tres, _ := http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\tfmt.Println(string(body))\n\n\t// Option 2: File Upload\n\tfile, _ := os.Open(\"audio.mp3\")\n\tdefer file.Close()\n\tbodyBuf := &bytes.Buffer{}\n\twriter := multipart.NewWriter(bodyBuf)\n\twriter.WriteField(\"language\", \"en\")\n\twriter.WriteField(\"translate\", \"false\")\n\twriter.WriteField(\"transcription_format\", \"plain_text\")\n\twriter.WriteField(\"word_timestamps\", \"true\")\n\tpart, _ := writer.CreateFormFile(\"audio_file\", \"audio.mp3\")\n\tio.Copy(part, file)\n\twriter.Close()\n\n\treq, _ = http.NewRequest(\"POST\", url, bodyBuf)\n\treq.Header.Add(\"Authorization\", apiKey)\n\treq.Header.Add(\"Content-Type\", writer.FormDataContentType())\n\tres, _ = http.DefaultClient.Do(req)\n\tdefer res.Body.Close()\n\tbody, _ = io.ReadAll(res.Body)\n\tfmt.Println(string(body))\n}"
        - lang: Java
          source: // Java example omitted for brevity. Request if needed.
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````