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
AnthropicAutoConfigurationchecks both the configuredanthropic.api-keyproperty and theANTHROPIC_API_KEY/ANTHROPIC_AUTH_TOKENenvironment variables at application startup, and throws immediately with an actionable error message if neither is present. - The check goes through Spring's
Environmentabstraction rather than rawSystem.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