> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Multimodal Tracing

> Record image, audio, video, and PDF content on OpenInference spans, check instrumentor coverage, and set privacy and size limits for media.

Trace images, audio, video, and PDFs alongside text with OpenInference. Arize AX shows them on spans, in datasets and experiments, and as previews in Playground variables.

![Arize AX span detail for an analyze-invoice LLM span, with the user message showing the text prompt, an inline preview of a scanned invoice image, and an invoice.pdf link, followed by the assistant's answer](https://storage.googleapis.com/arize-assets/doc-images/multimodal/multimodal-span-image-and-pdf.webp)

An LLM span whose user message contains text, an image, and a PDF.

## Supported modalities

| Modality | How it appears in Arize AX | Supported formats |
| - | - | - |
| Images | Inline previews in messages and tables | PNG, JPEG, GIF, WebP |
| Audio | **Input Audio** and **Output Audio** tabs with waveforms and optional transcripts | WAV, MP3/MPEG, OGG, Opus, WebM |
| Video | **Input Video** and **Output Video** tabs | MP4, WebM, and other HTTPS video URLs |
| Documents | **Input Document** and **Output Document** tabs, and PDF links in messages and tables | PDF (`application/pdf`) |

Arize AX supports the following URL schemes:

* `https://` and `http://`
* `data:` for base64-encoded content
* `arize://` for managed references created at ingestion
* `gs://`, `s3://`, and `azure://` for object storage. URLs are signed for display when attachment signing is configured for your space.

PDF support is available in Arize AX Cloud and on-prem releases that include receiver PDF support. Inline PDFs must have a valid `%PDF-` signature and are limited to approximately 20 MiB of decoded content. For larger PDFs, use HTTPS or object storage URLs.

## Record multimodal content

OpenInference stores multimodal content on LLM spans using the `message.contents` array. Each content part has a type and corresponding payload attributes.

| Content type | Payload attributes |
| - | - |
| `text` | `message_content.text` |
| `image` | `message_content.image.image.url` |
| `audio` | `message_content.audio.audio.url`, optional `audio.transcript` |
| `video` | `message_content.video.video.url` |
| `document` | `message_content.document.document.url`, `.content`, or `.id`, with optional `mime_type` and `name` |

For non-LLM spans, such as a tool that performs OCR or returns a completed form, use span-level attributes instead:

* `input.images.N.image.url` / `output.images.N.image.url`
* `input.documents.N.document.*` / `output.documents.N.document.*`

On LLM spans, record media in `message.contents` without duplicating the same assets in span-level attributes.

### Record PDFs

PDFs use the `document` content type in OpenInference.

```text theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
llm.input_messages.0.message.contents.0.message_content.type = "document"
llm.input_messages.0.message.contents.0.message_content.document.document.url = "data:application/pdf;base64,JVBERi0x..."
llm.input_messages.0.message.contents.0.message_content.document.document.mime_type = "application/pdf"
llm.input_messages.0.message.contents.0.message_content.document.document.name = "invoice.pdf"
```

| Attribute | Description |
| - | - |
| `document.url` | A document URI or base64-encoded PDF data URI. |
| `document.content` | Inline text passed to the provider. Preserved byte-for-byte for citations. |
| `document.id` | A provider Files API ID. Arize AX stores the ID for reference but does not retrieve the file. |
| `document.mime_type` | MIME type from the request, when provided. Use `application/pdf` for PDFs. |
| `document.name` | Display name in the UI. Defaults to **PDF Document (N)** when omitted. |

Set exactly one of `document.url`, `document.content`, or `document.id`. Store provider file IDs in `document.id`, not `document.url`.

### Example: Trace text, an image, and a PDF

The following example records a single user message containing a text prompt, a logo image, and an invoice PDF.

```python theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
from openinference.semconv.trace import (
    DocumentAttributes,
    ImageAttributes,
    MessageAttributes,
    MessageContentAttributes,
    SpanAttributes,
)
from opentelemetry import trace

tracer = trace.get_tracer(__name__)

with tracer.start_as_current_span("analyze-invoice") as span:
    span.set_attribute(SpanAttributes.OPENINFERENCE_SPAN_KIND, "LLM")
    span.set_attribute(SpanAttributes.LLM_MODEL_NAME, "claude-sonnet-5-5")
    span.set_attribute(f"{SpanAttributes.LLM_INPUT_MESSAGES}.0.{MessageAttributes.MESSAGE_ROLE}", "user")

    base = f"{SpanAttributes.LLM_INPUT_MESSAGES}.0.{MessageAttributes.MESSAGE_CONTENTS}"

    span.set_attribute(f"{base}.0.{MessageContentAttributes.MESSAGE_CONTENT_TYPE}", "text")
    span.set_attribute(
        f"{base}.0.{MessageContentAttributes.MESSAGE_CONTENT_TEXT}",
        "Summarize this invoice and describe the logo.",
    )

    span.set_attribute(f"{base}.1.{MessageContentAttributes.MESSAGE_CONTENT_TYPE}", "image")
    span.set_attribute(
        f"{base}.1.{MessageContentAttributes.MESSAGE_CONTENT_IMAGE}.{ImageAttributes.IMAGE_URL}",
        "https://example.com/logo.png",
    )

    span.set_attribute(f"{base}.2.{MessageContentAttributes.MESSAGE_CONTENT_TYPE}", "document")
    doc = f"{base}.2.{MessageContentAttributes.MESSAGE_CONTENT_DOCUMENT}"
    span.set_attribute(f"{doc}.{DocumentAttributes.DOCUMENT_URL}", "https://example.com/invoice.pdf")
    span.set_attribute(f"{doc}.{DocumentAttributes.DOCUMENT_MIME_TYPE}", "application/pdf")
    span.set_attribute(f"{doc}.{DocumentAttributes.DOCUMENT_NAME}", "invoice.pdf")
```

## Auto-instrumentation support

OpenInference defines multimodal semantic conventions across Python, JavaScript, Go, and Java. Auto-instrumentation coverage varies by provider and framework.

| Instrumentor | Images | Audio / video and other content | PDFs |
| - | - | - | - |
| Python Anthropic | Supported | Thinking and text blocks recorded as structured content | Supported, including base64, URL, text, and Files API ID sources |
| JavaScript Anthropic | Supported | Partial | Document blocks may be serialized as JSON text |
| OpenAI (Python / JS) | Supported (`image_url`, `input_image`) | Partial; audio mapping is incomplete | File and `input_file` parts are not yet mapped to document attributes |
| Google GenAI / Vertex | Supported (image MIME types) | Partial | PDF and non-image file parts are not yet mapped to document attributes |
| Bedrock, LiteLLM, LangChain, LlamaIndex, Vercel AI | Supported in most cases | Varies | Use manual attributes or Anthropic-style document blocks |

If your instrumentor does not record document attributes automatically, use the manual instrumentation example above or the helpers in [Customize your traces](/docs/ax/instrument/customize-your-traces.md).

The Python Anthropic instrumentor is the reference implementation for recording PDFs using OpenInference document conventions.

## View multimodal content

Multimodal content appears in these places:

* **Messages on a span:** In **Pretty** mode, each message shows its parts in order: text, image previews, video players, and PDF links. A PDF link shows the document name, or **PDF Document (N)** if there is none.
* **Media attached to the span itself:** Media recorded on span-level attributes, such as `input.documents` on a tool span, gets its own tab next to the span's input or output: **Input Document**, **Input Audio**, **Input Video**, and the matching **Output** tabs.
* **Datasets, experiments, annotations, and the Playground:** Dataset rows, experiment tables, annotation tables, and Playground variables show the same previews.

PDFs open in a new browser tab. Arize AX does not embed a PDF viewer.

![Arize AX dataset examples table for multimodal-invoice-demo, with an image column showing a scanned invoice preview and a pdf column showing an invoice.pdf link](https://storage.googleapis.com/arize-assets/doc-images/multimodal/multimodal-dataset-image-and-pdf.webp)

A dataset with image and PDF columns, rendered as an image preview and a PDF link.

## Privacy and size limits

Use OpenInference [masking and redaction settings](/docs/ax/instrument/mask-and-redact-data.md) to control which multimodal content is exported from your application.

| Setting | Effect |
| - | - |
| `OPENINFERENCE_HIDE_INPUTS` / `OPENINFERENCE_HIDE_OUTPUTS` | Hides messages and span-level image and document attributes for the corresponding inputs or outputs. |
| `OPENINFERENCE_HIDE_INPUT_IMAGES` | Removes images from input messages and `input.images`. |
| `OPENINFERENCE_HIDE_INPUT_TEXT` / `OPENINFERENCE_HIDE_OUTPUT_TEXT` | Also redacts inline `document.content`. |
| `OPENINFERENCE_BASE64_IMAGE_MAX_LENGTH` | Limits base64 data URIs in both `image.url` and `document.url`. Defaults to 32000. |

There is no separate `HIDE_INPUT_DOCUMENTS` flag.

For inline images and PDFs that exceed the configured limit, use an OpenInference blob uploader to upload content to external storage. The span can then store the destination URI instead of `__REDACTED__`.

## Next steps

> [card] [Multimodal evals](/docs/ax/evaluate/multimodal-evals.md)
>
> Map images, audio, and PDFs into LLM-as-a-judge templates using **Use as file**.

> [card] [Mask and redact data](/docs/ax/instrument/mask-and-redact-data.md)
>
> Hide or truncate multimodal content before export.

> [card] [Anthropic tracing](/docs/ax/integrations/llm-providers/anthropic/anthropic-tracing.md)
>
> Auto-instrument Claude calls containing document blocks.

> [card] [OpenInference multimodal spec](https://github.com/Arize-ai/openinference/blob/main/spec/content/multimodal.md)
>
> Reference the semantic conventions for text, images, audio, video, and documents.
