API reference
StatusUpdated
Send a model, state and named questions to the decide endpoint to receive structured answers.
Request fields
POST https:// accepts a JSON body with a RightNow decision model API key in the Authorization: Bearer header.
modelrightnow-decisionfollows the alias. Use an attested pinned version to select a model (Models).state- The text, JSON object or JSON array to evaluate.
questions- Named boolean, choice or score questions, each with its own instructions (Decisions).
session_id- Optional routing affinity hint. It does not create a persistent session.
prompt_cache_key- Optional routing hint used when
session_idis absent. attachments- Optional inline files in the formats listed in Inputs. The complete JSON request, including state, questions and base64 data, must fit the published caller body limit.
policy- Optional confidence threshold and cost cap for this request (Request policy).
Send Content-Type: application/json. Add an Idempotency-Key when you need replay protection (Idempotency).
Before the decision
RightNow checks your key, the body and your limits before any work starts.
Key missing or unknown:
401 invalid_api_key.Body over 3,665,920 bytes:
413 payload_too_large.Over 600 requests a minute, by default:
429 rate_limit_exceeded.Over 16 calls in flight, by default:
429 concurrency_limit_exceeded.Same key and body as a stored answer: that answer can return with
X-.RightNow- Idempotent- Replay: true The decision
RightNow answers each question you named.
Unavailable or starting:
503 system_zero_unavailablewithRetry-After. Wait, then send the same request.No answer in time:
504 system_zero_timeout. Do not resend it unchanged.After the decision
HTTP 200 returns
answersunder your question names, andusage.A question can be refused inside a 200. Read every entry.
See Pricing for what an answered call costs.
Read the response
A successful request returns HTTP 200. Read each named entry in answers; it can hold an answer or a question refusal.
Read answers.damaged in your response. probability is the likelihood of true; decision is the selected boolean; confidence is its probability.
id- Identifies the decision.
model- The answering model version.
served_by- The answering version, matching
model. created- When the decision was made, in Unix seconds.
contextroute, the context route, andtokens, the context's size in tokens.answers- Results grouped under the question names from the request.
usage- Token counts (
input_tokens,cached_input_tokens,media_tokens,long_input_tokensandthought_tokens) andmedia_items, the number of media items. policy- The request policy you sent, echoed as sent. Absent when you sent none.
Fresh answers include decision, confidence, alternatives, calibrated and calibration_version. confidence is the probability of the selected decision. Legacy idempotent replays retain their stored answer shape. See Decisions for the field rules and question refusals.
With a request policy, an answer below min_confidence has abstained: true and no decision. Never act on its other fields.
A successful reply can also include provenance, metadata about the execution that produced it. Read Provenance for its fields.
Event stream reply
POST /v1/system-zero/decide can return the complete decision over Server-Sent Events. Send Accept: text/event-stream with exactly one media range. The match ignores case and allows parameters such as charset=utf-8. A list, */* or any q parameter keeps the JSON reply. A stream member in the body returns HTTP 400 invalid_request.
This is the same answer at the same time and price as JSON. There are no partial answers. The model returns decisions with confidences, not generated text. Prices, receipts, request limits, rate limits and concurrency limits are unchanged. One stream counts as one request. There is no streaming or per-event fee.
| Event | Carries |
|---|---|
decision | The complete JSON reply, byte for byte, on one data: line. |
done | HTTP status, request id, replay flag, latency, server timing and rate limit. Always last. |
Only a completed HTTP 200 reply becomes an event stream. Every refusal keeps its HTTP status, JSON error envelope and headers. The WebSocket stream is separate and unchanged. Read Streaming.
The reply has Content-Type: text/event-stream; charset=utf-8 and Cache-Control: no-store. Accept a data line of up to 4,000,000 bytes. Ignore unknown event names and comment lines. There are exactly two events, with no progress events or keepalive comments.
Use fetch or another HTTP client that supports POST with a body and an Authorization header. Browser EventSource cannot send this request. There is no event id, retry field or resume. If the connection breaks, resend the same body with the same Idempotency-Key within 24 hours. A saved answer returns the same decision at no cost, with replayed: true in done.
Values are illustrative, not measured. Reply fields are shortened for display.
Response headers
The key window is checked first. A key refusal skips the workspace check. Otherwise, the reset uses the window with fewer requests remaining; ties select the key. Console-created keys have equal limits for both windows.
X-Request-Id- Keep this request identifier when contacting support.
X-RateLimit-Limit- The lower key or workspace limit after both checks. A key refusal returns its own limit. Also includes
X-RateLimit-Remaining. X-RateLimit-Reset- The Unix second when the window with fewer requests remaining resets; ties select the key. A key refusal returns its own reset.
X-RightNow- Idempotent- Replay truefor a replay;unavailablewhen the settled answer cannot be read.X-Latency-Ms- Response timing.
Server-Timingdescribes gateway stages; neither is a latency guarantee. Cache-Controlno-store. Call the API from a server over HTTPS.
On a rate refusal, Retry-After uses the refusing window's reset. The workspace's limit per minute is shared by all its keys.
Validation
Use the decide schema. Unsupported fields such as messages, temperature and stream return invalid_request.
Inline input: text, JSON state (robot state), images, voice, PDF, video (preview). Only listed formats are supported. Read Inputs for input formats and availability and Sessions for the routing hints.
The 64k and 128k bands are served through Danger zone with SZ-Danger-Zone: long_context_64k or long_context_128k. Read Danger zone for access steps and limits.
For a refusal, inspect error.code and error.retryable. Follow the response's retry advice in Errors.
Credit balance
GET /v1/credits reads the balance for a workspace using prepaid credits. Use your API key.
- Read limit
- 60 per minute
- Reply fields
object, balance_cents, available_cents, currency, as_of, promotional_held_centsobjectcreditsbalance_cents- The balance in whole cents.
available_cents- The balance after subtracting held funds, in whole cents.
currencyusdas_of- The time of the reading as an ISO timestamp.
promotional_held_cents- Optional. Promotional credit reserved by in-flight claims, in whole cents.