---
title: "Get an upload URL for an audio file"
description: "Step 1 of uploading an audio clip for referenceAudioMediaIds of POST /v2/reference-video/create. The flow is the same as for images: PUT the bytes to uploadUrl with the file's Content-Type (audio/mpeg or audio/wav), then call POST /v2/media/audio/register."
canonical: "https://platform.pixai.art/en/docs/api-v2/media/getAudioUploadUrl"
last-updated: "2026-11-02"
---

# Get an upload URL for an audio file

Step 1 of uploading an audio clip for `referenceAudioMediaIds` of `POST /v2/reference-video/create`. The flow is the same as for images: `PUT` the bytes to `uploadUrl` with the file's `Content-Type` (`audio/mpeg` or `audio/wav`), then call `POST /v2/media/audio/register`.



Only WAV and MP3 are accepted, under 15 MiB per clip. Duration limits depend on the video model; they are checked when the video task is created, not at upload.

## POST https://api.pixai.art/v2/media/audio/upload-url

Authentication: send your API key as `Authorization: Bearer <API key>`.

Machine-readable OpenAPI spec: https://platform.pixai.art/openapi-spec.v2.yaml

### Request body (`application/json`)

- `isEphemeral` (boolean, optional)
  Mark the file as a short-lived generation input. Ephemeral files are private, and their URLs are signed and expire.
  Default: `false`.

Example:

```json
{}
```

### Responses

- `200`
  The upload target.
  Body fields:
  - `uploadUrl` (string, required)
    Presigned URL. `PUT` the raw file bytes to it with the file's `Content-Type`.
  - `externalId` (string, required)
    Pass this to the matching `register` endpoint after the upload.
- `401`
  `UNAUTHORIZED`: no API key was sent. An invalid, revoked or expired key answers `{"message": "invalid token", "code": 40100001}` instead, with a numeric `code`.
