Use images in GPT function prompts in Sheets
Use images in your prompts with GPT for Sheets and vision models. These models are multimodal and can process both text and images as input.
Don't have image URLs yet? Learn how to host images on Google Drive for AI processing.
Supported image formats: PNG, JPEG, WebP, non-animated GIF
Models that support vision
We recommend using gpt-5.2 to analyze images, but you can use any vision model supported by GPT for Sheets.
Click here for a list of all vision models supported by GPT for Sheets.
| Provider | Model | Without API key | With API key |
|---|---|---|---|
OpenAI | gpt-4.1 | ✅ | ✅ |
gpt-4.1-mini | ✅ | ✅ | |
gpt-4.1-nano | ✅ | ✅ | |
gpt-4o | ✅ | ✅ | |
gpt-5 | ✅ | ✅ | |
gpt-5-chat | ✅ | ✅ | |
gpt-5-mini | ✅ | ✅ | |
gpt-5-nano | ✅ | ✅ | |
gpt-5.1 | ✅ | ✅ | |
gpt-5.2 | ✅ | ✅ | |
o1 | ✅ | ✅ | |
o3 | ✅ | ✅ | |
o4-mini | ✅ | ✅ | |
Anthropic | claude-4-sonnet | ✅ | ✅ |
claude-4.5-haiku | ✅ | ✅ | |
claude-4.5-sonnet | ✅ | ✅ | |
Mistral | mistral-medium | ❌ | ✅ |
xAI | grok-4-1-fast | ❌ | ✅ |
grok-4-1-fast-non-reasoning | ❌ | ✅ |
Prompt images
Use the GPT_VISION function to describe or analyze images in individual cells.
Using the model switcher
-
In the sidebar, select GPT functions.
-
Expand the model switcher and select a vision model.

-
In the , select a cell and write your formula:
=GPT_VISION("Extract the coffee brand from this image. Normalize the brand name to title case.",C9)
The formula uses the vision model selected in the model switcher.
For instructions on how to write formulas with the GPT_VISION function and set the image resolution, see the GPT_VISION reference.
Specifying the model in the formula
-
In the , select a cell and write your formula, specifying a vision model directly in the formula:
=GPT_VISION("Extract the coffee brand from this image. Normalize the brand name to title case.",C9, , , "gpt-4.1")
The formula uses the vision model regardless of what's currently selected in the model switcher.
For instructions on how to write formulas with the GPT_VISION function and set the image resolution, see the GPT_VISION reference.
Host images on Google Drive for AI processing
To process an image in GPT for Sheets, you need the direct URL of the image and the URL must be publicly accessible.
To host an image on Google Drive so that GPT for Sheets can access and process it:
-
Upload the image to Google Drive.
-
Share the image publicly using the Anyone with the link option. For more information, see Google Drive Help.
tipTo prevent other users from commenting or editing the image, set the access role to Viewer.
-
Copy the link.
-
Get the image file ID from the link URL, and build the following new URL with the ID:
https://drive.google.com/uc?id=<image-file-id>For example:
You now have a direct image URL that you can access and process in GPT for Sheets.