Categories Technology

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

Most teams that put a language model into a production path begin with the same pattern: write a prompt, ask politely for JSON, parse the response, and wrap the whole thing in a try/catch. It demos beautifully. Then it hits real traffic and starts returning markdown fences, invented enum values, truncated objects, and confidence numbers that are pure vibes. The failure isn’t the model’s intelligence — it’s the contract. Text in, text out is a conversational contract. Your order pipeline, fraud gate, or production-line controller needs a typed contract.

That’s the gap a decision API is designed to close. Instead of generating prose that your service then has to interpret, a decision endpoint accepts structured state, evaluates questions you defined in code, and returns schema-valid answers with calibrated confidence attached — in a single pass, with no parsing layer in between.

DecisionNode is built around exactly this model. It calls itself a “System One” decision AI: fast, deterministic pattern recognition rather than multi-step reasoning, exposed as one HTTPS endpoint. The interesting engineering questions aren’t “how smart is it” but “what does it return, how fast, how repeatable, and how do I act on it.” Those are the questions worth answering before you wire anything into a hot path.

What a Decision API Returns: Typed Answers Instead of Generated Text

The core difference is where the question lives. In a chat-LLM integration, the question lives in the prompt — a natural-language blob that drifts every time someone edits it. In a decision API, the question lives in your codebase as part of the request payload. You send state (plain text, JSON, or up to 16 images or video frames) alongside a set of questions you’ve defined, and the response comes back already shaped like the data types your application uses.

DecisionNode’s decision api exposes five answer primitives, and each maps cleanly onto something a developer already has:

Choice returns one of your labels — an enum you supplied, not a free-text guess. Score returns a level on an ordered scale, useful for severity, priority, or quality tiers. Truth returns a calibrated probability between 0.00 and 1.00, which is the primitive you want for binary gates like “is this promo abuse.” Number returns a value on a grid, and point and box return locations inside an image for spatial questions.

That last pair is where typed decisions stop being a convenience and start being an architecture choice. A moderation or quality-control flow doesn’t want a paragraph describing where a defect might be; it wants coordinates it can crop, annotate, or escalate with zero interpretation.

Calibration is the other half of the contract, and it’s easy to undersell. Every answer carries a calibrated confidence, meaning a 0.90 should be right roughly nine times in ten across the population of similar requests. That property is what makes thresholds meaningful. Code can act instantly above a threshold, and below it re-check, request more evidence, or route to a safe path. Without calibration, a confidence score is decorative; with it, it’s a control signal.

Compared to hand-written rules, the trade is similar but the maintenance curve is different. Business rules codify what someone thought of; a decision model generalizes across messy inputs like OCR’d text, blurry photos, and half-populated JSON. Compared to “reply in JSON” prompting, the win is structural: no fences to strip, no invented labels, no retry loop burning latency at the worst moment.

Latency, Determinism, and Unit Economics: The Constraints That Shape Architecture

Three properties decide whether a decision service can sit inline with a user request or has to be pushed to a background queue: how fast it answers, whether the same input produces the same output, and what a million decisions cost.

DecisionNode ships two models with different trade-offs. DecisionNode Flash runs around 5 ms server-side and roughly 19 ms end to end at $0.035 per 1M input tokens. DecisionNode MoE runs around 9 ms at $0.042 per 1M input tokens, trading a little latency for more capacity on harder inputs. Output tokens are always free — a natural consequence of the typed contract, since the “output” is a small structured payload rather than generated text that scales with verbosity. There’s a free daily tier for development, and batch discounts for offline scoring work.

Determinism is the property most teams underestimate until they need it. Same request, same answer — every time. No temperature, no sampling variance. That single guarantee unlocks a stack of production practices that become nearly impossible with generative calls: fixture-based regression tests for every decision point, replaying production traffic against a new question schema before rollout, stable caching, and audit logs where the recorded decision matches what an investigator would get if they re-ran the request months later.

For high-frequency loops, connection overhead becomes the bottleneck before model latency does. DecisionNode offers sessions over WebSocket for loops above roughly 10 decisions per second — the regime where drones, robots, simulators, and machine monitoring live. A persistent session amortizes connection setup and keeps loop state alive instead of rebuilding it per request.

Integration surface matters too, because the fastest way to lose a latency advantage is to fight your own plumbing. Official SDKs cover TypeScript, Python, Go, and Ruby, with plain curl for everything else, plus MCP tools and webhooks. The MCP and agent angle is worth calling out for teams building tool-using systems: an agent that calls a decision endpoint gets back a typed answer plus confidence, so it can branch on structured data instead of parsing prose it generated about its own intent. Deciding before acting, rather than narrating before acting, removes an entire class of failure.

Where Decision APIs Pay Off: Routing, Risk, and Physical Operations

The use cases cluster into three families, and it’s worth recognizing which one you’re in because it changes how you set thresholds.

Routing and triage. Support tickets, inbound leads, and internal requests all need the same thing: a choice over queue labels and a score over priority. The confidence value does real work here — above 0.90, auto-assign and skip the human; in the middle band, assign but flag for review; below, hand to a person with the raw state attached. The decision is cheap enough to run on every ticket rather than a sampled subset.

Risk and gating. Fraud checks, promo-abuse detection, moderation verdicts, scoring, and access gating are all truth questions with asymmetric costs. You don’t want a single fuzzy score; you want a calibrated probability you can compare against a cost-weighted cutoff, with a second, stricter cutoff that triggers a re-check or a safe path. Order and shipping decisions combine this with choice and number primitives — pick a fulfillment path, place an ETA on a grid.

Physical and visual operations. Quality control on production lines, warehouse monitoring, and traffic monitoring all depend on spatial answers, which is where point and box primitives and the booster lineup matter. DecisionNode’s boosters handle human age estimation, AI-generated image detection, face detection and recognition, OCR, depth, and segmentation — composable preprocessing that makes a downstream decision reliable when the raw input is a scanned document, a crowded frame, or an image you suspect was synthesized.

A concrete pattern: a returns flow receives three photos of an item plus the order JSON. In one call it asks a box question for the damaged region, a truth question for whether the item matches what shipped, and a choice question for disposition. If the match probability clears 0.92, the return auto-approves. Between 0.70 and 0.92, it routes to an agent with the cropped region attached. Below 0.70, it requests more photos. One round trip, tens of milliseconds, no parsing, and every branch is a threshold in version control rather than a rule someone will forget to update.