Package org.springframework.ai.anthropic


@NullMarked package org.springframework.ai.anthropic
Spring AI integration with Anthropic's Claude models using the official Anthropic Java SDK.

This package provides a ChatModel implementation that enables interaction with Claude models through Anthropic's Messages API. The integration supports both synchronous and streaming conversations, tool/function calling, and full observability through Micrometer.

Key Classes:

Quick Start:


 AnthropicChatModel chatModel = new AnthropicChatModel(
     AnthropicChatOptions.builder()
         .model("claude-sonnet-4-20250514")
         .maxTokens(1024)
         .build());

 ChatResponse response = chatModel.call(new Prompt("Hello, Claude!"));
 
Since:
2.0.0
See Also: