Get media URLs by ID
Resolves up to 100 media IDs to their URLs, for example the outputs.mediaIds or outputs.videoMediaId of a finished task. No authentication is needed for public media.
IDs that do not exist are left out, and the order of the result is not guaranteed, so match items by id.
Authorization
bearerAuth In all requests that require authentication
In: header
Query Parameters
Comma-separated media IDs, 1 to 100, e.g. ?ids=1,2,3. Repeating the parameter (?ids=1&ids=2) also works.
Response Body
application/json
curl -X GET "https://api.pixai.art/v2/media/batch?ids=string"[
{
"id": "string",
"type": "IMAGE",
"urls": [
{
"variant": "PUBLIC",
"url": "string"
}
],
"width": 0,
"height": 0,
"fileUrl": "string",
"hlsUrl": "string",
"thumbnailUrl": "string",
"duration": 0
}
]Get a task GET
Reads a task created by any v2 endpoint. Poll it every few seconds until `status` is `completed`, `failed` or `cancelled`.
Get an upload URL for an audio file POST
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`.