Request policy
Updated
Add an optional policy object to a RightNow System Zero decide request. Answers below your confidence threshold come back without a decision, and a request whose maximum possible cost exceeds your cap is refused before any work.
Policy fields
min_confidence- Optional. A finite number greater than 0 and at most 1. An answer whose
confidenceis below it abstains; equal confidence passes. on_low_confidence- Optional. Only
abstainis accepted. An omitted value also abstains. max_cost_usd- Optional. A cap in US dollars, greater than 0 and at most 1,000, with at most eight decimal places.
Every member is optional, and an empty object is valid. Send policy in a decide request or in a stream's start request. The gateway applies it; the model never receives it.
on_low_confidence: "error" and require_calibrated are not available. A request that sets either, including require_calibrated: false, returns 400 invalid_request.
The published SDKs have no policy support: their request types omit policy, and decisionsFor and decisions_for refuse an abstained answer. Send policy over HTTP and read answers yourself, as this guide shows. Playground runs send no policy.
Validation
An invalid policy returns 400 invalid_request with type invalid_request_error and error.retryable: false. A null policy, numeric strings, values that are not finite, wrong types and unknown members are invalid.
error.param is policy for a value that is not an object, policy.<member> for a known member and policy.* for an unknown one. A decision path that takes no policy refuses one with error.param policy.
The cap allows at most eight decimal places after exponent expansion, and trailing zeros do not count: 0.29, 0.07 and 3e-8 are valid, and 1e-9 is not. The gateway reads the original JSON number, so digits that a JSON parser would round away still count.
Abstained answers
After the model replies, the gateway compares each answer's confidence with min_confidence. An answer below the threshold keeps its other fields as evidence, loses decision and gains abstained: true and abstention_reason: "low_confidence".
Passing answers and question refusals keep their usual shape. A successful reply echoes the policy you sent, with no defaults added. In this illustrative reply, damaged_in_transit passes and the two other answers abstain.
Never act on an abstained answer. Its choice, score, probability, probabilities and alternatives are model evidence, not a decision. Check abstained before you read decision.
Cost cap
Before admission, the gateway compares the request's maximum possible cost with max_cost_usd. It converts the cap exactly, at 100,000,000 microcents per US dollar, and the bound includes media minimums. Equal cost passes.
A request over the cap returns 400 policy_max_cost_exceeded before any model work. It is not counted toward monthly usage and is not charged. The bound can exceed the final cost, so a cap near the expected cost can refuse a request that would have cost less.
error.details.countedfalse: nothing was counted or charged.error.details.policy- The policy you sent.
error.details. estimated_cost_microcents - The maximum possible cost of the request, rounded up to whole microcents.
error.details. max_cost_microcents - Your cap in microcents.
This refusal has error.retryable: false. Raise max_cost_usd or send a smaller request. The amounts in this example are illustrative.
Usage and billing
An abstained answer is charged exactly like any answered question. It counts toward the monthly cap and pays the normal per-answer question fee, alongside the request's other charges. See Pricing.
Question refusals stay unanswered and are not charged. A request refused by the cost cap is neither counted nor charged.
Streams
In a stream, send policy inside start.request. It stays fixed across state changes, and a mutation cannot alter it. A policy error arrives as an error event with fatal: false and does not close the stream. See Streaming.
Replay and stored data
Policy is part of the Idempotency-Key fingerprint. Changing the policy under the same key returns 400 idempotency_key_reuse.
A keyed replay returns the original result, abstentions included, without new model work, counting or charges. See Idempotency.
Stored replies keep their policy and abstentions under the same 24-hour answer window and eviction limits as other replies. Usage records keep only a count of abstained questions, with no policy, threshold, question name, reason or answer.