Gemini models support multimodal input — text, images, audio, and documents can all be included in a single request. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/google/llms.txt
Use this file to discover all available pages before exploring further.
aisdk/google provider inspects each Content object in your message and maps it to the correct Gemini content type, handling both URL references and base64-encoded inline data transparently.
Content types
The table below shows how PHP AI SDK content type constants map to thetype field sent in the Gemini request body:
| Type | SDK constant | Gemini type field |
|---|---|---|
| Image | Content::TYPE_IMAGE | image |
| Audio | Content::TYPE_AUDIO | audio |
| Document/File | Content::TYPE_FILE | document |
Content::TYPE_TEXT) is always mapped to { "type": "text" } and can be freely mixed with media parts in the same message.
Image from URL
Pass an image URL and the provider will build a{ type: 'image', uri: '...', mime_type: '...' } part:
Image from base64 / inline data
When you have raw image bytes (from a file upload, in-memory buffer, or data URI), pass them viaContent::imageBase64() or Content::imageData(). The provider encodes them as inline_data:
Audio input
The same pattern applies to audio. UseContent::audioUrl() for a hosted file or Content::audioData() for inline bytes. The Gemini type field becomes "audio":
File / document input
PDF and other document formats are supported viaContent::TYPE_FILE. The Gemini type field becomes "document":
Multimodal input is supported by models that advertise the
image_input, audio_input, and file_input capabilities. Based on the current model catalogue, all gemini-1.5*, gemini-2.0*, gemini-2.5*, and gemini-3* text models include all three capabilities. Image-generation variants (e.g. gemini-3.1-flash-image) support image_input only.