메인 콘텐츠로 건너뛰기

Documentation Index

Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt

Use this file to discover all available pages before exploring further.

권장 엔드포인트

최소한의 요청

{
  "model": "claude-sonnet-4-20250514",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "image",
          "source": {
            "type": "url",
            "url": "https://example.com/ui.png"
          }
        },
        { "type": "text", "text": "Describe the UI structure in this screenshot." }
      ]
    }
  ]
}

cURL 예

curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "image",
            "source": {
              "type": "url",
              "url": "https://example.com/ui.png"
            }
          },
          { "type": "text", "text": "Describe the UI structure in this screenshot." }
        ]
      }
    ]
  }'

파이썬 예제

from anthropic import Anthropic

client = Anthropic(api_key="<ANTHROPIC_API_KEY>")

response = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image",
                    "source": {
                        "type": "url",
                        "url": "https://example.com/ui.png",
                    },
                },
                {"type": "text", "text": "Describe the UI structure in this screenshot."},
            ],
        }
    ],
)

print(response.content[0].text)

Node.js 예

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY,
});

const response = await client.messages.create({
  model: "claude-sonnet-4-20250514",
  max_tokens: 1024,
  messages: [
    {
      role: "user",
      content: [
        {
          type: "image",
          source: {
            type: "url",
            url: "https://example.com/ui.png"
          }
        },
        { type: "text", text: "Describe the UI structure in this screenshot." }
      ]
    }
  ]
});

console.log(response.content[0].text);

모범 사례

  • 대부분의 비전 프롬프트에서 명령 앞에 이미지 블록을 넣습니다.
  • 대규모 또는 반복 입력에 Files API 사용
  • Claude는 OCR, UI 이해 및 중재 스타일 비전 작업에 특히 효과적입니다.