Credit
Default risk scored with the relationships around each borrower, from Avra's credit models or from Avra RFM on your own data.
Credit teams make three kinds of decision: approve or decline an application, set its limit and price, and watch the book for borrowers who are getting worse. This page shows the two ways Avra scores credit, the data behind each, how to frame the target, and how scores and probabilities of default reach your policy.
Credit risk is relational
Traditional credit scoring looks at a borrower on its own: payment history, registered debts, basic attributes. A borrower’s risk also depends on its counterparties, its place in a supply chain, and the health of the network around it. A company with a perfect payment history becomes a risk when its main customer starts failing, and a company with no history at all still has owners, suppliers, and a sector.
Thin files
Borrowers with little history are placed by the structure around them, not declined for lack of a file.
Context
A pattern that’s normal for one segment can be a warning in another. The network shows which.
Time
Not only where a borrower stands today, but which way it’s moving.
Two ways Avra scores credit
| Avra GFM | Avra RFM on your data | |
|---|---|---|
| Who it scores | Brazilian companies, by CNPJ | The records in your tables: applicants, accounts, borrowers |
| What it reads | Avra’s knowledge graph of the Brazilian economy | Your applications, accounts, payments, and the links between them |
| What it returns | Probabilities of default (PDs) at five horizons, and embeddings | A score for your target |
| Your definition of default | Learned by a credit model built for your portfolio, from GFM embeddings and your outcomes | The target it predicts |
| Where it runs | Avra’s cloud, through Avra Core | Avra’s cloud, or your AWS account |
Avra GFM serves Brazilian companies through Avra Core. A credit model built for your portfolio on top of it can learn your own definition of default from GFM embeddings and your outcomes. It can also add a 0–1000 score. Avra RFM predicts default over your own tables, in context or with a copy adapted or fine-tuned for your workspace. RFM outputs are scores, not calibrated probabilities.
The data
The GFM needs only a company’s CNPJ, because it reads Avra’s knowledge graph rather than your tables. A credit model built for your portfolio adds your features and outcomes, and the RFM reads your tables directly. A typical lending schema links each company to its owners, its applications and their installments, and the transfers it sends and receives. The schema below is illustrative; see Relational data for how the RFM reads yours.
A default comes from your own records. Here, each installment’s due date and payment date say how far past due it went, and your definition of default turns that into the label. Owners link a company to the other companies they hold, and transfers link it to its counterparties: the structure that places a borrower with a thin file. Every table also carries its snapshot time, when your systems recorded the row, so a backtest sees only what was known on each date. See Time and history.
The prediction problem
Every credit target names who is scored, the outcome, and the window it must happen in:
| Decision | Who is scored | Outcome | Window |
|---|---|---|---|
| Underwriting | New applicants | Default, as you define it | 90 days |
| First payment | Approved loans, at disbursement | The first payment isn’t made | 60 days |
| Early warning | Active borrowers | 30 or more days past due | 90 days |
A label is usable only once its window has closed: a 90-day default label becomes usable 90 days after the date it was predicted for, so recent applications don’t count as good borrowers just because they haven’t had time to default. See What you can predict.
Your definition of default
A credit model learns your definition of a bad outcome from your history:
| Definition | Description |
|---|---|
| FPD | First payment default: the first payment was never made |
| Over30MOB6 | 30+ days past due by month 6 on book |
| Over60MOB12 | 60+ days past due by month 12 on book |
| Charge-off | Written off as a loss |
With the GFM, a downstream credit model is trained on GFM embeddings together with your features and outcomes, a pattern called late fusion, and the PD it reports is the probability of your event. The shared GFM isn’t fine-tuned. With the RFM, the same definition becomes the target it predicts.
What the credit models return
Probabilities of default at five horizons
Avra GFM returns a PD for each company at five horizons, so each decision can use the window that matches its policy.
| Horizon | Field | Typical use |
|---|---|---|
| 30 days | pd_30d |
Short-term liquidity, payment-timing risk |
| 60 days | pd_60d |
Trade credit, early delinquency |
| 90 days | pd_90d |
Standard lending decisions |
| 180 days | pd_180d |
Medium-term facilities, portfolio planning |
| 365 days | pd_365d |
Annual loss forecasting, IFRS 9 staging |
A score for decision rules
A credit model built for your portfolio can also return a 0–1000 score for decision engines and policy rules, derived from its PD: higher means lower risk, and a higher score always means a lower PD. See Score range and interpretation.
Embeddings
The GFM also returns an embedding for each company: one 1024-dimensional vector that your own credit models can read as features, shortened to fit them. See Build with embeddings.
From score to decision
Scores and PDs are inputs to a decision; your policy makes it. Group borrowers into risk bands whose outcomes stay distinct and stable, then map the bands to approve, review, and decline rules and to pricing tiers. Your policy can combine them with the checks you already run. See Risk bands.
In code, the decision is a call at the moment of underwriting and a rule on the result. This example asks a GFM model for one company’s PDs and applies illustrative cutoffs to pd_90d:
import os
import time
import uuid
import requests
API = "https://api.avra.ai"
MODEL_ID = os.environ["AVRA_MODEL_ID"] # from GET /v1/api/models
HEADERS = {"Authorization": f"Bearer {os.environ['AVRA_API_KEY']}"}
def predict(cnpj: str) -> tuple[dict, str]:
"""Return one company's PDs and the request's correlation ID."""
correlation_id = str(uuid.uuid4())
for _ in range(3):
response = requests.post(
f"{API}/v1/api/prediction/{MODEL_ID}/production",
headers={**HEADERS, "X-Correlation-Id": correlation_id},
json={"cnpj": cnpj},
timeout=35,
)
if response.status_code != 429:
break
time.sleep(10) # over the rate limit, the key is blocked for 10 seconds
response.raise_for_status()
return response.json()["result"], correlation_id
def decide(pd_90d: float) -> str:
"""Illustrative cutoffs: set yours from your own risk bands."""
if pd_90d < 0.02:
return "approve"
if pd_90d < 0.08:
return "review"
return "decline"
result, correlation_id = predict("12345678000199")
print(decide(result["pd_90d"][0]), correlation_id) # each output is a one-element list
Store the correlation ID with the decision, so support can find the request later. The response doesn’t name the version that answered, so if you must record the exact version behind each decision, call a pinned version ID instead of the alias. The example retries only rate-limited calls; for server errors and timeouts, see Live predictions. A credit model built for your portfolio, or an RFM model, declares its own inputs and outputs in its version’s schema.
Portfolio monitoring
Score the whole book on a schedule with batch inference, then track how scores move. Find borrowers whose scores are deteriorating before arrears show it, and review limits and terms while there’s still time to act. At the portfolio level, follow aggregate movement across segments, products, and regions.
Rescore the book
Request upload URLs with POST /v1/api/files/upload, upload the book’s Parquet files to them, then submit a batch with POST /v2/api/batches. Add an optional reference_date for backtesting.
{
"model_id": "00000000-0000-0000-0000-000000000000",
"alias": "production",
"input": {
"files": ["avra://uploads/1784143129686/book/2026-10.parquet"]
}
}Collect the results
Subscribe to the batch-ended webhook instead of polling. Once the batch has completed, GET /v2/api/batches/{id}/result returns a signed download_url, valid for 15 minutes.
Compare with the last run
Compare the score distribution with the previous run’s, and count the borrowers who moved between risk bands. Movement toward riskier bands is the early warning.
Check the bands against outcomes
As outcomes come in, check each band’s realized default rate. Bands that converge or cross mean the model or its bands need revalidation. See Risk bands.
How models are evaluated
Every model is backtested on your out-of-time history and shadowed beside your current model before it decides anything. Results can be broken down by product, region, and portfolio slice, including borrowers with little history of their own, not only reported overall. See Evaluation.
| Metric | What it tells you |
|---|---|
| ROC-AUC | Separation between good and bad borrowers across every threshold |
| Gini | The same separation as 2 × ROC-AUC − 1, the form many credit teams report |
| KS | The maximum separation between the good and bad score distributions, widely used to validate credit models |
| PR-AUC | Precision and recall across thresholds. Critical when defaults are rare and false alarms are expensive |
| Default rate by band | Whether risk bands stay distinct and stable over time |
Integration
| Moment | Path | What you get |
|---|---|---|
| Underwriting | Live predictions | PDs or a score at the moment of the decision |
| Portfolio monitoring | Batch inference | Scores for the whole book, on your schedule |
| Your own credit models | Embeddings | GFM embeddings to add to your features, in a late-fusion model |
When a new model version is promoted, the thresholds and risk bands that depend on it need revalidating. Subscribe to model-version-promotion to know when. See Model versioning.
Where to go next
Score range and interpretation
How to read PDs and the 0–1000 score, with example responses.
Risk bands
Turn scores into approve, review, and decline rules, and watch them over time.
Avra GFM
What the GFM reads, what it returns, and its boundaries.
Build with embeddings
Add GFM embeddings to the credit models you already run.