Skip to content

Releases: brandoneilers/anthropic-spring-boot-starter

v0.1.1 — Fail-fast API key validation

Choose a tag to compare

@brandoneilers brandoneilers released this 30 Jul 19:37

What's changed

  • Fail fast at startup when no Anthropic API key is configured. Previously, a missing key would only surface on the first actual API call — potentially deep in a request, in production, after deploy. Now AnthropicAutoConfiguration checks both the configured anthropic.api-key property and the ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN environment variables at application startup, and throws immediately with an actionable error message if neither is present.
  • The check goes through Spring's Environment abstraction rather than raw System.getenv(), so it still honors the SDK's normal env var fallback while remaining fully unit-testable (no real OS env var manipulation required).
  • Two new tests covering both the failure case and the legitimate env-var-only configuration case.

Install

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

<dependency>
  <groupId>com.github.brandoneilers.anthropic-spring-boot-starter</groupId>
  <artifactId>anthropic-spring-boot-starter</artifactId>
  <version>v0.1.1</version>
</dependency>

Full Changelog: v0.1.0...v0.1.1

v0.1.0 — Initial release

Choose a tag to compare

@brandoneilers brandoneilers released this 29 Jul 23:52

First release of the Anthropic Spring Boot Starter — auto-configuration for the Anthropic Java SDK, so a Spring Boot app gets a configured AnthropicClient and a chat convenience bean with zero manual wiring.

What's included

  • Auto-configurationAnthropicClient and AnthropicChatService beans, activated automatically when the SDK is on the classpath, driven by anthropic.* properties
  • AnthropicChatService — a thin convenience wrapper for the common "send a prompt, get text back" case; the raw AnthropicClient bean is still available for tool use, streaming, vision, etc.
  • Standard Spring Boot conventions@ConditionalOnClass, @ConditionalOnMissingBean, @ConfigurationProperties, so it composes cleanly with the rest of your app's configuration
  • Sample app (anthropic-spring-boot-sample) — a minimal working Spring Boot app with a /api/chat endpoint
  • Full test suite, CI via GitHub Actions, JitPack support

Install

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

<dependency>
  <groupId>com.github.brandoneilers.anthropic-spring-boot-starter</groupId>
  <artifactId>anthropic-spring-boot-starter</artifactId>
  <version>v0.1.0</version>
</dependency>

Requirements

Java 21+, Spring Boot 3.4.x, anthropic-java 2.52.0

See the README for configuration properties and usage examples.