Skip to main content
What a model takes in and gives out is a list of modalities: text, image, document, audio and video. Media travels as session files: a file block of a message names a file by alias, and an image a model draws is written back as a session file. A model’s modalities are columns of the catalog on the language model page.

Modalities

A file block’s modality comes from its content type: A catalog model’s inputs list the modalities it reads and its outputs the ones it writes; text is in both. Two checks hold a flow to them:
  • The definition check holds what a consumer asks for against the model. A genai.chat that lists image in output_modalities is an error on a catalog model whose outputs lack it: model: <id> gives no image, which <consumer> asks for. A run that names a model is held to the same rule.
  • The call holds each file block against the model, before any vendor is called, and refuses it with unsupported_media, naming the file:
A model the catalog does not know passes the definition check and the check on the model’s inputs; a file whose content type is no modality, or that its dialect cannot carry, is still refused.

What each vendor takes

Neither OpenAI nor Anthropic takes audio or video on the APIs BlobHub uses, and Anthropic’s models give no images. Which of a gateway’s models take what is the catalog’s inputs and outputs; a model it does not list passes the check on a model’s inputs.

Files in

A file block in system, current or history names a session file, and so does one inside a tool result. The provider reads each distinct file once per call and sends it inline as base64 of the same bytes on every turn.
  • No vendor file APIs. A session file holds at most 4 MiB (workflow.session_file_bytes, refused as session_file_too_large; see Limits), within every vendor’s inline limit, so nothing is uploaded to a vendor, nothing expires on its side, nothing needs deleting there, and the request stays byte-stable for caching.
  • A file that is not there fails the call: file_not_found: "<alias>" is not a file in this session.
  • A system message’s files go at the head of the first user turn on every vendor, since Anthropic’s and OpenAI Responses’ instructions take text only.
  • A generated image in an assistant turn is sent as the text [file: <name>, <content type>] to a protocol that takes no media there (Anthropic and Chat Completions). To edit such an image, put it in current.
How each protocol carries a file: A gateway’s media_parts entry says where audio and video go: input_audio (the bytes and their format), audio_url or video_url (a data URL), or file. The entries are on Vendors and Gateways. A tool result’s file goes to Chat Completions as [file: <name>, <content type>], with a warning that files are not carried there. OpenRouter is told to let the model read a PDF itself (engine: native, a registry default), never through its paid OCR.

Images out

A genai.chat whose output_modalities list holds image (the default is ["text"]) asks the model for images. What each protocol asks for: Editing is the same call: an image in current with an instruction, and image in output_modalities, returns the edited image. Image settings (size, aspect ratio, quality) are each vendor’s own and go in vendor_settings; no shared setting fits all three. Each image becomes a session file, written as the call returns, through the same path as any upload: the content type, the 4 MiB ceiling and the session’s object quota hold. The answer holds a file block for it at its place among the text. Its alias is
where component_run counts the runs of components in the execution up to the leg that entered the node, index counts the answer’s images from 0, and ext is png, jpg, webp or gif. The file’s name is image-<component_run>-<index>.<ext>. A retried leg has the same component_run, so it overwrites its own files instead of adding more; a node’s second run in one execution has a different one. Images that Gemini marks as thoughts are skipped. An image over the 4 MiB limit fails the call: file_too_large: image <n> of the answer is <size> bytes, over the 4 MiB session file limit. A session whose object quota refuses an image fails it with that limit’s own message. A 1K image is well under the limit. Sending a generated image back to its own vendor renders it from the file’s bytes, the same on every turn.

Voice notes

The conversation widget’s composer records a voice note. The browser records WebM/Opus (audio/webm) where it can and MP4/AAC (audio/mp4) where it cannot, and stops by itself at five minutes. The recording is staged like a dropped file, uploaded as a session file when the message is sent, and posted as an audio file block beside the text. Gemini takes both formats. A model or gateway that does not take the recorded format refuses it at the call, with unsupported_media. A voice note is a file like an image: the model answers it in text.

Usage by modality

Where a vendor reports tokens per modality, the answer’s usage carries by_modality, a map from modality to its input_tokens and output_tokens. Gemini reports it, and OpenAI counts audio tokens; a vendor that reports none leaves the field out. See Prompt Caching and Usage.