Java SDK
Maven coordinates com.tollara:service-sdk — verify HMAC on incoming gateway requests, validate service keys, usage pre-flight (service-key and JWT estimates), gateway invoke (sync/async), report usage, progress and completion, and poll async job status. Uses Jackson, SLF4J, and the JDK HttpClient (no Spring). Full contract and examples: SDK repo README (sdk-java).
Install
Gradle (Kotlin DSL)
implementation("com.tollara:service-sdk:0.0.1")Maven
<dependency>
<groupId>com.tollara</groupId>
<artifactId>service-sdk</artifactId>
<version>0.0.1</version>
</dependency>Group com.tollara on Maven Central. Bump the version here and under Install by language when you publish a new artifact.
Configuration
| Setting | Default | Notes |
|---|---|---|
| API origin | https://api.tollara.ai | TollaraClient.DEFAULT_API_URL; override with Builder.apiUrl(...) or TOLLARA_API_URL |
| Service ID | Env / builder | TOLLARA_SERVICE_ID or serviceId(...) — optional if Core can infer from the key |
| Service secret | Env / builder | TOLLARA_SERVICE_SECRET or serviceSecret(...) — required (usage HMAC + Core response verification) |
Builder values win when both env and builder are set. In code, env names are also exposed as TollaraClient.ENV_API_URL, ENV_SERVICE_ID, ENV_SERVICE_SECRET. Progress and completion use the full progressUrl / callbackUrl from the gateway (including query params).
Usage report signing: JSON body includes an ISO-8601 timestamp; X-Tollara-Timestamp is Unix epoch seconds for HMAC. Progress/completion sign with the timestamp from the URL query string as returned by the platform.
Main types
TollaraClient— validate key, estimates (includingestimateUsageWithJwt), invoke, report usage, progress, completion, pollingTollaraRequestVerifier— inbound gateway HMAC; defaults to user-context v2CompletionStatus— async completion payloads use uppercase API strings
