POST
/
v1
/
chat
/
completions
curl -X POST https://www.anyfast.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "messages": [
      {
        "role": "user",
        "content": [
          {"type": "text", "text": "What is in this image?"},
          {"type": "image_url", "image_url": {"url": "https://example.com/image.png"}}
        ]
      }
    ],
    "max_tokens": 1024,
    "stream": false
  }'
{
  "id": "chatcmpl-claude-vision-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "claude-sonnet-4-20250514",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The image shows..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 300,
    "completion_tokens": 50,
    "total_tokens": 350
  }
}
Official documentation: https://docs.anthropic.com/en/docs/build-with-claude/vision
Analyze and understand images using Claude models with non-streaming response in OpenAI-compatible format.

Authentication

Authorization: Bearer YOUR_API_KEY

Request Parameters

model
string
required
The Claude model ID. For example: claude-sonnet-4-20250514.
messages
array
required
A list of messages with multimodal content. Include image_url for images.
max_tokens
integer
Maximum number of tokens to generate.
temperature
number
default:"1"
Sampling temperature between 0 and 2.
stream
boolean
default:"false"
Set to false for non-streaming response.
curl -X POST https://www.anyfast.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "messages": [
      {
        "role": "user",
        "content": [
          {"type": "text", "text": "What is in this image?"},
          {"type": "image_url", "image_url": {"url": "https://example.com/image.png"}}
        ]
      }
    ],
    "max_tokens": 1024,
    "stream": false
  }'
{
  "id": "chatcmpl-claude-vision-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "claude-sonnet-4-20250514",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The image shows..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 300,
    "completion_tokens": 50,
    "total_tokens": 350
  }
}