Philter SDK for Java
The Philter SDK for Java is an API client for Philter. Philter identifies and manipulates sensitive information such as Protected Health Information (PHI) and personally identifiable information (PII) in natural language text. Philter is built upon the open source PII/PHI detection engine Phileas.
Refer to the Philter API specification for details on the available endpoints.
Installation
Releases are available from Maven Central. Add the dependency to your Maven configuration:
<dependency>
<groupId>ai.philterd</groupId>
<artifactId>philter-sdk-java</artifactId>
<version>3.0.0</version>
</dependency>
To track the latest development build, depend on the current -SNAPSHOT version and add the Maven Central snapshot repository to your build (snapshots are not served from the default Maven Central repository):
<repositories>
<repository>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>ai.philterd</groupId>
<artifactId>philter-sdk-java</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
Snapshots are development builds: they are mutable and are periodically pruned, so pin a release version for anything you need to reproduce.
Compatibility
As of version 3.0.0, this client targets the Philter 4.0.0 API. Earlier versions of the client are not compatible with Philter 4.0.0 and later.
| philter-sdk-java | Philter API | Branch |
|---|---|---|
| 3.0.0 and later | 4.x | main |
| 2.0.0 | none (do not use) | |
| 1.x | 1.x to 3.x | 1.x |
Development for Philter 4.x happens on the main branch. The 1.x branch supports Philter 3 and earlier.
The 2.0.0 on Maven Central was published in June 2026 against an early Philter 4.0 API that has since changed, so it does not work with Philter 4.0.0. Use 3.0.0 or later.
The client requires Java 11 or later. Requests are made with the JDK's java.net.http.HttpClient, so the SDK adds no third-party HTTP dependency to your application.
Usage
With an available running instance of Philter, to filter text:
import ai.philterd.philter.PhilterClient;
import ai.philterd.philter.model.FilterResponse;
PhilterClient client = new PhilterClient.PhilterClientBuilder()
.withEndpoint("https://127.0.0.1:8080")
.withApiKey("your-api-key")
.build();
FilterResponse filterResponse = client.filter("context", "default", text);
To filter text with explanation:
import ai.philterd.philter.model.ExplainResponse;
ExplainResponse explainResponse = client.explain("context", "default", text);
Philter 4.0.0 expects an Authorization header on nearly every endpoint. Provide its value with withApiKey(...); the value is sent verbatim, so include any scheme prefix (for example "Bearer ") if your deployment requires it. The health() endpoint does not require authentication.
In addition to filtering, the client covers the full Philter 4.0.0 API: policies (including versions, diffs, rollbacks, descriptions and notes, managed policies, and copies), contexts, documents, legal holds, the redaction ledger, the audit log and its CSV export, custom lists, redact lists, re-identification, user management, sign-in with passwords, session keys, and MFA, webhooks, managing API keys, rotating the output signing key, admin settings, and administrator listings of policies, contexts, custom lists, ledger chains, and legal holds across all users. Every endpoint in the API specification has a corresponding method, and every optional query parameter can be supplied.
License
This project is licensed under the Apache License, version 2.0.
Copyright 2026 Philterd, LLC. Philter is a registered trademark of Philterd, LLC.