POST
/
v1
/
messages
curl -X POST https://www.anyfast.ai/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "system": "You are a helpful AI assistant.",
    "messages": [
      {"role": "user", "content": "Explain quantum computing"}
    ],
    "stream": true,
    "max_tokens": 8000,
    "thinking": {
      "type": "enabled",
      "budget_tokens": 1200
    }
  }'
{
  "id": "msg_01XFDUDYJgAACzvnptvVoYEL",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "thinking",
      "thinking": "Let me think about quantum computing..."
    },
    {
      "type": "text",
      "text": "Quantum computing is a type of computation..."
    }
  ],
  "model": "claude-sonnet-4-20250514",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 25,
    "output_tokens": 500
  }
}
Official documentation: https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking
Enable extended thinking mode for Claude models to perform complex reasoning tasks.

Endpoint

Native Format: POST /v1/messages Chat Compatible Format: POST /v1/chat/completions

Request Parameters (Native Format)

model
string
required
The model to use. Recommended: claude-sonnet-4-20250514
max_tokens
integer
required
The maximum number of tokens to generate.
messages
array
required
Input messages array.
thinking
object
required
Thinking configuration object.
  • type (string): Set to "enabled" to activate thinking
  • budget_tokens (integer): Maximum tokens for the thinking process
stream
boolean
default:"false"
Whether to stream the response.
system
string
System prompt.
curl -X POST https://www.anyfast.ai/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "system": "You are a helpful AI assistant.",
    "messages": [
      {"role": "user", "content": "Explain quantum computing"}
    ],
    "stream": true,
    "max_tokens": 8000,
    "thinking": {
      "type": "enabled",
      "budget_tokens": 1200
    }
  }'
{
  "id": "msg_01XFDUDYJgAACzvnptvVoYEL",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "thinking",
      "thinking": "Let me think about quantum computing..."
    },
    {
      "type": "text",
      "text": "Quantum computing is a type of computation..."
    }
  ],
  "model": "claude-sonnet-4-20250514",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 25,
    "output_tokens": 500
  }
}