Decisions API documentation

Decisions API documentation and integration guide

Learn the request shape, define typed questions, send application state, and use structured responses in your code.

landing.docs.overview.eyebrow

An API contract for application decisions

Send one state object and a map of typed questions to the System One endpoint. Decisions API returns one answer per question, with probabilities for the supported answer types, so your service can validate and handle the result.

landing.docs.overview.typed

landing.docs.overview.parallel

landing.docs.overview.confidence

Quickstart

Make a decision request end to end

The Playground is the fastest way to understand Decisions API’s inputs and outputs. Once the question is useful, create an API key and connect it to your product.

  1. 1

    landing.docs.quickstart.one.title

    Open the playground and load a support, operations, or policy scenario that resembles your application.

  2. 2

    landing.docs.quickstart.two.title

    Provide only the fields needed for the decision. Use text for a short message or JSON when account and policy context matter.

  3. 3

    landing.docs.quickstart.three.title

    Give each question an ID and choose Choice, Score, or Noul. Each question is evaluated against the same state.

  4. 4

    landing.docs.quickstart.four.title

    Create an API key and send the request from your server. Validate the response before using it to trigger an application action.

Input

Shape the state around the decision

A state is shared context for the questions in a request. Keep it relevant: include the event, records, and policy facts needed for the judgment, and omit unrelated personal or account data.

text

Natural language, a ticket, or a message

object

Structured records and nested fields

array

Context made of multiple text items

Current input boundary: Decisions API accepts text, JSON objects, and arrays of text. Image, audio, and video inputs are not supported yet.

Question types

Define outcomes your code can handle

Each question should represent one decision your application needs. Use Choice for a finite set of actions, Score for an ordered rubric, or Noul for a binary check; separate questions can share one state.

TypeUse it forReturns
Choice
Classify or route from optionschoice · probabilities · confidence
Score
Rate state on an ordered rubricscore · legend · probabilities · confidence
Noul
Judge whether a statement is truenoul (yes probability)

Shared fields and structure

A Question is one of three types. All types include type and instructions, then add criteria according to the type. Instructions can be a string, object, or array; when a question needs extra context, put the question and data in a structured object and refer to the data by field name.

type

Required: noul, choice, or score.

instructions

Required: a string, object, or array describing the decision.

criteria

Type-specific: optional object for Noul, required map for Choice, required array for Score.

{
  "type": "noul",
  "instructions": "Does this message convey urgency?",
  "criteria": {
    "true": "Explicitly needs immediate attention",
    "false": "No urgency expressed"
  }
}

Structured instructions are useful for longer questions or questions that reference extra data: put the question in one field, put context in the others, and refer to those fields by name.

"instructions": {
  "potential_duplicate": {
    "name": "John Smith",
    "location": "Oakland, California",
    "last_employer": "Google"
  },
  "question": "Is the resume for the same person as `potential_duplicate`?"
}

Choice

Use Choice to select one answer from predefined options. type must be choice, instructions describes the decision, and criteria must map options to descriptions; a Choice can have up to 255 options, with each description as a string, object, array, or null.

{
  "state": "A rollout of release 4.8.1 is producing elevated checkout errors in us-east-1. The error budget is nearly exhausted.",
  "model": "jev-latest",
  "questions": {
    "rollout_action": {
      "type": "choice",
      "instructions": "What should the on-call team do next?",
      "criteria": {
        "pause_rollout": "Stop additional traffic",
        "rollback": "Return to the previous version",
        "monitor": "Continue while watching metrics"
      }
    }
  }
}

Score

Use Score for descriptive levels on a spectrum, such as severity or satisfaction. type must be score, instructions describes what to rate, and criteria is an ordered low-to-high array whose items can be strings, objects, or arrays; it needs at least 2 and at most 10 levels. The returned score is probability-weighted and can fall between levels.

{
  "state": "A rollout of release 4.8.1 is producing elevated checkout errors in us-east-1. The error budget is nearly exhausted.",
  "model": "jev-latest",
  "questions": {
    "impact": {
      "type": "score",
      "instructions": "How severe is the customer impact?",
      "criteria": [
        "Limited",
        "Elevated",
        "Critical"
      ]
    }
  }
}

Noul

Use Noul for a yes / no judgment. type must be noul and instructions is the question to evaluate; criteria is optional and uses true and false to describe yes and no, with each value allowed to be a string, object, or array. Noul is the probability that the answer is yes, not a second confidence field.

