Quickstart

Sign up, create a decision from a template, test it in the Playground, deploy it and call it with cURL, JavaScript or Python — in about five minutes.

This walkthrough follows the checklist on your Dashboard: create a decision, test it, deploy it, create an API key and make your first API call.

Create your account

Open app.dcision.io and choose Continue with Google or enter your work e-mail to receive a 6-digit code (valid for 10 minutes).

The first sign-in creates your account and a workspace on the free Genesis plan (1M decisions per month, 2 decisions, 7-day logs — see Plans).

Create a decision from a template

Go to Templates and pick Lead Qualification under All templates (or Decisions → New decision and select the template), then click Create decision.

You land in the editor with an editable draft that contains:

PartContent
Statemessage (string, required), company_size (number), source (string)
Questionspurchase_intent (probability), priority (score: low → critical), route (choice: sales, sdr, nurture, spam + the reserved other)
Compositelead_score — a 0–1 ranking from intent (weight 2), priority (1) and the probability of sales (1)
Policiesroute = spam → block; purchase_intent confidence below 0.6 → escalate

The Patterns panel next to the schema shows that this decision already combines three of TypeSafe's patterns: intent routing, confidence-gated routing and composite scoring.

The slug — your endpoint — is generated from the name: lead-qualification (or lead-qualification-2 if the workspace already uses it). You can change it until the first deploy.

Test it in the Playground

Open the Playground tab, replace the state with the JSON below and click Run decision (or press ⌘/Ctrl + Enter):

{
  "message": "We need pricing for 500 users and want to start next month.",
  "company_size": 500,
  "source": "website"
}

You get the typed result, the action and why it was chosen, a confidence bar per question, the full probability distribution of every option and the value of lead_score. Playground runs are not billed and appear in Executions. Edits to the draft are picked up even before they are saved.

Deploy it

Open the Deploy tab and click Deploy v1. Dcision snapshots the draft as immutable version 1 and makes it live:

POST https://api.dcision.io/v1/decisions/lead-qualification

From now on the slug is locked. Later edits stay in the draft until you deploy v2 — production never changes by accident. See Versions and deploy.

Create an API key

Go to API Keys → New key, keep the name Production and the Live environment, and click Create key. Copy the key — it starts with dcs_live_ and is shown only once — and store it as an environment variable on your server:

export DCISION_API_KEY="dcs_live_…"

Never ship the key to a browser or a mobile app. See Authentication.

Call the API

curl -X POST https://api.dcision.io/v1/decisions/lead-qualification \
  -H "Authorization: Bearer $DCISION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "state": {
      "message": "We need pricing for 500 users and want to start next month.",
      "company_size": 500,
      "source": "website"
    }
  }'

The official SDKs for TypeScript and Python wrap this call with safe retries — await dcision.decide("lead-qualification", state). To call it from a tool that can't hold an API key — a form, a CRM, Zapier, n8n or Make — turn on the decision's webhook URL in its Advanced tab. To let an AI agent call it, connect the MCP server — see Use Dcision in Claude Code.

The response (values vary from run to run; the shape is exact):

200 OK
{
  "decision_id": "dec_3fKq9ZtW1mXcV7bN2pLa",
  "execution_id": "exec_8HsT2kQw9ZyR4vMn1cXe",
  "schema": "lead-qualification",
  "version": 1,
  "result": {
    "purchase_intent": 0.9412,
    "priority": "high",
    "route": "sales"
  },
  "confidence": {
    "purchase_intent": 0.8824,
    "priority": 0.69,
    "route": 0.85
  },
  "scores": { "priority": 2.81 },
  "composites": { "lead_score": 0.8414 },
  "action": "continue",
  "action_reason": { "type": "default" },
  "metrics": {
    "latency_ms": 412,
    "engine": "jev",
    "model": "jev-1.13.0",
    "estimated_cost_usd": 0.00001575,
    "input_tokens": 375,
    "output_tokens": 36
  }
}

Read the response

  • result holds one answer per question, keyed by the question key: a number in [0, 1] for probability questions, a scale label for score questions and an option for choice questions.
  • confidence holds how sure the engine is about each answer, from 0 to 1 — see Confidence and probabilities.
  • scores holds the weighted level of each score question, counted from 1: priority at 2.81 sits between medium (2) and high (3), closer to high.
  • composites holds the decision's weighted combinations — here lead_score. See Composites.
  • action is what your code should do: continue, block, escalate or fallback. action_reason says why — here no policy matched, so the default continue applies. See Policies and actions.
  • version is the deployed version that answered and execution_id finds the run in Executions.
  • metrics reports the latency, the exact model that answered, the input and output tokens and the estimated engine cost — Jev bills input tokens only.

Add ?include=probabilities to also receive the full distribution of every question — see Confidence and probabilities.

Next steps

On this page