Skip to content

Anthropic (Claude)

The Anthropic plugin provides access to Claude models.

<dependency>
<groupId>com.google.genkit</groupId>
<artifactId>genkit-plugin-anthropic</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Terminal window
export ANTHROPIC_API_KEY=your-api-key
import com.google.genkit.plugins.anthropic.AnthropicPlugin;
Genkit genkit = Genkit.builder()
.plugin(AnthropicPlugin.create())
.build();
ModelResponse response = genkit.generate(
GenerateOptions.builder()
.model("anthropic/claude-sonnet-4-5-20250929")
.prompt("Tell me about AI")
.build());
  • anthropic/claude-opus-4-5-20251101
  • anthropic/claude-sonnet-4-5-20250929
  • anthropic/claude-haiku-4-5-20251001
  • anthropic/claude-4-*
  • anthropic/claude-3-opus-*
  • anthropic/claude-3-sonnet-*
  • anthropic/claude-3-haiku-*
  • Text generation
  • Streaming
  • Tool calling

See the anthropic sample.