Data sources
CredAI scores whatever implements the data contract. Today that's the built-in generator; pointing it at a real API is configuration, not code.
Active provider
SyntheticChecking…
Switch to real data
- 1. Expose
GET /customers,GET /customers/:idand optionallyGET /applicationsreturning the contract below. - 2. Set three environment variables and redeploy.
.env.local
CREDAI_DATA_PROVIDER=http
CREDAI_DATA_API_URL=https://data.your-bank.example/v1
CREDAI_DATA_API_KEY=•••••••• # sent as a Bearer tokenTry it locally: npm run mock:api starts a partner API with a different population on port 4010.
Data contract
Validated with a Zod schema on every record. Invalid records are rejected and counted, never coerced.
- Utility bills
utility.bills[]: issuedAt, dueDate, paidAt | null, amount, kind, providerLESCO, K-Electric, SNGPL - Mobile account
telecom.accountOpenedAt, payments[]: date, amount, kind, statusJazz, Zong, Telenor, Ufone - Mobile wallet
wallet.transactions[]: date, amount, direction, status, balanceAfterJazzCash, Easypaisa, SadaPay - Bank account
bank.transactions[]: date, amount, direction, category, balanceAfterAny account with statement access - Repayment history
credit.installments[]: dueDate, paidAt | null, amountMicrofinance banks, BNPL
Feature catalogue
17 features engineered from the contract over a trailing 12-month window. The same code runs in training and in production.
| Feature | Source | Definition | Weight |
|---|---|---|---|
Utility bills paid on time utility_on_time_ratio | Utility bills | Share of utility bills paid on or before the due date. | +0.585 |
Utility bills left unpaid utility_unpaid_ratio | Utility bills | Share of bills still unpaid more than 30 days after the due date. | -0.062 |
Utility history length utility_months_observed | Utility bills | Months in the 12-month window with at least one bill. | 0.000 |
Mobile account activity telecom_active_ratio | Mobile account | Share of months with at least one successful top-up or bill payment. | +0.174 |
Mobile number age telecom_tenure_months | Mobile account | Months since the mobile account was opened. | +0.345 |
Failed mobile payments telecom_failed_rate | Mobile account | Failed top-ups or bill payments as a share of all attempts. | -0.068 |
Wallet income regularity wallet_active_ratio | Mobile wallet | Share of months with incoming wallet transfers. | 0.000 |
Failed wallet payments wallet_failed_rate | Mobile wallet | Failed wallet transactions, usually from insufficient balance. | 0.000 |
Wallet balance cushion wallet_buffer_ratio | Mobile wallet | Average month-end wallet balance relative to monthly wallet spending. | +0.125 |
Income regularity income_regularity | Bank account | 1 − coefficient of variation of monthly account inflows. | 0.000 |
Income covers spending cash_flow_coverage | Bank account | Total inflows divided by total outflows over the window. | +0.134 |
Spending volatility expense_volatility | Bank account | Coefficient of variation of monthly outflows. | -0.222 |
Overdrawn days negative_balance_days | Bank account | Average days per month the account closed below zero. | -0.208 |
Savings buffer buffer_months | Bank account | Average month-end balance divided by average monthly spending. | +0.197 |
Instalments paid on time repayment_on_time_ratio | Repayment history | Share of previous loan instalments paid by the due date. | +0.203 |
Days late on instalments repayment_avg_days_late | Repayment history | Average days late across previous instalments (0 when on time). | -0.074 |
Data sources connected data_coverage | Derived | Share of the five supported sources the customer has connected. | +0.167 |