Multimodal models

Gemini can read photos, listen to audio and watch video because all of them become tokens in the same sequence as your text. Follow a photo, a voice note and a video into the model, and count their tokens.

8 min Free

A multimodal model can take in more than one kind of input: text, images, audio, video and documents. Gemini is multimodal. You can send a photo with a question, a voice note with an instruction, or a video with a request, all in one prompt.

The trick is the same one you’ve seen for text (see Tokens and tokenizers). Each kind of media is turned into tokens, and those tokens go into the same sequence as your text. Then the transformer’s attention (see Attention and transformers) works across all of them, so a word in your question can relate to a corner of a photo or a moment in a recording.

Because media becomes tokens, it also uses your context window and is billed like tokens. The Gemini docs give the counts.

InputHow it’s counted (Gemini API)
Image258 tokens if both sides are 384 px or less. Larger images are tiled into 768×768 tiles, 258 tokens each.
Audio32 tokens per second (1,920 per minute).
VideoFrames sampled at 1 per second by default, plus the audio. About 100 tokens per second at the default (low) media resolution.

Press Play to follow a photo of a bill into the model. Then switch Try it to the voice note and the video, and compare the token counts in the log.

  1. Text
  2. Media
  3. Tokens
  4. Answer
Youtext promptMedia fileimage, audio, videoFiles APIfor large filesMedia → tokenstiles, frames, audioContextone token sequenceGeminimultimodal model

Press Play to watch it run, or step through with ← →.

00/05

Token count

No tokens yet. Press Play.

What to notice

  1. One sequence, one model. You don’t call a separate image or speech service first. Media tokens and text tokens sit side by side, and the same model attends across them.
  2. Media is expensive in tokens. A one-line question is a few tokens. One photo is hundreds or thousands; a minute of video is thousands. Plan your context window and costs around that.
  3. Resolution is a trade-off. Gemini’s media resolution setting controls the maximum tokens per image or video frame. Higher resolution helps read small text and fine detail, but costs more tokens and time.
  4. Video is sampled, not watched. At the default 1 frame per second, very fast action between frames can be missed. Timestamps (MM:SS) let you ask about, and check, specific moments.
  5. Big files go through the Files API. Inline data is limited to 20 MB for the whole request. For larger files, or files you’ll reuse, upload them first and refer to them by URI.

Numbers change between models
Token rates depend on the model and the media resolution you choose, and newer models add options (such as on-demand video processing). Use the API’s count_tokens method, or the usage numbers in each response, rather than hard-coding these figures.

Check your understanding

1. How does Gemini handle a photo you send with a question?
2. Roughly how many tokens is a 2-minute audio clip in the Gemini API?
3. You need Gemini to read tiny print on a scanned form. What should you consider?