Skip to main content
Messages API enables search through a versioned server tool entry in tools[]. Use this when you need Anthropic-compatible request format and only a minimal public search tool shape.

Request Shape

The supported public shape on this endpoint is:
{
  "type": "web_search_20250305",
  "name": "web_search"
}
Use it in a normal request like this:
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.naga.ac",
    api_key="YOUR_API_KEY",
)

message = client.messages.create(
    model="claude-sonnet-4.5",
    max_tokens=256,
    messages=[
        {
            "role": "user",
            "content": "Find the latest Reuters coverage about AI regulation in the UK and cite your sources.",
        }
    ],
    tools=[
        {
            "type": "web_search_20250305",
            "name": "web_search",
        }
    ],
)

print(message.content)

What This Surface Supports

On Messages, the public request schema only accepts the minimal versioned tool identifier. It does not expose richer search configuration on this endpoint. If you need a configurable search object with filters or user location, use:

Common mistakes

  • trying to pass web_search_options or Responses-style search tools on this surface
  • expecting filters or location controls in the public Messages request shape
  • using Messages search for new work when Responses would be the simpler teaching path

Caveats

  • the currently documented version here is web_search_20250305
  • this surface is for Anthropic protocol compatibility, not the primary search teaching path
  • search configuration is intentionally narrower here than on Responses or Chat Completions