{
  "state": "A rollout of release 4.8.1 is producing elevated checkout errors in us-east-1. The error budget is nearly exhausted.",
  "model": "jev-latest",
  "questions": {
    "pause_rollout": {
      "type": "noul",
      "instructions": "Should the rollout be paused and escalated for review?",
      "criteria": {
        "true": "The release is causing material customer impact and should stop",
        "false": "Evidence does not support stopping the rollout"
      }
    }
  }
}

Output

Validate the answer before acting

Match each response entry to its question ID and expected type. Probabilities and confidence help route uncertain cases, but they are not guarantees; use your own thresholds and review rules.

  • answers: Choice returns the selected choice, probabilities, and confidence; Score returns score, legend, per-level probabilities, and confidence; Noul returns noul.
  • usage: Includes input_tokens and output_tokens, and may include cost in USD.
  • elapsedMs: Time from sending the request to receiving the result, including validation—not pure model inference time.

Probability and confidence are signals for automation, not a guarantee of business accuracy. Use higher thresholds or human review for high-risk actions.

Response fields

modelThe model that performed the evaluation; this project returns answers and usage inside result.
answersOne Answer per question, keyed by the same question IDs from the request.
usageContains input_tokens and output_tokens.
elapsedAdditional request time returned by this project, in milliseconds.

Response example

{
  "model": "jev-1.13.0",
  "answers": {
    "pause_rollout": {
      "type": "noul",
      "noul": 0.91
    }
  },
  "usage": {
    "input_tokens": 183,
    "output_tokens": 24
  }
}

Answer types

Every answer carries a type matching its question. Choice and Score answers also carry confidence from 0 to 1, derived from the answer probability distribution.

Choice

Returns the highest-probability choice, probabilities for every option, and confidence derived from the probability distribution.

type

Required; value is choice.

choice

Required string; the highest-probability option.

probabilities

Required map<string, number>; probabilities for all options sum to 1.

confidence

Required number; certainty derived from the probability distribution.

{
  "model": "jev-1.13.0",
  "answers": {
    "rollout_action": {
      "type": "choice",
      "choice": "pause_rollout",
      "probabilities": {
        "pause_rollout": 0.91,
        "rollback": 0.07,
        "monitor": 0.02
      },
      "confidence": 0.84
    }
  },
  "usage": {
    "input_tokens": 221,
    "output_tokens": 31
  }
}

Score

Returns a probability-weighted score, a legend for each level, per-level probabilities, and confidence. The score can land between levels.

type

Required; value is score.

score

Required number; the probability-weighted score across levels.

legend

Required map<string, string>; maps each level number back to its description.

probabilities

Required map<string, number>; each level and its probability sum to 1.

confidence

Required number; certainty derived from the probability distribution.

{
  "model": "jev-1.13.0",
  "answers": {
    "impact": {
      "type": "score",
      "score": 1.16,
      "legend": {
        "0": "Limited",
        "1": "Elevated",
        "2": "Critical"
      },
      "probabilities": {
        "0": 0.02,
        "1": 0.8,
        "2": 0.18
      },
      "confidence": 0.79
    }
  },
  "usage": {
    "input_tokens": 214,
    "output_tokens": 28
  }
}

Noul

Returns noul on a 0 to 1 scale, representing the probability that the answer is yes.

type

Required; value is noul.

noul

Required number; 0 means no and 1 means yes.

{
  "model": "jev-1.13.0",
  "answers": {
    "pause_rollout": {
      "type": "noul",
      "noul": 0.91
    }
  },
  "usage": {
    "input_tokens": 183,
    "output_tokens": 24
  }
}

Usage fields

input_tokens

integer · Number of input tokens used by the request.

output_tokens

integer · Number of output tokens generated by the request.

API reference

Send a server-side request

Call the Decisions API System One endpoint from your backend with a bearer API key. Keep credentials out of browser code, validate inputs, and handle non-success HTTP responses before connecting results to production actions.

Evaluation endpoint

POST https://decisions-api.pro/v1/systemone

Send an Authorization Bearer API key and an application/json content type with every request.

Authorization: Bearer <API_KEY>
Content-Type: application/json

Request body

Every request needs the following three top-level fields. Questions is a map whose keys you choose; those keys are reused in the response.

statestring | object | array · required: the text or structured data to evaluate.
modelstring · required: the model that handles the request. Use the configured model alias, jev-latest.
questionsmap<string, Question> · required: the questions to evaluate in parallel.

You choose each key in questions; the matching Answer is returned under the same ID. The key is not sent to the underlying model and is not used in inference.

Request example

curl -X POST https://decisions-api.pro/v1/systemone \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "state": "A rollout of release 4.8.1 is producing elevated checkout errors in us-east-1. The error budget is nearly exhausted.",
  "model": "jev-latest",
  "questions": {
    "pause_rollout": {
      "type": "noul",
      "instructions": "Should the rollout be paused and escalated for review?",
      "criteria": {
        "true": "The release is causing material customer impact and should stop",
        "false": "Evidence does not support stopping the rollout"
      }
    }
  }
}'

