Rate
POST /v1/decision-machine-1/rate puts one text on a scale you define. You send the levels in order, from low to high. The model scores every level. The response gives you a weighted position (score), the winning level index (level), a confidence and the full scores array. The levels are descriptions, not numbers. “Major outage” carries meaning; “4” does not.
When to use it
- You need an ordered judgment: severity, priority, sentiment strength, harm, seniority, risk.
- You want a continuous number, not a bucket.
scoremoves between levels. - You want to combine several judgments. Run one rate call per dimension, then weight the scores with composite scoring.
- Use Classify instead when the options have no order, such as
billingagainstshipping. - Use Yes / no instead when one threshold is the whole decision, such as “this ticket is urgent”.
Three example decisions
- An incident report, on the scale
No impact → Minor inconvenience → Degraded service → Major outage. - A product review, on the scale
Very negative → Negative → Mixed → Positive → Very positive. - A support message, on the scale
Calm → Annoyed → Frustrated → Threatening to leave.
Each scale describes what each level looks like. The model reads the level text, so write levels a person could apply without a rubric.
Request
text and texts are mutually exclusive. No API key is required during the launch period.
Response
score— number. The probability-weighted position,Σ pᵢ · i. It runs from 0 toscale.length − 1.level— integer. The index of the most likely level, the argmax ofscores.confidence— number from 0 to 1.1 − normalized entropyoverscores. A single peak gives 1. A flat spread gives 0.scores— number[]. One normalized probability per level, inscaleorder. The array sums to 1.
Every number is rounded to three decimals.
scores is an array, not an object. The level name lives in your own scale array at the same index. Read it back with scale[result.level].
Reading the numbers
The example rates a severe incident on four levels. The response splits the mass evenly: scores is [0, 0, 0.5, 0.5]. “No impact” and “Minor inconvenience” are ruled out. “Degraded service” and “Major outage” tie.
Read each number:
score2.5 sits exactly between level 2 and level 3. This is the honest summary of a tie.level2 is the argmax. The two scores print as a tie because every number is rounded to three decimals. The argmax reads the unrounded scores, so a printed tie can resolve either way.confidence0.5 reports the split. The model picked the top half of the scale and went no further.
Two rules follow from this example.
Route on score, not on level. score keeps the ordering information that level throws away. A ticket at 2.5 outranks a ticket at 2.0, and both share level 2.
Use confidence as a second axis. High score plus high confidence acts. High score plus low confidence goes to a person. This example, at 0.5, belongs in a review queue. A calmer text on the same scale returned {"score":0.852,"level":1,"confidence":0.691,"scores":[0.149,0.85,0.001,0]} — one clear peak, and safe to route without review.
Pick your bands per action, not per system. Thresholds and confidence routing gives the act, confirm and escalate bands.
score is a position on your scale, not a percentage. On a 4-level scale the top is 3.0, not 1.0. Divide by scale.length − 1 when you need a 0 to 1 number.
Batching
Send texts instead of text. One scale applies to every text. The response is { "results": [...] }, one entry per text, in input order.
Real response:
Each text costs one inference call, so a batch of 32 costs 32 calls. Batching covers result ordering and the 32 limit.
Limits and gotchas
- Write levels as descriptions.
["1","2","3","4","5"]gives the model nothing to read. Use words that describe the case. Writing good statements and labels covers the level text. - Keep the order right. Index 0 is the low end.
scoreandlevelmean nothing if your scale is unsorted. - Keep the levels distinct. Adjacent levels that overlap in meaning produce the tie you saw above, and a low
confidence. - Long text is chunked at 2,000 characters. A level’s score is its maximum over the chunks, so a single severe paragraph can lift the rating of a long document. Long text and chunking explains the split.
- Errors. A scale of one item returns
400 invalid_requestwith the messagescale: Too small: expected array to have >=2 items. A body with neithertextnortextsreturnsbody: provide text or texts, not both. That message is misleading in the second case. Errors lists every code.
One rate call answers one question. Split a broad judgment such as “lead quality” into separate calls for budget, authority and fit, then weight the scores in your own code.
Next
- Thresholds and confidence routing — turn
scoreandconfidenceinto act, confirm and escalate bands. - Composite scoring — combine several rate calls into one number you control.
- Content moderation — rate harm, flag hard cases, route the rest to a person.