> ## 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 Speed Changer

> Processes an audio file to change its playback speed based on a speed factor.

Change the speed of your audio files without affecting quality.

**Audio Speed Changer** allows you to easily speed up or slow down any audio file, perfect for creating remixes, practicing music, or adjusting spoken content.

* Speed up or slow down audio effortlessly
* Supports multiple formats like MP3, WAV, FLAC, and more
* Fast processing with high-quality output

***

## Endpoint

```http theme={null}
POST /v1/audio_speed_changer
```

Use this endpoint to adjust the speed of an audio file.

***

## Sample Output

Listen to the speed-changed audio:
<audio controls="1" controlslist="nodownload nofullscreen noremoteplayback" src="https://cdn1.musicgpt.com/conversions/e477a121-ba71-4753-96ae-874779f0623a/e477a121-ba71-4753-96ae-874779f0623a.mp3">Your browser does not support audio playback.</audio>

***

## Try it Yourself

Visit the [Audio Speed Changer Endpoint Explorer](/api-documentation/endpoint/audio_speed_changer) to upload audio files and adjust their playback speed.

> ⏩ Try different speed factors like 1.5x or 0.75x to test quality!

***

## Request Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `audio_file` | `File` | Optional | Upload the audio file directly. Required if `audio_url` is not provided. |
| `audio_url` | `String` | Optional | URL to the audio file. |
| `speed_change_factor` | Number | Yes | Factor to change speed (e.g., 2.0 = double speed, 0.5 = half speed) (min: 0.25, max: 4.0) |
| `output_extension` | String | Yes | Desired output format (`mp3`, `wav`, `flac`, `ogg`, `aac`, `webm`) |
| `webhook_url` | String | Optional | URL to receive callback notification when processing completes |

> **Max input audio length:** 8 minutes. See [Audio Length Limits](/api-documentation/utilities/ratelimits#audio-length-limits).

> **Note:** Either audio\_file or audio\_url must be provided.

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

***

## Sample Request

### Python

```python theme={null}
import requests

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

payload = {
    "speed_change_factor": 1.5,
    "output_extension": "mp3"
}

# Option 1: audio_url
payload["audio_url"] = "<YOUR_AUDIO_URL>"
response = requests.post(url, headers=headers, data=payload)

# Option 2: File Upload
# with open("input_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":"b0ac9d46-64d7-4843-af48-a0b6effe3666",
  "conversion_id":"fe19945b-d466-4183-b559-5d264bddd492",
  "eta":66,
  "credit_estimate":0.15,
  "message":"Message published to queue",
  "status":"IN_QUEUE"
}
```

***

## Webhook Response

When transcription completes, your webhook will receive:

```json theme={null}
{
  "success": true, 
  "conversion_type": "Audio Speed Changer", 
  "task_id": "b0ac9d46-64d7-4843-af48-a0b6effe3666", 
  "conversion_id": "fe19945b-d466-4183-b559-5d264bddd492", 
  "output_file": "https://cdn1.musicgpt.com/conversions/e477a121-ba71-4753-96ae-874779f0623a/e477a121-ba71-4753-96ae-874779f0623a.mp3", 
  "message": "Audio speed changer completed",
  "title": "Audio Speed Changer"
}
```

***

## Payload and Request Formation


## OpenAPI

````yaml POST /v1/audio_speed_changer
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_speed_changer:
    post:
      summary: Change the speed of an audio file
      description: >-
        Processes an audio file to change its playback speed based on a speed
        factor.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                audio_url:
                  type: string
                  description: 'Input audio URL (supported format: YouTube URL).'
                audio_file:
                  type: string
                  format: binary
                  description: Audio file to upload and process directly.
                speed_change_factor:
                  type: number
                  description: 'Factor to change the audio speed (min: 0.25, max: 4.0)'
                  minimum: 0.25
                  maximum: 4
                  example: 1.5
                output_extension:
                  type: string
                  enum:
                    - mp3
                    - wav
                    - flac
                    - ogg
                    - aac
                    - webm
                  description: Desired output format.
                  example: mp3
                webhook_url:
                  type: string
                  description: Callback URL for async processing results.
                  example: http://your-webhook-url.com/callback
              required:
                - speed_change_factor
              anyOf:
                - required:
                    - audio_url
                - required:
                    - audio_file
      responses:
        '200':
          description: Successfully initiated task
          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
                  message:
                    type: string
                  status:
                    type: string
                example:
                  success: true
                  task_id: b0ac9d46-64d7-4843-af48-a0b6effe3666
                  conversion_id: fe19945b-d466-4183-b559-5d264bddd492
                  eta: 66
                  credit_estimate: 0.15
                  message: Message published to queue
                  status: IN_QUEUE
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error_code:
                    type: string
                  message:
                    type: string
              example:
                success: false
                error_code: INSUFFICIENT_CREDITS
                message: ''
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error_code:
                    type: string
                  message:
                    type: string
              example:
                success: false
                error_code: UNPROCESSABLE_CONTENT
                message: ''
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error_code:
                    type: string
                  message:
                    type: string
              example:
                success: false
                error_code: INTERNAL_SERVER_ERROR
                message: ''
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Python
          source: >-
            import requests


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

            headers = {"Authorization": "<API_KEY>"}


            payload = {
                "speed_change_factor": 1.5,
                "output_extension": "mp3"
            }


            # Option 1: audio_url

            payload["audio_url"] = "<YOUR_AUDIO_URL>"

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


            # Option 2: File Upload

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

            #     files = {"audio_file": f}

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


            print(response.json())
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.