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
Synthetic
Checking…
Switch to real data
  1. 1. Expose GET /customers, GET /customers/:id and optionally GET /applications returning the contract below.
  2. 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 token

Try 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, provider
    LESCO, K-Electric, SNGPL
  • Mobile account
    telecom.accountOpenedAt, payments[]: date, amount, kind, status
    Jazz, Zong, Telenor, Ufone
  • Mobile wallet
    wallet.transactions[]: date, amount, direction, status, balanceAfter
    JazzCash, Easypaisa, SadaPay
  • Bank account
    bank.transactions[]: date, amount, direction, category, balanceAfter
    Any account with statement access
  • Repayment history
    credit.installments[]: dueDate, paidAt | null, amount
    Microfinance 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.

FeatureSourceDefinitionWeight
Utility bills paid on time
utility_on_time_ratio
Utility billsShare of utility bills paid on or before the due date.+0.585
Utility bills left unpaid
utility_unpaid_ratio
Utility billsShare of bills still unpaid more than 30 days after the due date.-0.062
Utility history length
utility_months_observed
Utility billsMonths in the 12-month window with at least one bill.0.000
Mobile account activity
telecom_active_ratio
Mobile accountShare of months with at least one successful top-up or bill payment.+0.174
Mobile number age
telecom_tenure_months
Mobile accountMonths since the mobile account was opened.+0.345
Failed mobile payments
telecom_failed_rate
Mobile accountFailed top-ups or bill payments as a share of all attempts.-0.068
Wallet income regularity
wallet_active_ratio
Mobile walletShare of months with incoming wallet transfers.0.000
Failed wallet payments
wallet_failed_rate
Mobile walletFailed wallet transactions, usually from insufficient balance.0.000
Wallet balance cushion
wallet_buffer_ratio
Mobile walletAverage month-end wallet balance relative to monthly wallet spending.+0.125
Income regularity
income_regularity
Bank account1 − coefficient of variation of monthly account inflows.0.000
Income covers spending
cash_flow_coverage
Bank accountTotal inflows divided by total outflows over the window.+0.134
Spending volatility
expense_volatility
Bank accountCoefficient of variation of monthly outflows.-0.222
Overdrawn days
negative_balance_days
Bank accountAverage days per month the account closed below zero.-0.208
Savings buffer
buffer_months
Bank accountAverage month-end balance divided by average monthly spending.+0.197
Instalments paid on time
repayment_on_time_ratio
Repayment historyShare of previous loan instalments paid by the due date.+0.203
Days late on instalments
repayment_avg_days_late
Repayment historyAverage days late across previous instalments (0 when on time).-0.074
Data sources connected
data_coverage
DerivedShare of the five supported sources the customer has connected.+0.167