Skip to content
DecisionNodeDecisionNdedocs
  • Guides
  • API reference
  • Examples
  • Playground

start here

  • QuickstartGet startedGet an API key, send one request with three questions, and branch your code on the typed answers. Plain HTTPS, nothing to install.
  • POST /v1/decideAPI referenceAnswer typed questions about a state, optional images and video frames. One request, one buffered JSON response, one answer per question.
  • QuestionsConceptsQuestions say what to decide. Each one has a type that fixes the shape of its answer: a choice from your options, a score on your scale, a…
  • ConfidenceConceptsProbabilities are calibrated per question type, so a threshold means what it says on the data we measure.
  • ImagesConceptsSend up to 16 images and text in the same request. The model reads printed and handwritten text, amounts, dates, objects and layout, and…
  • Batch jobsPatternsSend up to 10,000 requests in one file and collect the answers later, at a lower price than live calls.
  • Pricing and billingEvery workspace runs on a plan: Starter, Pro, Business or Dedicated.
↑↓ moveopen7 suggestions
Get API keyGet API key
DecisionNodeDecisionNde

Get started

  • Introduction
  • Quickstart
  • CLI
  • Playground
  • Console and keys
  • With coding agents
  • MCP server
  • Examples

Concepts

  • State
  • Questions
  • Choice
  • Score
  • Truth
  • Number
  • Points and boxes
  • Images
  • Video
  • Boosters
  • Collections
  • Confidence
  • Determinism
  • API keys

Knowledge

  • Overview
  • Documents
  • In a decision
  • Pricing and your data
  • When a rule does not appear

Models

  • DecisionNode
  • DecisionNode Flash
  • DecisionNode Edge
  • Limits
  • Versions
  • Dedicated capacity

Fine-tuning

  • Overview
  • Prepare your dataset
  • Upload and validation
  • Start a training run
  • Watch a run
  • The quality gate
  • Use your model
  • Limits and pricing

Patterns

  • Confidence-gated routing
  • Form router
  • Fan-out
  • Guardrails
  • Control loops
  • Batch jobs
  • Keys on devices
  • Bill your customers per device
  • Publishable keys

Integrations

  • Home Assistant
  • MQTT bridge
  • ROS 2

API reference

  • Overview
  • POST/v1/decide
  • POST/v1/systemone
  • GET/v1/models
  • POST/v1/uploads
  • /v1/keys
  • GET/v1/keys/{key_id}/usage
  • GET/v1/usage
  • POST/v1/credit
  • Errors
  • Safety check
  • Rate limits

Sessions API

  • Sessions overview
  • POSTOpen a session
  • WSStream frames
  • DELEnd a session

Collections API

  • Overview
  • POSTCreate a collection
  • GETList collections
  • GETRetrieve a collection
  • DELDelete a collection
  • POSTEnroll a face
  • GETList items
  • PATCHUpdate an item
  • DELDelete an item
  • POSTAdd a document
  • PUTReplace a document
  • GETRetrieve an item
  • GETList passages
  • DELDelete failed documents
  • POSTSearch a knowledge base

Batch API

  • The batch object
  • POSTCreate a batch
  • POSTAdd requests
  • POSTFinalize a batch
  • GETRetrieve a batch
  • GETGet batch results
  • POSTCancel a batch
  • GETList batches

Pricing and billing

  • Pricing and billing
  • Refer & earn

Policies

  • Responsible use
  • Data and privacy
  • Benchmarks
  • Pricing
  • Playground
Get API key
  • Guides
  • API reference
  • Examples
  • Playground

Get started

  • Introduction
  • Quickstart
  • CLI
  • Playground
  • Console and keys
  • With coding agents
  • MCP server
  • Examples

Concepts

  • State
  • Questions
  • Choice
  • Score
  • Truth
  • Number
  • Points and boxes
  • Images
  • Video
  • Boosters
  • Collections
  • Confidence
  • Determinism
  • API keys

Knowledge

  • Overview
  • Documents
  • In a decision
  • Pricing and your data
  • When a rule does not appear

Models

  • DecisionNode
  • DecisionNode Flash
  • DecisionNode Edge
  • Limits
  • Versions
  • Dedicated capacity

Fine-tuning

  • Overview
  • Prepare your dataset
  • Upload and validation
  • Start a training run
  • Watch a run
  • The quality gate
  • Use your model
  • Limits and pricing

Patterns

  • Confidence-gated routing
  • Form router
  • Fan-out
  • Guardrails
  • Control loops
  • Batch jobs
  • Keys on devices
  • Bill your customers per device
  • Publishable keys

Integrations

  • Home Assistant
  • MQTT bridge
  • ROS 2

API reference

  • Overview
  • POST/v1/decide
  • POST/v1/systemone
  • GET/v1/models
  • POST/v1/uploads
  • /v1/keys
  • GET/v1/keys/{key_id}/usage
  • GET/v1/usage
  • POST/v1/credit
  • Errors
  • Safety check
  • Rate limits

Sessions API

  • Sessions overview
  • POSTOpen a session
  • WSStream frames
  • DELEnd a session

Collections API

  • Overview
  • POSTCreate a collection
  • GETList collections
  • GETRetrieve a collection
  • DELDelete a collection
  • POSTEnroll a face
  • GETList items
  • PATCHUpdate an item
  • DELDelete an item
  • POSTAdd a document
  • PUTReplace a document
  • GETRetrieve an item
  • GETList passages
  • DELDelete failed documents
  • POSTSearch a knowledge base

