Skip to main content

Multimodal

Files API

Upload PDFs and other documents once, then reuse file_id across requests. See the Files API overview and Upload File reference. ShuYou supports multimodal inputs and can be used via multiple API protocols:
  • OpenAI Chat Completion API: Uses the image_url, file (PDF/video), and input_audio (audio) content types
  • OpenAI Responses API: Uses the input_image and input_file (PDF only) content types
  • Anthropic Messages API: Uses the image, document, audio, and video content types; supports both base64 and URL
  • Google Vertex AI API: Uses Part objects to pass images, files, audio, and video
Supported input types:
  • Text input
  • Image input
  • PDF input
  • Audio input
  • Video input

OpenAI Chat Completion API

Image Input

Use an image URL

Python
TypeScript

Use Base64-encoded image

Python
TypeScript

PDF Input

Use a PDF URL

Python
TypeScript

Use Base64-encoded PDF

Python
TypeScript

Audio Input

Use the input_audio type to pass an audio file; Base64 encoding is required.
Python
TypeScript

Video Input

Use the file type to pass a video file. Both URL and Base64 encoding are supported.

Use a video URL

Python
TypeScript

Use Base64-encoded video

Python
TypeScript

OpenAI Responses API

The Responses API uses the input_image and input_file content types to handle multimodal inputs.
The Responses API currently supports image and PDF inputs only, and does not support audio or video. To process audio or video, use the Chat Completion API or the Vertex AI API.

Image Input

Python
TypeScript
cURL

Use Base64 encoding

PDF Input

Python
cURL

Anthropic Messages API

The Anthropic Messages API supports multimodal inputs using the image, document, audio, and video content types, and supports both base64 encoding and URL input.
With ShuYou protocol conversion, the Anthropic protocol can be routed to models that support audio and video (such as Gemini). When using multimodal-capable models, all input types are available.Note: Audio and video inputs must use Google Cloud Storage gs:// URLs (for example, gs://cloud-samples-data/generative-ai/audio/pixel.mp3) to be processed correctly by Gemini models. If you need to use local files or other URLs, we recommend using the Vertex AI API protocol.

Supported formats

Use an image URL

Python
TypeScript
cURL

Use Base64 encoding

Python
cURL

Multiple images

Claude supports analyzing multiple images in a single request:

PDF Input

Use a PDF URL

Python
TypeScript
cURL

Use Base64 encoding

Python
cURL

Multiple documents

You can analyze multiple PDF documents in a single request:

Audio Input

Supports multiple audio formats: WAV, MP3, AIFF, AAC, OGG, FLAC
Python
TypeScript
cURL

Video Input

Supports multiple video formats: MP4, AVI, MOV, MKV, WEBM, etc.
Python
TypeScript
cURL

Google Vertex AI API

Vertex AI’s Gemini models use Part objects to pass multimodal content, supporting images, PDFs, videos, and more.

Supported formats

Image Input

Python
TypeScript
cURL

Use Base64 encoding

PDF Input

Multiple images

Audio Input

Gemini supports multiple audio formats: WAV, MP3, AIFF, AAC, OGG, FLAC
Python
cURL

Video Input

Gemini supports multiple video formats: MP4, AVI, MOV, MKV, WEBM, etc.
Python
cURL

Protocol Comparison