Skip to content

Decision APIs: When Your Code Needs an Answer, Not a Paragraph

Most teams that need a model to make a call inside software start the same way: they wire up a chat model, write a prompt that ends with “reply in JSON,” and ship it. It survives the demo and then fails quietly in production — a stray markdown fence breaks the parser, a field goes missing, a label comes back that was never in the schema, and the retry logic turns a 40 ms call into a four-second one. A decision API exists to remove that entire class of failure. Instead of generating prose that happens to resemble data, it accepts a structured state plus a set of questions defined in code, and returns typed, schema-valid answers in a single pass. DecisionNode is built around exactly this contract: one HTTPS endpoint, a fixed answer vocabulary, and a calibrated confidence attached to every result so calling code can act immediately above a threshold and take a safe path below it.

What a Decision API Is — and Why Typed Decisions Beat Generated Text

The core distinction is between a model that describes and a model that decides. A generative endpoint returns text, and any structure in that text is a convention you enforce with prompts, parsers, and validation layers you now own forever. A decision endpoint returns values that already fit a schema: a choice that must be one of the labels you supplied, a score placed on an ordered scale, a truth expressed as a calibrated probability from 0.00 to 1.00, a number on a defined grid, and a point or box locating something inside an image. Nothing downstream needs to guess what the model meant, because the possible answers were constrained before the request was ever sent.

That constraint matters most in control flow. Software does not branch on paragraphs; it branches on booleans, enums, and thresholds. When a response carries a calibrated confidence alongside the answer, you can express intent directly in code: act automatically at 0.92, route to a human review queue at 0.61, and fall back to a deterministic rule under 0.40. That is a fundamentally different architecture from parsing a model’s opinion out of its prose and patching it into an if-statement. It also makes the decision auditable — every call has an answer, a confidence, and an input you can replay.

Replayability is a genuine operational requirement, not a nice-to-have. The engine behind decisionnode.com is deterministic: the same request returns the same answer, which means you can reproduce an incident, cache aggressively, and write regression tests against recorded states rather than vibes. Latency and cost follow the same logic. DecisionNode Flash runs at roughly 5 ms server-side and 19 ms end-to-end at $0.035 per 1M input tokens, while DecisionNode MoE lands around 9 ms at $0.042 per 1M input tokens, with output tokens always free and batch discounts available. Those numbers are small enough that decision calls can sit inside a request handler or a checkout flow instead of behind an async job queue.

Designing Decision Contracts: State In, Questions Out

A decision API call has two halves. The state is everything the model is allowed to consider: a block of text, a JSON object, or up to 16 images or video frames. The questions are declarations made in code — not prose instructions, but typed slots to fill. Each question names its answer type and its allowed values. If you ask which queue a ticket belongs to, you supply the queue labels; the model returns one of them. If you ask how severe an incident is, you supply the ordered scale; the model returns a level on it. If you ask whether an order looks fraudulent, you get a calibrated probability you can threshold against your own risk appetite.

This contract style changes how teams think about prompting. Labels need to be mutually exclusive and collectively exhaustive, because an ambiguous label set produces confident nonsense. Scales need to be genuinely ordered, not a list of categories wearing numeric clothing. The number grid should match the precision you can actually act on — asking for a value to three decimal places when your system only responds to whole units just invites false confidence. Getting these definitions right is where most of the engineering effort belongs, and it is ordinary engineering work: version the question set, review it in a pull request, and treat changes to labels as breaking changes for downstream consumers.

Modality coverage is what makes the model useful beyond text. Because state can include frames, visual questions become first-class: point and box answers let you ask where a defect sits on a part, where a pallet is in a truck bay, or where a face appears in a frame. Boosters extend this without extra plumbing — human age estimation, AI-generated image detection, face detection and recognition, OCR, depth, and segmentation. A quality-control pipeline can therefore send a camera frame, receive a box and a defect-class choice, and write the result straight into a manufacturing system with no bespoke vision model to train, host, or retrain.

Running Decision APIs in Production: Latency, Sessions, and Ops Patterns

The default integration is a single synchronous call to a decision endpoint, and for most product workloads that is all you need. The pattern is familiar: build the state object, declare the questions once at startup, post the request, validate the typed response against the schema, branch on the answer and confidence. SDKs for TypeScript, Python, Go, Ruby, and plain curl cover the common stacks, and MCP tools and webhooks make it straightforward to expose decisions to agents and downstream systems without writing a bespoke bridge. A free daily tier covers evaluation, and batch discounts apply when decisions can be deferred.

Some workloads cannot be deferred and cannot tolerate request-per-decision overhead. Loops that exceed roughly 10 decisions per second — drones, robots, simulators, machine monitoring — are better served by a persistent session over WebSocket, where state and answers stream in both directions and per-call setup disappears. Warehouse and traffic monitoring sit in this category: a camera stream, a continuous question about whether a zone is clear, and an answer that must arrive before the next frame is worth processing.

The operational patterns worth designing for early are the boring ones. Decide what happens when a confidence lands in the grey zone between your two thresholds — usually a human queue or a conservative default, rarely a silent guess. Keep a sampled log of state and answers so you can measure whether confidence still tracks reality as inputs drift; calibration is a property to monitor, not a fact to assume. Separate your decision layer from your rules layer deliberately: teams typically start by replacing brittle hand-written rule trees for ticket routing and triage, fraud and promo-abuse checks, order and shipping decisions, moderation, scoring, and gating, and keep hard policy constraints in code where they belong. For AI agent builders, the same contract becomes a guardrail — decide before acting, and let the confidence decide whether the action proceeds, escalates, or stops.