Java library for DeepXL fraud detection services.
GitHub Repository
View source code and contribute on GitHub
Installation
Maven
Add the following dependency to your pom.xml:
<dependency>
<groupId>com.deepxl.sdk</groupId>
<artifactId>deepxl</artifactId>
<version>1.0.0</version>
</dependency>
Example
To use the DeepXL client, you must first create an API key in the dashboard. Navigate to Settings -> API Keys -> Create API Key.
Treat your API key like any environment secret. Do not commit to a public repository or store in plain text.
import deepxl.DeepXLClient;
import deepxl.DeepXLError;
import deepxl.AnalysisResult;
DeepXLClient client = new DeepXLClient(System.getenv("DEEPXL_API_KEY"));
try {
AnalysisResult result = client.analyzeFile("document", "./file.pdf");
System.out.println(result.likelihood);
} catch (DeepXLError e) {
// Handle error
}
Client Methods
checkUsage
Returns the monthly usage quota and current usage for the payment period for each media type.
Returns
Returns a UsageResponse object:
| Property | Type |
|---|
| imageUsageLimit | int |
| imageUsage | int |
| videoUsageLimit | int |
| videoUsage | int |
| audioUsageLimit | int |
| audioUsage | int |
| documentUsageLimit | int |
| documentUsage | int |
analyze
Analyze file data with DeepXL fraud detection.
| Parameter | Type | Description |
|---|
| modelName | String | Model to use (document, object) |
| fileName | String | Name of the file to analyze |
| fileData | byte[] | Byte array of file data |
While you can use a constant string as file name, it is recommended you use unique identifiers to make files easier to find in analysis history.
analyzeFile
Analyze a file by path. Does the same thing as analyze but takes a file path instead of binary data.
| Parameter | Type | Description |
|---|
| modelName | String | Model to use (document, object) |
| filePath | String | Path to the file |
Returns
Both analyze and analyzeFile return an AnalysisResult object:
| Property | Type | Description |
|---|
| likelihood | double | Percent likelihood (0-100) that the file has been manipulated |
| reasoning | String[] | Model reasoning |
| modelResults | Object | Model-specific outputs |