Skip to content

MediaContent

HTTP API schema

← HTTP API reference

One binary media result (audio or image). Exactly one of `data` (base64, inline) or `url` (a short-lived Port OS URL with its `expiresAt`) is present; the host rejects a result that carries both or neither. A plugin may return the vendor's fetchable `url` without `expiresAt`; the host always fetches it, republishes or inlines the bytes as the caller's `responseFormat` asks, and fills `byteLength`, so callers never see a vendor URL.

MediaContent fields

mimeTypestringRequired

The media type of the bytes.

Allowed values: audio/mpeg, audio/wav, audio/ogg, audio/flac, image/png, image/jpeg, image/webp.

byteLengthinteger

Size of the decoded bytes. Always present on host responses.

minimum: 1

maximum: 26214400

durationMsinteger

Duration of audio in milliseconds, when known.

minimum: 0

widthinteger

Image width in pixels, when known.

minimum: 1

heightinteger

Image height in pixels, when known.

minimum: 1

urlstring

Short-lived URL of the media (valid until `expiresAt`, at most 10 minutes).

expiresAtstring

When `url` stops working. Present with `url` on host responses.

format: "date-time"

datastring

Base64 encoded bytes, at most 10 MiB decoded.

format: "byte"

maxLength: 13981016

View source specification ↗