v2.1.0 — Latest
TUSK AI API Reference
The TUSK AI API is organized around REST. Returns JSON-encoded responses, uses standard HTTP response codes, and accepts form-encoded request bodies.
Base URL
https://api.tusk-ai.com/v1
Quick Start
JavaScript
Python
Java
C#
// Initialize the TUSK AI client
import { TuskAI } from '@tusk-ai/sdk';
const client = new TuskAI({
apiKey: 'your_api_key_here',
environment: 'production'
});
// Analyze a transaction
const result = await client.transactions.analyze({
merchant: 'Amazon.com',
amount: 299.99,
currency: 'USD',
accountId: 'acc_12345'
});
console.log(result.riskScore); // 0.25
console.log(result.confidence); // 0.94
API Reference
POST/v1/transactions/analyze
Analyze a transaction for fraud risk. Returns risk score, confidence, and feature explanations.
GET/v1/transactions/{id}
Retrieve a specific transaction analysis result by its unique ID.
POST/v1/assistant/chat
Send a message to the RAGFlow-powered banking assistant and receive a context-aware response.
GET/v1/alerts
List all fraud alerts. Supports filtering by severity, date range, and status.
POST/v1/alerts/{id}/resolve
Mark an alert as resolved with optional resolution notes and action taken.
GET/v1/analytics/summary
Get aggregated fraud detection statistics for a given time period.
Sample Response
{
"id": "txn_9fKz2Mv8pQ",
"status": "analyzed",
"riskScore": 0.25,
"confidence": 0.94,
"processingTime": 47,
"verdict": "approve",
"models": [
{ "name": "lstm_v3", "score": 0.22 },
{ "name": "random_forest", "score": 0.28 },
{ "name": "behavioral", "score": 0.25 }
],
"createdAt": "2025-03-26T08:51:00Z"
}