anthropic-sdk-java  by anthropics

Claude API integration for Java

Created 1 year ago
286 stars

Top 91.6% on SourcePulse

GitHubView on GitHub
Project Summary

An Anthropic SDK for Java that enables Java applications to seamlessly integrate with the Claude API. This SDK simplifies the process for Java developers to leverage Anthropic's advanced AI models, offering a direct interface for message creation and interaction.

How It Works

The SDK provides a Java client (AnthropicClient) built on OkHttp, abstracting the complexities of direct API calls. Developers can configure the client using environment variables, such as ANTHROPIC_API_KEY, and then instantiate message creation parameters (MessageCreateParams) to interact with specific Claude models. The core approach focuses on providing a type-safe and idiomatic Java API for accessing Claude's capabilities.

Quick Start & Requirements

  • Installation:
    • Gradle: implementation("com.anthropic:anthropic-java:2.16.0")
    • Maven:
      <dependency>
        <groupId>com.anthropic</groupId>
        <artifactId>anthropic-java</artifactId>
        <version>2.16.0</version>
      </dependency>
      
  • Prerequisites: Java 8+. The ANTHROPIC_API_KEY environment variable must be set for authentication.
  • Documentation: Full documentation is available at platform.claude.com/docs/en/api/sdks/java.

Highlighted Details

  • Supports interaction with various Claude models, including Model.CLAUDE_OPUS_4_6.
  • Provides methods for creating and managing messages via the client.messages().create() interface.

Maintenance & Community

  • Contribution guidelines are detailed in the CONTRIBUTING.md file.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: The MIT license is permissive and generally compatible with commercial use and closed-source applications.

Limitations & Caveats

  • No explicit limitations or caveats are mentioned in the provided README.
Health Check
Last Commit

9 hours ago

Responsiveness

Inactive

Pull Requests (30d)
10
Issues (30d)
2
Star History
36 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.