Skip to content
Typed answers with probability scores: one call with two questions, a yes or no probability and a choice with its confidence.

Typed answers with probability scores from one model API

, 3 min read, By Jaber Jaber

Engineering

The RightNow decision model API takes text, JSON state (robot state), images, voice, PDF and video (preview), and returns typed answers with probabilities.

The RightNow decision model makes structured decisions: send a state and named questions, then read probabilities, confidence and typed answers. Each answer comes back under its question's name: a yes or no probability from 0 to 1, or the chosen option with its confidence and the probability of each option.

What is a decision model?

A decision pairs your state with named questions and returns each result under its name. State is text, a JSON object or a JSON array.

JSON state can describe robot state, for example {"battery_percent":80,"moving":false}. Send code as text in state.

Each question has a name, a type and instructions. See Decisions, or read Introducing the RightNow decision model.

What can you send?

Inline input: text, JSON state (robot state), images, voice, PDF, video (preview). Only listed formats are supported.

A file is sent as an item inside state. Send an image as a data URL of a PNG or JPEG, a PDF as a data URL with its name, a video as an MP4 data URL, and audio as base64 WAV data with its format. See Inputs.

What comes back?

answers holds one answer for each question, under the question's name. A noul answer is a yes or no probability, from 0 to 1. A choice answer is the chosen option, with its confidence from 0 to 1 and the probability of each option in probabilities. usage.cost is the cost of the call.

One call with two typed questions. The state says order 1234 asks for a refund 45 days after delivery, and the policy allows 30 days. The yes or no question refund_allowed comes back as a probability from 0 to 1. The choice question next_step comes back as approve, deny or escalate, with its confidence and a probability for each option.
The shape of the reply. Each type stands in for a value. Call it with your key

How do you call it?

A key from the API keys page calls the RightNow decision model at the same base URL as every open model. With a key from the API keys page, call POST /v1/decisions. Send rightnow-decision as the model. Use the alias to follow the current model, or a pinned ID to select a version.

shell
curl https://api.rightnowai.co/v1/decisions \
  -H "Authorization: Bearer $RIGHTNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "rightnow-decision",
    "state": "Order 1234: the customer asks for a refund 45 days after delivery. The policy allows 30 days.",
    "questions": {
      "refund_allowed": {"type": "noul", "instructions": "Is the refund allowed under the policy?"},
      "next_step": {"type": "choice", "instructions": "What should support do next?",
        "options": ["approve", "deny", "escalate"]}
    }
  }'
A call with your key. Call it with your key

Set RIGHTNOW_API_KEY in the process that makes the call. Keep the key on your server and call over HTTPS. See Quickstart.

What does it cost?

With the RightNow decision model you pay for input, answered questions and an answered call.

Uncached text input costs USD 0.19 per million input tokens, and cached text input USD 0.019. Each answered question costs USD 0.0001, and each answered call USD 0.00001. Output is free.

A call with a file costs the text price and the fee of each file on the price card. Refused questions are not charged. See Pricing.

Where are the limits?

Standard text state supports up to 38,000 tokens. With a key from the API keys page, audio is WAV only and a call holds at most 32 questions.

Audio is limited to 60 seconds per request. Send up to 4 images per request. A PDF can have up to 500 pages. Send one silent H.264 MP4 of up to 10 seconds, without other files.

calibrated is false in this release.

A key from the API keys page has its own limit per minute: read X-RateLimit-Limit on its replies. See Inputs and Rate limits.

Short answers

Which question type should I use?

noul is a yes or no probability. On a text call, choice takes 2 to 10 options and score takes 2 to 4 levels.

Can I send files?

Yes. Send files inline. Only the listed formats are available.

Which model ID do I send?

Send rightnow-decision. To pin a version, use rightnow-decision-3.0.0.

How do I get a key?

Create a named key in Settings, under API keys, in an active workspace. A key belongs to its workspace and is shown once.

Are refused questions charged?

No. An all-refused request has no text, question, file or call charge.

Get started

$1 free for a new account.

Get an API key
rightnow
RightNow open models
Billed per token.
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://api.rightnowai.co/v1",   apiKey: process.env.RIGHTNOW_API_KEY,      });const response = await client.chat.completions.create({model: "MODEL_ID",                         messages: [{ role: "user", content: "Hello" }],max_tokens: 16384,});