Decision mode
Ask typed questions about some text and get calibrated probabilities back in about a second, from your own code on the same Flux key. For routing, triage and classification.
Give the Flux decision model some text and a few typed questions, and it answers each one with a probability instead of a paragraph. Which team should handle this message? Is it urgent? How severe is it? You get a number for every option, so your code can decide what to do and when to hand the case to a person.
It runs on the same Flux key and base URL (https://api.fluxrouter.ai/v1) as your chat requests, and it lands on the same bill. It is a paid ability, and it is called over the API only: there is no tool for it on the tools server.
Requests to the Flux decision model are processed by Cloudflare Workers AI, which acts as Flux's sub-processor and handles them under Cloudflare's own terms. Flux keeps no copy of your request or the answer; each call is billed from its input token count only.
What it does
Each call carries a state (the text, or a JSON object, the questions are about) and up to 64 questions. There are three kinds:
choice: pick one of your options. You get the chosen option and a probability for every option.score: place the text on a scale of your own levels. You get a score and a probability for every level.noul: a yes/no question. You get the probability that the answer is yes.
A call usually answers inside about a second, including when you ask many questions at once. You can also send images alongside the text, and the questions can refer to them.
Make a call
Send POST /v1/decide with model set to flux-decide. The model name is required; any other value is refused with 422.
curl https://api.fluxrouter.ai/v1/decide \
-H "Authorization: Bearer sk-YOUR-FLUX-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-decide",
"state": "Checkout returns a 500 error since this morning.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices and refunds",
"technical": "Errors, bugs and outages",
"sales": "Pricing and new plans"
}
},
"urgent": {
"type": "noul",
"instructions": "Is this urgent?"
}
}
}'
import requests
resp = requests.post(
"https://api.fluxrouter.ai/v1/decide",
headers={"Authorization": "Bearer sk-YOUR-FLUX-KEY"},
json={
"model": "flux-decide",
"state": "Checkout returns a 500 error since this morning.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices and refunds",
"technical": "Errors, bugs and outages",
"sales": "Pricing and new plans",
},
},
"urgent": {"type": "noul", "instructions": "Is this urgent?"},
},
},
)
resp.raise_for_status()
answers = resp.json()["answers"]
team = answers["team"]
# Threshold on the probability of the chosen option, not on "confidence".
if team["probabilities"][team["choice"]] >= 0.6:
print("route to", team["choice"])
else:
print("not sure: send to a person")
const resp = await fetch('https://api.fluxrouter.ai/v1/decide', {
method: 'POST',
headers: {
Authorization: 'Bearer sk-YOUR-FLUX-KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'flux-decide',
state: 'Checkout returns a 500 error since this morning.',
questions: {
team: {
type: 'choice',
instructions: 'Which team should handle this?',
criteria: {
billing: 'Payments, invoices and refunds',
technical: 'Errors, bugs and outages',
sales: 'Pricing and new plans',
},
},
urgent: { type: 'noul', instructions: 'Is this urgent?' },
},
}),
});
if (!resp.ok) throw new Error(await resp.text());
const { answers } = await resp.json();
const team = answers.team;
// Threshold on the probability of the chosen option, not on "confidence".
console.log(
team.probabilities[team.choice] >= 0.6 ? team.choice : 'not sure',
);
The answer for every question comes back under the id you gave it, with its probabilities. The full field list, the response, the limits and every error are in the decision mode reference.
Use the probability, not confidence
To decide whether to trust an answer, compare probabilities[choice] with your threshold (for a yes/no question, compare noul). Do not use confidence: it is not the probability of the chosen option. A threshold such as "act on it above 0.6, otherwise ask a person" is a sensible start; adjust it on your own examples.
When to use it
- Routing. Send a message, ticket or email to the right team, queue or agent.
- Triage. Flag what is urgent, and rate how severe it is.
- Classification. Label text from a fixed list of categories you define.
Because it returns a probability for every option, it suits decisions where you want to act automatically when it is sure, and escalate when it is not.
When not to use it
- Open-ended text. It does not write or explain. For that, use a chat model.
- "None of these" cases. Spotting that a message fits none of your options is a known weak spot. Always include an explicit
noneoption (for example"none": "Does not fit any of the other options") rather than relying on low probabilities across the board. - Long text. The state is limited to 2,048 tokens, and Flux refuses a longer state with
422 state_too_longinstead of answering from only its beginning. See the state limit.
Cost and privacy
- You pay per call, from the input token count alone, at the same price on every paid plan. The price is on the reference page.
- A call that fails is not billed.
- Flux does not keep your request or the answer.
- Free plans cannot use it: a call answers
403. Upgrade in Billing.
If something goes wrong
Every error, with its fix, is in the error reference.