﻿# Build mixed text and image messages for OpenRouter

Understand OpenRouter multimodal content blocks by separating image input from text instructions and keeping Responses image fields distinct from Chat Completions examples.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/learn-openrouter-content-blocks/
Language: en

A multimodal request is not just a text prompt with an image filename appended. OpenRouter’s image-input documentation describes multipart content for supported models. The structure tells the API which content is text and which is visual input, while the application supplies the question that makes the image relevant to the task.

## Choose the model’s actual input capability

For a hypothetical diagram-explanation app, select a model and provider endpoint that accept image input. A text-only route cannot infer the visual content simply because the request includes a URL in prose. Capability discovery should precede request construction. Keep the current supported modalities in the integration record rather than assuming that a provider’s general brand implies every model behind it can interpret images.

## Use the chosen API’s block shape

The current image-input page presents Responses examples using `input_image` content parts and an `image_url` value. Chat Completions has its own documented content-part structure. Do not combine those field shapes into a hybrid object. For the diagram app, keep text and image parts inside the relevant user message according to the endpoint contract, so the client can validate the request before sending it.

## Preserve a useful relationship between parts

The documentation recommends text before images, with guidance for cases where images come first inside the same user message. Give each image a clear role in the question. If the diagram app compares alternatives, identify which image is the reference and which is the candidate. Ordering alone should not carry an undocumented meaning that disappears when another component rearranges the content array.

## Choose URL or embedded data deliberately

The image page supports direct URLs and base64 data URLs. A remote address must be retrievable by the processing path; a workstation-local file path is not a public image URL. Embedded data can represent an image that the application already holds, subject to documented model and request limits. Choose the representation according to accessibility and size rather than assuming a browser’s logged-in image can be fetched upstream.

## Validate the visual task result

A successfully accepted image block does not establish a correct explanation of the diagram. Use a representative image with known relationships and assess whether the answer identifies them. Keep the source image associated with the response so a reviewer can inspect the basis of the interpretation. The client’s job is to preserve modality and task context, while domain evaluation determines whether the model’s visual conclusion is useful.

## Documentation and further study

- [Image Inputs](https://openrouter.ai/docs/guides/overview/multimodal/image-understanding).

- [OpenRouter API Reference - Complete Documentation](https://openrouter.ai/docs/api-reference/overview).

- [Provider Routing - Smart Multi-Provider Request Management](https://openrouter.ai/docs/guides/routing/provider-selection).

Related engineering guides: [Fetching the OpenRouter model catalog before deployment](/journal/openrouter-model-catalog-api/); [OpenRouter base URL: configuring a compatible client](/journal/openrouter-base-url/).
