Java integration guide
Java prompt compression
Java powers enterprise AI applications. SuperCompress provides a REST API that integrates seamlessly with Spring Boot, Quarkus, and other Java frameworks.
Spring Boot client
import org.springframework.web.client.RestClient;
public class SuperCompressClient {
private final RestClient restClient;
private final String apiKey;
public SuperCompressClient(String apiKey) {
this.apiKey = apiKey;
this.restClient = RestClient.create();
}
public String compress(String context, String query) {
var request = new CompressRequest(context, query);
var response = restClient.post()
.uri("https://supercompress.dev/api/v1/compress")
.header("X-API-Key", apiKey)
.body(request)
.retrieve()
.body(CompressResponse.class);
return response.compressedText();
}
record CompressRequest(String context, String query) {}
record CompressResponse(String compressed_text) {}
}
Frequently asked questions
Does it work with Spring AI?
Yes. Call compress() before passing context to Spring AI's template-based prompt builders.
Can I use it with Quarkus?
Yes. The REST API is framework-agnostic. Use Quarkus's REST Client reactive with the same endpoint.
Build with less context
Put compression in front of your next LLM call.
Use the hosted API or run SuperCompress locally. Keep the evidence, drop the token waste, and measure the savings before it reaches your model.