← Open Source

anthropics/anthropic-sdk-java on GitHub: Kotlin.

Kotlin
Momentum
+0stars in 24 hours0.0%
396
Stars
108
Forks
35
Contributors
Created 2024-11-26 · Updated 2026-12-04 · #26375 today
Top developers
README

Anthropic SDK for Java

The Anthropic SDK for Java provides access to the Claude API from Java applications.

Documentation

Full documentation is available at platform.claude.com/docs/en/api/sdks/java.

Installation

Gradle

implementation("com.anthropic:anthropic-java:3.17.0")

Maven

<dependency>
  <groupId>com.anthropic</groupId>
  <artifactId>anthropic-java</artifactId>
  <version>3.17.0</version>
</dependency>

Getting started

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.messages.Message;
import com.anthropic.models.messages.MessageCreateParams;
import com.anthropic.models.messages.Model;

// Configures using the `ANTHROPIC_API_KEY` environment variable
AnthropicClient client = AnthropicOkHttpClient.fromEnv();

MessageCreateParams params = MessageCreateParams.builder()
    .maxTokens(1024L)
    .addUserMessage("Hello, Claude")
    .model(Model.CLAUDE_OPUS_5_5)
    .build();
Message message = client.messages().create(params);

Requirements

Java 8+

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details. Versions released before the change from the MIT License, and third-party contributions merged before it, remain under the MIT License. See LICENSE-MIT.

Nearby in the ranking

AI Rank for iPhone

Follow AI model rankings

Download on the App Store