Skip to content

The Decision API: Turning Ambiguous State Into Typed Answers Your Code Can Trust

Every production system eventually reaches the same fork in the road: something ambiguous arrives — a support ticket, a frame from a warehouse camera, an order with a suspicious promo code — and the code has to pick a path. Hand-written rules get the job done until they don’t. A few hundred conditionals become a few thousand, and nobody can explain why a specific ticket went to tier-two support last Tuesday. The obvious next move is to ask a chat model to “reply in JSON.” That works in a demo, then quietly starts returning prose, invented labels, and fields that drift between identical calls.

A decision API takes a different approach. Instead of generating text your code has to interpret, it accepts state — plain text, structured JSON, or up to 16 images and video frames — along with questions you define in code, and returns schema-valid answers in a single pass. No chain of follow-up prompts, no regex over model output, no guessing what “probably yes” means at 3 a.m. during an incident. What follows is a look at the contract itself, where the latency and cost numbers actually land, and which production patterns benefit most.

Typed Answers Change What You Can Build

The core difference between a decision API and an LLM call is the shape of the response. On endpoints such as decision api from DecisionNode, every response is one of six explicit types. A choice is exactly one label from a set you supplied in code — billing, shipping, abuse — never a synonym for one of them. A score places the input at a level on an ordered scale, which is what severity and risk tiers actually need. A truth returns a calibrated probability between 0.00 and 1.00, so downstream code can threshold it instead of arguing about adjectives. A number lands on a value from a grid. Point and box return locations inside an image, which makes visual questions answerable without building a separate computer-vision pipeline.

Schema validity sounds like a minor convenience until you’ve shipped the alternative. With a chat model, output is a string you hope conforms. Over a few thousand calls, conformity becomes a distribution: occasional markdown fences, occasional “N/A” where you expected a float, occasional confidence theater where the model writes “high confidence” for something it clearly guessed. Each of those is an exception handler, a retry, and a pager alert waiting to happen. A typed contract moves that failure mode out of the parser and into a number you can branch on.

Which brings up the part teams underestimate: calibrated confidence on every answer. Confidence turns a binary decision into a policy. Above a high threshold, act immediately. Between thresholds, take the safe path — route to a human queue, apply the conservative default, request a better photo. Below a low threshold, escalate or re-check with more context. That three-lane structure is where most of the operational value lives, because it lets you automate the easy majority without pretending the hard minority doesn’t exist.

Determinism is the other half of the contract. Same request, same answer means you can replay a recorded incident in CI, pin behavior with regression tests, and explain to an auditor why a case was routed where it was. Chat models drift across versions and even across identical prompts; a decision model that returns identical output for identical input turns model behavior into something you can version, diff, and review like any other dependency in your stack.

Latency Budgets and Cost Math: Fitting Decisions Into Hot Paths

Decisions in a hot path have a harder job than decisions in a queue. If a routing choice happens after a webhook fires and no one is waiting, 300ms is invisible. If it happens inside a checkout flow, an on-call paging loop, or a robotic arm’s control loop, you’re budgeting milliseconds. DecisionNode publishes numbers that make this concrete: DecisionNode Flash runs roughly 5ms server-side and about 19ms end to end, priced at $0.035 per 1M input tokens. DecisionNode MoE runs around 9ms at $0.042 per 1M input tokens. Output tokens are free on both models, which changes the economics of questions whose answers are short but whose input state — screenshots, log bundles, transcripts, video frames — is large.

Compare that against the usual pattern. Serialize state into a prompt, wait for a chat model to reason out loud, parse the reply, retry when parsing fails, retry again when the model returns a label that isn’t in your enum. Each retry doubles tail latency and cost, and none of it shows up in the happy-path benchmark you ran before launch. One pass with a typed answer collapses the whole sequence into a single HTTPS request whose failure mode is a low confidence score rather than a malformed string. Fewer round trips is a reliability property, not just a performance one.

Throughput above roughly 10 decisions per second changes the transport rather than the model. Sessions over WebSocket keep a connection warm for drones, robots, simulators, and machine monitoring, where decisions arrive as a continuous stream instead of as user-triggered events. Below that line, SDKs for TypeScript, Python, Go, Ruby, and curl cover the usual stacks, with MCP tools and webhooks for agent and automation workflows, and batch discounts for offline scoring jobs that don’t care about latency at all. A free daily tier is enough to benchmark a realistic workload — real images, real ticket text — before committing to anything.

Operationally, treat the threshold as configuration, not as a model setting. Log the confidence alongside every decision so you can measure how often each lane fires and tune cutoffs against observed outcomes rather than intuition. When a lane misbehaves, you want to change a value in a config store, not redeploy a service.

Where Decisions Belong: Patterns Across Product and Ops

The workloads where a decision API pays for itself share a shape: high volume, clear labels, and a real cost attached to being slow or inconsistent. Support ticket routing and triage is the canonical case — classify intent, priority, and owning team from the ticket body plus account context, then route in one call. Fraud and promo-abuse checks benefit from the probability output directly: a truth answer near 0.92 is a block, 0.55 is a step-up verification, 0.12 is a pass, and each threshold is a business decision you can revisit quarterly. Order and shipping decisions — split shipments, carrier selection, address exceptions — map cleanly onto choice and score. Moderation combines text with image frames, and borderline content is exactly where a calibrated confidence beats a binary classifier’s coin flip.

Visual answer types open a second family of use cases. Quality control on a production line can ask whether a component is present and where it sits, returning a box rather than a caption nobody can act on. Warehouse and traffic monitoring can count and locate objects across frames. Boosters cover the sub-tasks that usually force a second vendor into the architecture: human age estimation, AI-generated image detection, face detection and recognition, OCR, depth, and segmentation. Running those inside the same request avoids stitching together three services and reconciling outputs that disagree with each other.

For AI agents, the more interesting shift is architectural. Most agent frameworks use a chat model to both decide and act, which means the decision is buried in generated prose and only recoverable by parsing. Giving the agent a decision endpoint — through MCP tools or a direct SDK call — separates the two responsibilities. The model proposes; the decision API resolves the proposal into a typed action with a confidence; the runtime executes only what clears the threshold. Decide before acting is a far cheaper guardrail than undoing an action that shouldn’t have happened, and it gives you an auditable record of why the agent moved.

A familiar migration looks like this: a fulfillment team has 400 lines of conditionals governing address exceptions plus a weekly change-request queue to modify them. They move the logic to a decision endpoint, defining a small set of questions in code — is this address deliverable as written, which exception class applies, how confident is that — and hand threshold tuning to ops. The determinism guarantee keeps their existing regression suite meaningful, and the confidence score supplies the number the rules engine never had: how often the system was quietly guessing.