> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neosantara.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Vision Anthropic

> Kirim gambar multimodal ke model Claude menggunakan blok source Base64 dan URL.

Endpoint `/anthropic/v1/messages` mendukung pemrosesan dokumen dan visual menggunakan blok gambar [Anthropic](https://www.anthropic.com/?utm_source=neosantara-docs\&utm_medium=referral) standar.

```python Python (Anthropic SDK - Base64) icon="python" theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
from anthropic import Anthropic
import base64
import os

client = Anthropic(
    base_url="https://api.neosantara.xyz/anthropic",
    api_key=os.environ["NEOSANTARA_API_KEY"]
)

with open("diagram_arsitektur.png", "rb") as img_file:
    image_data = base64.b64encode(img_file.read()).decode("utf-8")

response = 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": image_data
                    }
                },
                {
                    "type": "text",
                    "text": "Jelaskan alur data antar komponen pada diagram arsitektur ini."
                }
            ]
        }
    ]
)

print(response.content[0].text)
```

```bash cURL icon="terminal" theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
curl -X POST https://api.neosantara.xyz/anthropic/v1/messages \
  -H "x-api-key: $NEOSANTARA_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "image",
            "source": {
              "type": "url",
              "url": "https://images.unsplash.com/photo-1551288049-bebda4e38f71"
            }
          },
          {
            "type": "text",
            "text": "Analisis grafik ini."
          }
        ]
      }
    ]
  }'
```

## Format Media yang Didukung

* `image/jpeg`
* `image/png`
* `image/gif`
* `image/webp`

Ukuran berkas maksimum per gambar adalah 20 MB.

## Langkah Selanjutnya

| Kebutuhan | Panduan |
| :- | :- |
| Vision di Chat Completions | [OpenAI Vision](https://docs.neosantara.xyz/id/gateway/chat-completions/vision.md) |
| Ekstraksi Teks Otomatis | [OCR Dokumen](https://docs.neosantara.xyz/id/gateway/capabilities/ocr.md) |
| Extended Thinking | [Extended Thinking](https://docs.neosantara.xyz/id/gateway/anthropic-messages/thinking.md) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.