IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python module

max.serve.media

Encoding and storage of generated media served by the MAX API.

Classesโ€‹

GeneratedMediaStorageLimitExceededRaised when a generated asset cannot fit into the configured cache.
GeneratedMediaStoreStores generated media files for later download via HTTP.
StoredMediaAssetMetadata for a generated media artifact stored on local disk.

Functionsโ€‹

encode_video_bytes_b64Encodes an MP4 byte payload as a base64 response string.
encode_wav_bytesEncodes a float waveform as a 16-bit PCM WAV payload.

Constantsโ€‹

WAV_MEDIA_TYPEMIME type of the payload encode_wav_bytes() returns.