Baneh Magic

Magical Musings on Mundane Matters

Decision API: Ship Code That Gets Answers Instead of Conversations

Decision API: Ship Code That Gets Answers Instead of Conversations

Most teams that try to put AI inside a production system start the same way: prompt a chat model, politely ask for JSON, then bolt on a parser, a validator, a retry loop, and a fallback path. It demos well. In production it becomes a latency tax, a cost sink, and a quiet source of mis-routed tickets and bad approvals. A decision API is the alternative: one endpoint that accepts your application state plus questions you define in code, and returns schema-valid, typed answers in a single pass. This piece covers what that contract actually looks like, why calibrated confidence and determinism change how you write code, and where decision endpoints quietly replace thousands of lines of hand-written rules.

What a Decision API Is — and Why JSON-Mode Chat Calls Keep Disappointing

A decision API is not a chat endpoint with a formatting flag. The difference is architectural. With a chat model, the model controls the shape of its response; you negotiate with prompt wording to keep it consistent, and you accept that “probably parseable” is a permanent tail risk. With a decision API, your code owns the schema and the model owns the judgment. You send state, you send questions, and the answers come back already typed.

In practice that contract looks like this: your service sends a POST /v1/decide request containing state — plain text, structured JSON, or up to 16 images or video frames — together with a question set defined in your codebase. The response is not prose. It is a set of answers of declared types: choice (one of your own labels), score (a level on an ordered scale), truth (a calibrated probability between 0.00 and 1.00), number (a value on a grid), and point or box (locations inside an image). Everything arrives in one pass, in one response, matching the schema you specified.

Compare that to the chat approach. A JSON-mode call typically costs you three or four network round trips once you add validation and retries, bills you for output tokens you never wanted, and fails in ways that are hard to test — a truncated brace, a hallucinated enum value, a stray “Sure, here’s the JSON.” Each failure needs defensive code, and each defensive branch is a place where a real request can end up mis-routed or silently dropped.

DecisionNode’s decision api is built around exactly this contract rather than retrofitted onto a chat interface. Two models cover the latency range: DecisionNode Flash runs in roughly 5 ms server-side and about 19 ms end to end at $0.035 per 1M input tokens, while DecisionNode MoE runs in about 9 ms at $0.042 per 1M input tokens. Output tokens are always free, batch discounts are available, and there is a free daily tier for evaluation. For a routing service handling thousands of requests per minute, that pricing model alone removes a whole class of budget anxiety.

Typed Outputs, Calibrated Confidence, and the Determinism Your Pipeline Needs

Calibrated confidence is the feature teams underestimate most. A truth answer of 0.82 is not decoration — it is a branch condition, and it means something specific: across many similar cases, roughly 82% of them were positive. That lets you write thresholds instead of guesswork. Auto-approve a refund above 0.95. Auto-reject below 0.15. Send the middle band to a human queue with the probability attached so the reviewer knows how much scrutiny to apply. Every answer carries its own confidence, so code can act instantly above a threshold and take a safe path below it without a second model call or a manual sanity check.

Determinism matters just as much for systems that ship on a schedule. A decision API that returns the same answer for the same request makes your test suite meaningful, your incident replays honest, and your CI pipeline stable. Sampling-based text generation gives you a different answer on Tuesday than it gave on Monday, which turns every regression into an investigation. Deterministic decisions let you pin a decision as a fixture, assert on it, and diff it when behavior changes.

Two operational details separate a demo from a deployment. First, throughput: for loops issuing more than about 10 decisions per second — drone navigation, robotics, simulators, continuous machine monitoring — sessions over WebSocket keep the connection warm and remove per-call handshake overhead. Second, integration surface: official SDKs for TypeScript, Python, Go, and Ruby, plus curl for everything else, MCP tools for agent builders, and webhooks for downstream automation. You should not have to write a bespoke client to make a decision.

Pre-processing is the other hidden cost of the chat approach. Detecting a face, extracting text from a document, estimating human age, flagging an AI-generated image, or computing depth and segmentation usually means chaining several models and stitching their outputs by hand. DecisionNode folds these in as boosters, so OCR, face detection and recognition, age estimation, AI-generated image detection, depth, and segmentation feed the same decision rather than spawning a parallel pipeline your team has to maintain.

Where Decision Endpoints Replace Hand-Written Rules: Triage, Fraud, QC, and Agents

Ticket routing is the classic first deployment. Support teams hand-write rules for months — keyword matches, sender domains, product names — until the rule set becomes an unmaintainable if-tree that nobody dares edit. A decision API collapses that into a question set: a choice over your queue labels, a score for priority, a truth value for whether escalation is warranted. Every answer comes back typed and confidence-scored, so high-confidence tickets route automatically while ambiguous ones surface for a human with the model’s reasoning signal attached.

Fraud and promo-abuse checks follow the same pattern with higher stakes. Instead of a binary rule, you get a calibrated probability that a signup, order, or coupon claim is abusive, and you choose where to place the cutoff based on your own tolerance for false positives. Order and shipping decisions — hold, split, expedite, flag for review — map cleanly onto choice and score outputs. Moderation, gating, and scoring workloads work the same way: your labels, your scale, your threshold, one call.

Visual decisions are where the typed outputs earn their keep outside text. Quality control on a production line can send frames from a camera and ask for a choice between pass, rework, and fail, accompanied by a box locating the defect. Warehouse and traffic monitoring can ask about congestion levels on a score scale while returning a point marking the vehicle or blocked aisle. Because images and video frames go in the same request as the questions, there is no separate vision model to deploy, version, and pay for independently.

AI agent builders have a slightly different use case: deciding before acting. Before an agent sends an email, issues a refund, or calls an external tool, it can post its current state and ask a focused question — is this action consistent with the user’s intent? Is this record complete? Should I proceed? A calibrated truth value plus a threshold gives the agent a hard gate, so it acts on clear cases and escalates the rest rather than improvising. That single pattern replaces a surprising amount of brittle prompt engineering, and it keeps the risky decisions inside code you can read, test, and version alongside the rest of your service.

Sophie Dupont

Website: https://banehmagic.com

Sophie explores the joys of food, travel, and sustainable living, sharing tips for a balanced lifestyle with her engaging writing.