Skip to main content
Vibes supports four input modalities - images, audio, video, and documents - through a set of message helper functions. Each helper wraps the raw binary or URL data into a UserModelMessage that the agent loop passes directly to the model. On the output side, tools can return BinaryContent (raw bytes with a MIME type) that flows back to the model as part of the conversation.

Content type routing


Images

The image parameter accepts a URL string, a base64-encoded string, or raw bytes. The optional text parameter adds a text prompt alongside the image. mediaType is optional — when omitted, no MIME type hint is sent and the provider infers the format from the content.
When passing a base64 string, include only the encoded payload - not the data:image/jpeg;base64, prefix. Vibes sends the data part directly to the model provider.

Audio

Unlike imageMessage, the mediaType argument is required for audio - the runtime has no way to infer the codec from raw bytes.
Audio modality support depends on the model provider. Check your provider’s documentation to confirm which audio formats and codecs are accepted before sending audio messages.

Video

Video follows the same shape as audio: use fileMessage with a video/* MIME type. Provider support varies.
Video support is experimental for most providers. Verify that your chosen model accepts video/mp4 (or the specific video/* MIME type) before sending video in production.

Documents

Use fileMessage to send PDFs, plain text, or other document formats alongside a prompt.
Common document MIME types:

UploadedFile

When a provider has already stored a file server-side (for example, via the Anthropic Files API), you reference it with an UploadedFile object rather than re-uploading the bytes.
The type discriminant is "uploaded_file" with an underscore. Using "uploaded-file" (hyphen) will fail the type check and the provider will reject the request.
Use uploadedFileSchema when an agent tool needs to accept an UploadedFile as a parameter:

Binary content from tools

Tools can return BinaryContent - raw bytes with a MIME type - which the agent loop forwards to the model as part of the next turn. This lets a tool produce an image, audio clip, or document that the model can reason about.

Tool multi-modal return flow

To learn how tools integrate with the broader agent loop and how to compose toolsets, see Tools.

Provider compatibility

The table below summarises which content types are accepted by major providers. Always verify your provider’s current documentation before sending multimodal content in production — provider capabilities change frequently.
Audio content is encoded as a FilePart (type "file") because the AI SDK UserContent union does not include a separate audio part. Providers that support audio consume it via the file part with the appropriate mediaType (e.g. "audio/wav", "audio/mpeg").