Request body example

{
  "state": "A rollout of release 4.8.1 is producing elevated checkout errors in us-east-1. The error budget is nearly exhausted.",
  "model": "jev-latest",
  "questions": {
    "pause_rollout": {
      "type": "noul",
      "instructions": "Should the rollout be paused and escalated for review?",
      "criteria": {
        "true": "The release is causing material customer impact and should stop",
        "false": "Evidence does not support stopping the rollout"
      }
    }
  }
}

Keep your API key in a server-side environment variable. Never put it in browser code or commit it to your repository. This page includes the request fields, question types, response shape, error codes, and retry behavior.

Agent usage

Use Decisions API inside a coding agent

Use the Decisions API endpoint from compatible coding agents for bounded decisions while keeping execution and permissions in your application.

Configure the API

Create an API key and configure the Decisions API endpoint in your server-side environment.

Configure once

Store the key in a server-side environment variable and inject it only into the service that makes the request.

Ask a bounded question

Tell the Agent what decision is needed; it should choose Choice, Score, or Noul and send the smallest useful state.

Configure the API

export DECISIONS_API_KEY="sk_your_key_here"
export DECISIONS_API_BASE_URL="https://decisions-api.pro"

Keep the key server-side. Do not place it in browser code, source control, or public agent prompts.

Five useful starting points

Use these prompts with your own API integration. They keep the decision bounded and leave execution authority in your application.

1

Route a support ticket

Use Choice to select one approved team, then let application code route the ticket and send uncertain cases to review.

Classify this support ticket into exactly one team: billing, technical, account, or sales. Return the selected team, probabilities, and confidence. Do not contact the customer or modify any ticket yet.

Ticket: I was charged twice for my annual plan and need a refund.
2

Guard a tool call

Use Noul to judge whether a proposed action needs approval, while deterministic permissions and policy remain authoritative.

Before running this proposed tool call, call your Decisions API integration to assess the decision. Judge whether it is safe without human approval. Consider side effects, reversibility, scope, and policy. If risky or uncertain, do not execute it.

Tool: delete_customer_records
Arguments: {where: last_login < 2023-01-01}
Policy: destructive database operations require a backup and human approval.
3

Route to an approved model

Use Choice for the allowlisted candidates and a separate Noul question when no candidate is suitable.

Use Decisions API to choose one approved model for this task. Optimize for quality first, then context capacity and cost. Return the selected model, probabilities, and whether to escalate. Do not call any model yet.

Task: review a 100k-token customer dispute.
Candidates: fast-model (32k, low cost), reasoning-model (200k, high cost), fallback-model (128k, medium cost).
4

Verify research evidence

Use Noul to assess whether evidence is sufficient before an Agent publishes or cites a claim.

Use Decisions API to check whether the evidence is sufficient to publish this claim. Consider source quality, freshness, direct support, and contradictions. Return a yes probability and the missing verification work. Do not publish yet.

Claim: Our API reduced median processing time by 40%.
Evidence: an internal benchmark from last month with 120 cases; no production traffic data; an older report showing a 12% improvement.
5

Review task completion

Use Choice or Score to decide whether the work is complete, needs verification, or is incomplete before reporting success.

Use Decisions API to review whether this task is complete. Return one of complete, verify_more, or incomplete. Consider the objective, files changed, tests run, known gaps, and target-environment verification.

Objective: add API-key authentication to the production endpoint.
Completed: added the Authorization check and API-key lookup.
Verification: unit tests pass; production request and rate-limit behavior were not tested.
An Agent can call Decisions API when it needs a structured judgment. The API does not create tools, grant authority, intercept shell calls, or replace your permissions, deterministic rules, or human approval boundaries.

Error handling

Errors and retries

Handle invalid requests as client errors, missing or invalid credentials as authorization failures, and rate limits or temporary overload with bounded exponential backoff.

StatusMeaning
401Unauthorized: the API key is missing or invalid. Check the Authorization header.
422Unprocessable Entity: the request body failed validation, such as a missing field or malformed question; the response identifies the offending field.
429Too Many Requests: you exceeded the rate limit. Wait and retry.
529Overloaded: the service is temporarily overloaded. Wait and retry.

When you receive a 429 or 529, retry with exponential backoff instead of sending the same request immediately. SDKs with their default retry policy can handle these retries automatically.

What to do next

Start with one low-risk, well-scoped decision. Then connect it to routing, queues, guardrails, or an agent workflow as you learn where the signal is useful.