Java library for the DeepXL API: fraud detection, document parsing, and ID verification.
Installation
Maven
Add the following dependency to your pom.xml:
<dependency>
<groupId>ai.deepxl.sdk</groupId>
<artifactId>deepxl</artifactId>
<version>1.0.0</version>
</dependency>
Example
Create an API key in the DeepXL Dashboard (Settings → API Keys).
Treat your API key like any environment secret. Do not commit to a public repository or store in plain text.
import ai.deepxl.sdk.DeepXLClient;
import ai.deepxl.sdk.DeepXLError;
import com.google.gson.JsonObject;
DeepXLClient client = new DeepXLClient(System.getenv("DEEPXL_API_KEY"));
try {
JsonObject detection = client.detectFile("document", "./file.pdf");
JsonObject parsed = client.parseFile("light", "./id.pdf");
JsonObject verification = client.verifyFiles("./id.jpg", "./selfie.jpg");
System.out.println(detection.get("likelihood") + " " + parsed.get("documentType") + " " + verification.get("verified"));
} catch (DeepXLError e) {
// Handle error
}
Client methods
Account
- checkUsage() – GET /v1/account. Returns
UsageResponse (usage and limits per media type).
Models
- getDetectionModels() – GET /v1/detection-models. Returns
JsonArray of model objects.
- getParsingModels() – GET /v1/parsing-models. Returns
JsonArray of model objects.
Fraud detection
- detect(modelName, fileName, fileData [, tagsJson]) / detectFile(modelName, filePath [, tagsJson]) – POST /v1/detection. Models:
document, object. Returns JsonObject.
- getDetection(detectionId) – GET /v1/detection/. Returns
JsonObject.
- listDetections() / listDetections(params) – GET /v1/detection. Params:
Map with limit, offset, sortBy, direction, tagFilter. Returns JsonObject with totalCount, count, data.
Document parsing
- parse(modelName, fileName, fileData [, tagsJson]) / parseFile(modelName, filePath [, tagsJson]) – POST /v1/parse. Models:
light, performance. Returns JsonObject.
- getParse(parseId) – GET /v1/parse/. Returns
JsonObject.
- listParses() / listParses(params) – GET /v1/parse. Returns
JsonObject with totalCount, count, data.
ID verification
- verify(idFileName, idFileData, selfieFileName, selfieFileData [, tagsJson]) / verifyFiles(idFilePath, selfieFilePath [, tagsJson]) – POST /v1/verification. Returns
JsonObject.
- getVerification(verificationId) – GET /v1/verification/. Returns
JsonObject.
- listVerifications() / listVerifications(params) – GET /v1/verification. Returns
JsonObject with totalCount, count, data.
File retrieval
- getFile(fileName) – GET /v1/files/. Returns
byte[]. Use the file name from the files array in any analysis response.
Errors
All methods throw DeepXLError for API errors (invalid key, bad request, usage limit, not found, etc.).