The Java SDK is generated from the gateway's two contracts:
- REST client — from
dist/openapi.jsonvia openapi-generator (-g java,nativejava.net.httplibrary — no third-party HTTP dependency). - gRPC client — from
proto/rag.protovia buf (buf.gen.yaml, grpc-java).
The generated source is a build artifact (gitignored), produced on demand.
From the repo root, with buf and openapi-generator-cli (+ a JDK 17+) installed:
task sdk:gen # both halves, all languages
task sdk:gen-openapi # just the REST client
task sdk:gen-proto # just the gRPC stubsThis writes:
sdks/java/generated/— the REST client (Maven/Gradle project, coordinatescom.agentcontextos:agentcontextos-sdk).sdks/java/lib/src/main/java/…— the generated protobuf + gRPC stubs.
import com.agentcontextos.sdk.api.QueriesApi;
import com.agentcontextos.sdk.ApiClient;Identity follows the same model as the other SDKs (Bearer token / dev headers for header-identity routes; body identity for query / retrieve / agent).
See docs/reference/sdks.md and docs/architecture/sdk-generation.md.