Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Alejandrin08/Hackathon-SPEI/llms.txt
Use this file to discover all available pages before exploring further.
This endpoint is served by the AI service at
http://localhost:8001. It is an internal service and does not require authentication.POST /ai/risk
Evaluates a pending transaction and returns a risk level with explainable factors. Call this endpoint before presenting the user with the transfer confirmation screen. If the risk level ismedium or high, surface a confirmation dialog to the user before calling POST /api/ledger/transactions.
Model accuracy: 0.75.
Request body
Transaction amount in MXN.
Whether the recipient has never received a transfer from this user.
Local hour of the transaction (0–23).
Total number of transactions in the user’s history. Must be
≥ 0.User’s historical average transaction amount.
User’s historical maximum transaction amount.
Number of prior transfers to this specific recipient. Must be
≥ 0.Whether the current device is new or unrecognized.
Whether the user’s current location differs from their usual location.
Optional user identifier for logging and analytics.
Response
Echoed user identifier from the request.
Version of the risk model that produced the result.
Risk levels
| Level | Recommended action |
|---|---|
low | Proceed normally. |
medium | Show an explanation and require user confirmation. |
high | Require explicit acknowledgment before proceeding. |
Risk factor codes
| Code | Description |
|---|---|
AMOUNT_MUCH_HIGHER_THAN_AVERAGE | Amount is more than 2× the user’s historical average. |
NEW_BENEFICIARY | First transfer to this recipient. |
UNUSUAL_TIME | Transaction is outside normal hours (06:00–22:00). |
NEW_DEVICE | Device has not been seen before. |
LOCATION_CHANGED | Geolocation differs from the user’s usual location. |
LOW_HISTORY | Fewer than 3 prior transactions on the account. |
Response
