# Scoring models (/score-model)



A scoring model rates the risk of one kind of decision, such as a payment, a sign-up or a loan application. It scores a record by asking Grayson a few yes/no questions about it and weighing the answers. Score each record with [`POST /v1/score`](/reference/score/score) and a `score_id` of your own, unique within the scoring model.

Scores run from 0 (lowest risk) to 1000 (highest). Once a scoring model is calibrated, a score divided by 1,000 is about the chance the outcome is bad: about 1 in 4 records scored near 250 turn out bad. Before then, scores rank records, but their scale is an estimate. See [Calibration](/score-model/calibration).

## Creating a scoring model [#creating-a-scoring-model]

Create one with [`POST /v1/score/models`](/reference/score/create-scoring-model), from either:

* **Its criteria:** `name` and `criteria` (what the decision is and what a bad outcome means). It's ready at once, with no questions: add your own to start scoring, or [calibrate](/score-model/calibration) it with labeled records and Finic writes its questions.
* **Labeled records:** `name` and `data`. It's calibrated from the start, in about two minutes.

```bash
curl https://api.finic.ai/v1/score/models \
  -H "Authorization: Bearer $FINIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Card-not-present payment fraud", "criteria": "Card-not-present payments at an online store. Bad: the payment was charged back as fraud within 90 days."}'
```

Rename it, change its criteria or archive it with [`update_model`](/reference/score/update-scoring-model).

## Labeled records [#labeled-records]

Labeled records are past records with `is_bad`: `true` when the outcome was bad, `false` when it was good. Send them as a JSON array of objects, or as CSV with a header row:

```csv title="labeled.csv"
amount_usd,merchant_category,account_age_days,new_device,billing_country,ip_country,is_bad
2400.00,electronics,19,true,US,NG,true
58.12,grocery,1260,false,US,US,false
310.00,gift_cards,3,true,US,US,true
```

* **At least 100 rows, with 20 of each outcome.** Up to 2,000 are used; the request can be up to 2 MB, and each row up to 60,000 bytes.
* **`is_bad`** is `true` or `false`, `1` or `0`, or `"yes"` or `"no"`.
* **In CSV,** an empty cell is `null`, and a dotted column name such as `merchant.category` is a nested field.
* **Send the fields you'll score with,** and only what was known at the time of the decision.

## Schema [#schema]

A scoring model's first calibration records the fields of its labeled records and their types. Records you score are checked against them, and rejected with `400 schema_mismatch` if they differ. Send `skip_schema_validation: true` to score one anyway, or `update_schema: true` to make its fields the new schema. Until its first calibration, a scoring model takes any record.

## Questions and weights [#questions-and-weights]

[`GET /v1/score/models/{model_id}`](/reference/score/get-scoring-model) lists the questions a scoring model uses, strongest first:

```json title="200 (questions only)"
"questions": [
  { "id": "q004", "text": "This record is a card payment. Is the IP address in a different country from the billing address?", "source": "finic", "weight": 0.91 },
  { "id": "q051", "text": "Was the account opened less than a week before the payment?", "source": "user", "weight": 0.38 }
]
```

`weight` is how much a question moves the score: positive when a likely yes raises it. Before the first calibration, it's Finic's estimate. `source` is `finic` or `user`. To see the answers behind one score, send `include_questions: true` to [`POST /v1/score`](/reference/score/score).

## Changing questions [#changing-questions]

Add your own yes/no questions with [`add_questions`](/reference/score/add-questions), and remove them with [`remove_question`](/reference/score/remove-question). Before a scoring model is calibrated, a question you add counts right away. After, it's tried at the next calibration, which uses it if it helps. To remove a question the calibrated score uses, calibrate with `remove_questions`.

## Weights [#weights]

Each question the score uses has one weight: how far a likely yes moves the score. Positive raises it, negative lowers it, and the larger the number the more the question counts. [`get_model`](/reference/score/get-scoring-model) shows every question's weight.

A weight changes in two ways:

* **A calibration fits it** from your labeled records. Before the first calibration, Finic estimates it.
* **You set it**, on the scoring model's page in the Finic app, with [`set_question_weight`](/reference/score/set-question-weight), or with the MCP tool of the same name:

```bash
curl -X PATCH https://api.finic.ai/v1/score/models/scm_01M4XRC000RT2GZSKYPD8J86G9/questions/q002 \
  -H "Authorization: Bearer $FINIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"weight": 2}'
```

Whichever happened last is the weight. Setting one replaces the fitted or estimated weight and changes the score at once. Calibrating fits every weight again, including the ones you set, so set them again afterwards if you still want them. After you change a weight by hand, the accuracy a calibration reported no longer describes the score.

Weights go from -10 to 10; fitted and estimated ones are mostly between -3 and 3. `0` keeps asking the question without counting its answer. A weight belongs to the scoring model, not to a score request, and the pre-made scores (`POST /v1/score/<use_case>`) have fixed ones.

## Jobs [#jobs]

Creating from labeled records and calibrating return `202` with a `job_id`. Each takes about two minutes. Check it with [`GET /v1/jobs/{job_id}`](/reference/score/get-job-status) every 10 seconds or so, until `complete` is `true`. See [Limits](/reference#scoring-models) for how many you can run.

## What's stored [#whats-stored]

A scoring model keeps its name, criteria, schema and questions. Each score keeps its `score_id`, the score and Grayson's answers. The record you score is kept for as long as your [data retention](/grayson-api/data#data-retention) says, so you can open it under Events in the Finic app, and not at all under Zero Data Retention. The labeled records you create or calibrate with are kept, encrypted, only while their job runs, and deleted when it ends.
