---
title: "Inspect a video or audio file"
description: "Returns the duration, size, containers and codecs of a video or audio media item, so you can check a reference file against the model's limits before creating a reference video task."
canonical: "https://platform.pixai.art/en/docs/api-v2/media/getMediaInfo"
last-updated: "2026-11-02"
---

# Inspect a video or audio file

Returns the duration, size, containers and codecs of a video or audio media item, so you can check a reference file against the model's limits before creating a reference video task.



## GET https://api.pixai.art/v2/media/{mediaId}/info

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

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

### Parameters

- `mediaId` (in path, string, required)
  A video or audio media ID.

### Responses

- `200`
  The media metadata.
  Body fields:
  - `mediaId` (string, optional)
  - `durationSeconds` (number | null, optional)
    Length in seconds.
  - `sizeBytes` (string | null, optional)
    Size in bytes, as a decimal string.
  - `containers` (string[], optional)
    Container formats, lowercase, e.g. `mp3` or `mov`.
  - `videoStreams` (object[], optional)
    One entry per video stream.
  - `videoStreams[].codec` (string, optional)
  - `videoStreams[].width` (integer, optional)
  - `videoStreams[].height` (integer, optional)
  - `videoStreams[].averageFrameRate` (number, optional)
  - `audioStreams` (object[], optional)
    One entry per audio stream.
  - `audioStreams[].codec` (string, optional)
- `400`
  `NOT_VIDEO_OR_AUDIO`: the media is an image.
- `401`
  `UNAUTHORIZED`: no API key was sent. An invalid, revoked or expired key answers `{"message": "invalid token", "code": 40100001}` instead, with a numeric `code`.
- `404`
  `MEDIA_NOT_FOUND`: no media has this ID.