Batch API

  • The batch object
  • POSTCreate a batch
  • POSTAdd requests
  • POSTFinalize a batch
  • GETRetrieve a batch
  • GETGet batch results
  • POSTCancel a batch
  • GETList batches

Pricing and billing

  • Pricing and billing
  • Refer & earn

Policies

  • Responsible use
  • Data and privacy
  1. docs
  2. /
  3. Sessions API

End a session

End a session before it expires. Its context is freed at once, an open socket closes with 1000, and nothing more is billed.

on this page6 sections
  1. Authentication
  2. Path parameters
  3. Request body
  4. Response
  5. Errors
  6. Notes
DELETEhttps://api.decisionnode.com/v1/sessions/{id}
curl -X DELETE \
  https://api.decisionnode.com/v1/sessions/ses_3f9a1c07b2e84d5f6a0c9e12 \
  -H "Authorization: Bearer $DECISIONNODE_API_KEY"

Ends the session, frees its context and closes its socket. Closing the socket yourself ends the session too, so a client that closes its socket need not call this.

Authentication#

Authorizationheaderrequired
Bearer dn_live_..., the same key as every call. A session belongs to the key that opened it: other keys, even in the same workspace, get 404 for it (close code 4404 on the stream).

Path parameters#

idstringrequired
The session_id that Open a session returned, for example ses_3f9a1c07b2e84d5f6a0c9e12.

Request body#

None.

Response#

200 OK with the session's final state. An open socket on the session closes with 1000.

200 OK
{
  "session_id": "ses_3f9a1c07b2e84d5f6a0c9e12",
  "model": "decisionnode-main-0.9.1-rc1",
  "status": "ended",
  "expires_at": "2026-10-06T09:35:00Z",
  "frames_answered": 412,
  "frames_dropped": 3,
  "frames_cut": 0,
  "last_seq": 415,
  "tokens_billed": 37656
}
session_idstring
The session that ended.
modelstring
The pinned version that answered its frames.
statusstring
"ended".
expires_atstring
When it would have expired.
frames_answeredinteger
Frames that got a reply.
frames_droppedinteger
Frames passed over because a newer one arrived (latest wins).
frames_cutinteger
Older frames that left the window early, so the recent frames fit window_tokens.
last_seqinteger or null
The seq of the last answered frame; null when no frame was answered.
tokens_billedinteger
Every input token the session billed: the fixed part and each billed frame.
  1. Authentication
  2. Path parameters
  3. Request body
  4. Response
  5. Errors
  6. Notes
request
curl -X DELETE \  https://api.decisionnode.com/v1/sessions/ses_3f9a1c07b2e84d5f6a0c9e12 \  -H "Authorization: Bearer $DECISIONNODE_API_KEY"

Errors#

  • 401

    Type
    authentication_error
    When
    The key is missing, unknown or revoked
    What to do
    Check the Authorization header
  • 403

    Type
    key_scope_denied
    When
    A Decisions-only key: "This key may only make decisions."
    What to do
    End it with the Full access key that opened it
  • 404

    Type
    not_found_error
    When
    No open session with this id belongs to your key
    What to do
    Nothing: it has already ended
  • 429

    Type
    rate_limit_error
    When
    Over your workspace's request rate, or your key's own lower limit
    What to do
    Wait Retry-After seconds, then retry
  • 500

    Type
    api_error
    When
    A fault on our side
    What to do
    Retry with backoff and jitter; it is always safe
  • 529

    Type
    overloaded_error
    When
    Our key store cannot answer right now
    What to do
    Wait Retry-After (1 to 2 s), then call again
Errors this endpoint returns
StatusTypeWhenWhat to do
401authentication_errorThe key is missing, unknown or revokedCheck the Authorization header
403key_scope_deniedA Decisions-only key: "This key may only make decisions."End it with the Full access key that opened it
404not_found_errorNo open session with this id belongs to your keyNothing: it has already ended
429rate_limit_errorOver your workspace's request rate, or your key's own lower limitWait Retry-After seconds, then retry
500api_errorA fault on our sideRetry with backoff and jitter; it is always safe
529overloaded_errorOur key store cannot answer right nowWait Retry-After (1 to 2 s), then call again

Every error body is {"detail": {"error_type": "...", "message": "..."}}, or a list of fields for a 422. Retry 408, 429, 529 and any 5xx, waiting at least what Retry-After says when it is set; fix the request for the other 4xx. All the bodies are on Errors.

Notes#

  • Safe to repeat: a second call gets 404, which means the session has ended. The samples treat it as success.
  • A workspace that is out of credit or suspended can still end its sessions; only the request rate applies.
  • Ending a session bills nothing. What it billed before (the fixed part and each answered frame) stays billed.
  • A session ends on its own at expires_at; call this to free your open-session slot sooner.
previousStream framesnextCollections API

DecisionNode is built and run by Bynn Intelligence, Inc.

  • Home
  • Playground
  • Examples
  • Console
  • Responsible use
  • Terms
  • Acceptable use
  • Privacy
  • Data processing
  • Defence addendum
  • Cookies
  • Affiliate program