# Vision and image input > Send images to multimodal models โ€” encoding, size limits, and what it costs. _Source: https://aiprimetech.io/docs/api-reference/vision/ ยท Home > Docs > API reference_ Claude and Gemini models accept images alongside text. Images are content blocks inside an ordinary message. ## Base64 image ```json { "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [{ "role": "user", "content": [ {"type": "image", "source": { "type": "base64", "media_type": "image/png", "data": "iVBORw0KGgoAAAANSUhEUg..." }}, {"type": "text", "text": "What does this chart show?"} ] }] } ``` ## Python ```python import base64, anthropic img = base64.standard_b64encode(open("chart.png", "rb").read()).decode() client = anthropic.Anthropic(api_key="sk-your-key", base_url="https://aiprimetech.io") msg = client.messages.create( model="claude-sonnet-4-6", max_tokens=1024, messages=[{"role": "user", "content": [ {"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": img}}, {"type": "text", "text": "What does this chart show?"}, ]}], ) print(msg.content[0].text) ``` ## Practical limits | Constraint | Guidance | |---|---| | Formats | PNG, JPEG, GIF and WebP | | Resolution | Very large images are downscaled upstream. Resizing to roughly 1500px on the long edge before sending saves tokens with no quality loss. | | Cost | Images bill as input tokens, roughly proportional to area. A full-page screenshot can cost more than a page of text. | | Multiple images | Several image blocks per message are allowed; each one is billed. | > In an agent loop, images are resent with the history on every turn like any other content. Drop them from the transcript once they have been described, or one screenshot gets paid for repeatedly. - [Messages API](https://aiprimetech.io/docs/api-reference/messages/) โ€” Content block reference - [Models](https://aiprimetech.io/docs/getting-started/models/) โ€” Which models are multimodal --- _ClaudeAPIKey.dev is an independently operated, Anthropic-compatible API gateway. Not affiliated with Anthropic._