Basic Usage
Use Base64 Images
You can also pass a base64 data URL when the image is local or private:<BASE64_ENCODED_IMAGE> with the complete base64 encoding of the image file, for example base64.b64encode(open("photo.png", "rb").read()).decode() in Python.
Base64 images must start with the
data:image/<type>;base64, prefix (for example data:image/jpeg;base64,). Raw base64 without the prefix is rejected. Images must be at least 64×64 pixels, and SVG is not supported. If an image is rejected, the error message states the reason.Choose a Vision Model
Use the Text Models page or the Models API to find models that support vision. Vision support is listed in model capabilities.Prompting Tips
- Tell the model what to focus on: objects, text, layout, safety, defects, or differences.
- Ask for structured output when your application needs fields you can parse.
- Keep image URLs accessible to the API, or use base64 data URLs for private images.
- Use a model with enough context if you combine images with long instructions.