Skip to content

v0.1.1 — Fail-fast API key validation

Latest

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