API reference

Everything the Saanora API accepts and returns: each endpoint, every request and response field with its type, default and limit, the three answer shapes, the response headers and every error code. To make your first call, start with the Quickstart and come back here for the details.

Base URL and endpoints

All requests go to https://api.saanora.com over HTTPS. Bodies are JSON, sent with Content-Type: application/json and limited to 1 MB.

MethodPathWhat it does
POST/v1/decisionsAnswers typed questions about one record, with a probability for every option. model is required.
POST/v1/systemoneThe same request and response for clients written for the open System One format, such as JevBench. model is optional and defaults to clara-1.
GET/v1/modelsLists the live models you can pass as model.

Every response, including errors, carries an x-request-id header. Error bodies repeat it as request_id. Quote it when you write to support@saanora.com.

Cold starts and timeouts. Clara scales down when idle, so after a quiet period it needs about a minute to start: the first request waits about 60–80 seconds and is then answered. Consistent mode follows about 50 seconds later; until then a consistent request gets 503 model_warming_up, never charged, with a Retry-After header saying how many seconds to wait. Retry after that wait, and use a client timeout of 120 s, as in the examples below.

Authentication

Every request needs a secret API key. Create one in the console under API keys and send it as a bearer token:

headers
Authorization: Bearer sk_sa_...
Content-Type: application/json

Clients that cannot set Authorization can send the key as X-API-Key: sk_sa_... instead.

  • Scope. Each key belongs to one project. Its requests count toward that project's usage and its optional monthly spend limit. Credit and rate limits are shared by the whole organization.
  • Storage. Keys are stored only as SHA-256 hashes, so a key cannot be shown again after it is created.
  • Revocation. A revoked key stops working within 60 seconds, because the gateway caches key lookups for 60 s.
  • Errors. No key, or a value that is not an sk_sa_ key, returns 401 missing_api_key. An unknown or revoked key returns 401 invalid_api_key.
Keep keys on your server. Anyone with a key can spend your credit. Never ship it in browser or mobile code. More in Authentication.

Create a decision

POST/v1/decisions

Send one record (state) and a set of typed questions about it. You get back, for every question, a probability over the options you defined. Answers are always one of your options, probabilities always sum to 1, and the model never writes free text.

Request body

FieldTypeRequiredDescription
modelstringYesA decision model id from GET /v1/models, today clara-1. Missing: 400 missing_model. A chat model such as mark-1x-27b: 400 wrong_endpoint (it is served by /v1/chat/completions). Unknown or not yet open: 404 model_not_found.
statestring or objectYesThe record to decide about: a ticket, a conversation, a database row. An object is rendered compactly as text, so you can send a row as it is. Up to 16K tokens; a longer record is shortened in the middle, so the start and end are kept. English only. Missing: 400 missing_state.
questionsobjectYesYour question id → a question object. 1 to 32 questions on Tier 1, 64 from Tier 2. The ids come back as the keys of answers. Missing or empty: 400 missing_questions. Too many: 422 too_many_questions.
mode"fast" | "consistent"NoDefault fast. See Modes. Also accepted as a query parameter, ?mode=consistent; if both are set, the body wins. Any other value: 422 invalid_mode.

A body over 1 MB returns 413 request_too_large; a body that is not JSON returns 400 invalid_json.

Question object

Each value in questions describes one question. Write instructions so it can be answered from the record alone.

FieldTypeApplies toDescription
type"noul" | "choice" | "score"AllYes/no, one of several options, or a level on an ordered scale. Any other value: 422 invalid_question_type.
instructionsstringAllThe question itself, in plain English.
criteriaobject or arrayAllnoul: optional object describing yes and no. choice: required object, option id → short description, 2 to 255 options. score: required array of levels, lowest first, 2 to 255 levels. Wrong shape or count for choice or score: 422 invalid_criteria.
thresholdnumber from 0 to 1noulOptional. When set, the answer also carries a boolean decision. A value outside 0 to 1 is ignored.

Yes/no questions (noul)

Use noul for anything with a yes or no answer. criteria is optional: add it when yes and no need defining, as an object with "true" and "false" keys ("yes" and "no" are also accepted). Add threshold to have the API apply your cut-off for you.

noul question
"refund": {
  "type": "noul",
  "instructions": "Is the customer asking for their money back?",
  "criteria": {
    "true": "The customer asks for a refund or a chargeback",
    "false": "Any other request, including questions about the refund policy"
  },
  "threshold": 0.9
}

Choice questions

Use choice when exactly one of several options applies. criteria maps each option id to a short description; the ids are what you get back. 2 to 255 options.

choice question
"intent": {
  "type": "choice",
  "instructions": "What does the customer want to do with their subscription?",
  "criteria": {
    "cancel": "End the subscription",
    "upgrade": "Move to a bigger plan",
    "support": "Get help with a problem, without changing the plan"
  }
}

Score questions

Use score for an ordered scale. criteria is an array of level descriptions, lowest first, with 2 to 255 levels. Levels are referred to by their index: 0 for the first, 1 for the next, and so on. Score scales are the least reliable question type, so when a decision can be phrased as yes/no or as a choice, prefer that.

score question
"severity": {
  "type": "score",
  "instructions": "How severe is the business impact?",
  "criteria": ["none", "low", "high", "critical"]
}

Modes: fast and consistent

Both modes return the same response shape. The difference is how the record is read and what is billed.

fast (default)consistent
ReadingThe record once; every question reuses that readingThe record again with each question, so each reading takes that question into account
Other questions in the requestNever change an answerNever change an answer
Options changed or a question rewordedAnswers can move moreAnswers hold steadier
Billed tokensThe record plus each question, onceThe tokens it reads: roughly the record times the number of questions
Tokens per minuteCounts the billed tokensCounts the billed tokens, so it uses your TPM faster
Latency and costLowestHigher; cost grows with the number of questions
JevBench-mini81.383.0

For example, a 2,000-token record with 8 questions bills a little over 2,000 tokens in fast mode (about $0.0002 at $0.10 per 1M) and roughly 16,000 tokens in consistent mode (about $0.0016). In both modes each question is answered on its own, so adding or removing a question never changes the others. Use consistent when steadier probabilities are worth the extra tokens: thresholds, audits, and choice questions whose options change over time, such as tool menus.

Example request

Three questions, one of each type, about a support message. The Python and TypeScript versions check for errors and print each answer.

curl https://api.saanora.com/v1/decisions \
  -H "Authorization: Bearer $SAANORA_API_KEY" \
  -H "Content-Type: application/json" \
  --max-time 120 \
  -d '{
  "model": "clara-1",
  "state": "Customer writes: our nightly export has failed three nights in a row and the finance team needs it by 9am.",
  "questions": {
    "failing":  { "type": "noul",   "instructions": "Is a scheduled export currently failing?" },
    "team":     { "type": "choice", "instructions": "Which team should own this?",
                  "criteria": { "engineering": "Fixes broken product functionality",
                                "billing": "Handles invoices, charges and refunds" } },
    "severity": { "type": "score",  "instructions": "How severe is the business impact?",
                  "criteria": ["none", "low", "high", "critical"] }
  }
}'

Response

A successful request returns 200 OK with a decision object. This is the response to the example above:

200 OK
{
  "id": "dec_1eab8757a66cc4fba1e7d9f7",
  "object": "decision",
  "created": 1792431238,
  "model": "clara-1",
  "mode": "fast",
  "answers": {
    "failing": { "type": "noul", "noul": 0.996 },
    "team": {
      "type": "choice", "choice": "billing", "confidence": 0.317,
      "probabilities": { "engineering": 0.341, "billing": 0.659 }
    },
    "severity": {
      "type": "score", "score": 2.48, "confidence": 0.511,
      "probabilities": { "0": 0.001, "1": 0.004, "2": 0.511, "3": 0.484 },
      "legend": { "0": "none", "1": "low", "2": "high", "3": "critical" }
    }
  },
  "usage": { "input_tokens": 191, "decisions": 3, "cost_usd": 0.00002 },
  "latency_ms": 279.6
}
FieldTypeDescription
idstringUnique id of this decision, starting dec_.
objectstringAlways decision.
createdintegerWhen the decision was created, in Unix seconds.
modelstringThe model that answered, for example clara-1.
modestringThe mode that ran: fast or consistent.
answersobjectOne entry per question, keyed by your question ids. The shape depends on the question type: see the answer tables below.
usage.input_tokensintegerBilled input tokens. In consistent mode, everything read across all questions. The same number counts toward your tokens per minute.
usage.decisionsintegerNumber of questions answered.
usage.cost_usdnumberExactly what was deducted from your credit, in US dollars.
latency_msnumberModel time for this request, in milliseconds. Total time in the platform is in the saanora-processing-ms header.

Clara costs $0.10 per 1M input tokens and $0 for output, with no per-decision fee. The example above billed 191 tokens: 191 × $0.10 / 1,000,000 = $0.0000191, rounded up to $0.000020. Each request's cost is rounded up to the nearest $0.000001. Before the model runs, a hold covering the worst case is placed on your credit; the exact cost is deducted afterward. If the hold cannot be covered, the request fails with 402 insufficient_credit and nothing runs. Failed requests are free. See Billing and credit.

Yes/no answer

FieldTypeDescription
typestringnoul.
noulnumber, 0 to 1Probability that the answer is yes. The probability of no is 1 - noul.
thresholdnumberOnly when the question set threshold: your value, echoed back.
decisionbooleanOnly when the question set threshold: noul >= threshold.

The refund question above, with threshold 0.9, could come back as:

noul answer
"refund": { "type": "noul", "noul": 0.93, "threshold": 0.9, "decision": true }
Yes/no answers are committed. Clara always takes a side on a yes/no question: noul is at most 0.199 or at least 0.801, never in between. A threshold anywhere from 0.2 to 0.8 therefore behaves exactly like 0.5. To separate confident answers from borderline ones, put your threshold above 0.8, for example 0.9 or 0.95, and send everything between 0.801 and it to review.

Choice answer

FieldTypeDescription
typestringchoice.
choicestringThe most likely option id. Always one of your criteria keys.
probabilitiesobjectOption id → probability, for every option. Sums to 1.
confidencenumber, 0 to 1(max p - 1/n) / (1 - 1/n), where n is the number of options. 1 when one option has all the probability, 0 when all options are equally likely, so it compares fairly across questions with different numbers of options.

For the intent question above, with 3 options and 0.94 on support: (0.94 - 1/3) / (1 - 1/3) = 0.91.

choice answer
"intent": {
  "type": "choice",
  "choice": "support",
  "probabilities": { "cancel": 0.04, "upgrade": 0.02, "support": 0.94 },
  "confidence": 0.91
}

Score answer

FieldTypeDescription
typestringscore.
scorenumberThe expected level index: the sum of index × probability. Between 0 and the number of levels minus 1, and usually not a whole number.
legendobjectLevel index (as a string) → the level description you sent.
probabilitiesobjectLevel index → probability, for every level. Sums to 1.
confidencenumber, 0 to 1The probability of the most likely level.

For the severity question in the example: 0 × 0.001 + 1 × 0.004 + 2 × 0.511 + 3 × 0.484 = 2.48, so the impact sits between "high" and "critical", nearly halfway. The most likely single level is the key with the highest probability, here "2" ("high").

score answer
"severity": {
  "type": "score",
  "score": 2.48,
  "legend": { "0": "none", "1": "low", "2": "high", "3": "critical" },
  "probabilities": { "0": 0.001, "1": 0.004, "2": 0.511, "3": 0.484 },
  "confidence": 0.511
}

Response headers

HeaderMeaning
x-request-idUnique id of this request. Also sent on errors.
x-ratelimit-limit-requestsRequests per minute allowed for your organization.
x-ratelimit-remaining-requestsRequests left in the current 60-second window.
x-ratelimit-reset-requestsTime until a request slot frees up, for example 12s.
x-ratelimit-limit-tokensInput tokens per minute allowed for your organization.
x-ratelimit-remaining-tokensInput tokens left in the current 60-second window.
saanora-processing-msTotal time the request spent in the platform, in milliseconds. Subtract latency_ms to see the time outside the model.
Retry-AfterOn 429 rate_limit_exceeded only: seconds to wait before retrying.

The x-ratelimit-* and saanora-processing-ms headers come with every response that reached the model, successful or not. A 429 rate_limit_exceeded carries the x-ratelimit-* headers and Retry-After. Any other error carries only x-request-id.

List models

GET/v1/models

Returns the live models. Use it to check that a key works, or to confirm a model id before you send it. It needs the same API key as every other endpoint.

curl https://api.saanora.com/v1/models \
  -H "Authorization: Bearer $SAANORA_API_KEY"

The response:

200 OK
{
  "object": "list",
  "data": [
    { "id": "clara-1", "object": "model", "owned_by": "saanora", "kind": "decision", "status": "live" }
  ]
}
FieldTypeDescription
objectstringAlways list.
data[].idstringThe id to pass as model.
data[].objectstringAlways model.
data[].owned_bystringAlways saanora.
data[].kindstringWhat kind of model it is. Clara is a decision model, served by /v1/decisions and /v1/systemone.
data[].statusstringThe model's availability, for example live.

Chat completions

POST/v1/chat/completions

OpenAI-compatible chat completions for Saanora's language models, today mark-1x-27b. Requests and responses follow OpenAI's format, so the OpenAI SDKs work with base URL https://api.saanora.com/v1 and your Saanora API key. It uses the same keys, credit and rate limits as every other endpoint.

request
{
  "model": "mark-1x-27b",
  "messages": [
    { "role": "system", "content": "Answer in one short paragraph." },
    { "role": "user", "content": "Why is the sky blue?" }
  ],
  "max_tokens": 4096,
  "reasoning_effort": "medium"
}
FieldTypeDescription
modelstringRequired. A chat model id from GET /v1/models: mark-1x-27b (the newest snapshot) or a snapshot such as mark-1x-27b-2026-11-19. A decision model such as clara-1 gets 400 wrong_endpoint: it is served by /v1/decisions.
messagesarrayRequired. Roles system, developer (treated as system), user, assistant and tool. Content is a string or a list of parts: text, and image_url with an https URL or a base64 data URL. A request can be up to 20 MB.
tools, tool_choice, parallel_tool_callsFunction calling, as in OpenAI's API. A call comes back in message.tool_calls with finish_reason tool_calls.
max_tokens, max_completion_tokensintegerOutput budget, reasoning included. Default 32,768. Input and output together fit the model's context.
streambooleanSend the answer as server-sent events. Use it for anything that may take more than a minute or two.
stream_options.include_usagebooleanWith stream, end with a chunk that carries usage.
reasoning_effortstringlow, medium (default) or high: how long the model thinks.
temperature, top_pnumberSampling. Defaults 0.6 and 0.95.
top_k, min_pnumberSampling, not OpenAI fields (send them in extra_body with the SDKs). Defaults 20 and 0.
presence_penalty, frequency_penalty, repetition_penalty, stop, seed, logprobs, top_logprobs, logit_bias, userAs in OpenAI's API.
ninteger1 to 4 choices. Each one's output is billed.
response_formatobjectjson_object or json_schema, for JSON output.
chat_template_kwargsobjectAdvanced: passed to the model's chat template.

The response is OpenAI's chat.completion. message.reasoning holds the model's thinking, separate from content, and is also sent as reasoning_content for clients that expect the older name. usage.completion_tokens counts the reasoning too (completion_tokens_details.reasoning_tokens breaks it out), and model is the snapshot that answered, such as mark-1x-27b-2026-11-19.

200 OK
{
  "id": "chatcmpl-8f2c41d07a6b4e3c",
  "object": "chat.completion",
  "created": 1795046400,
  "model": "mark-1x-27b-2026-11-19",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Sunlight scatters off air molecules, and blue light scatters most…",
        "reasoning": "The question is about Rayleigh scattering…",
        "reasoning_content": "The question is about Rayleigh scattering…"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 38, "completion_tokens": 412, "total_tokens": 450 }
}

With stream, the answer arrives as chat.completion.chunk events: reasoning first, then content, then data: [DONE]. Lines that start with : are keep-alives; the SDKs skip them.

stream
data: {"id":"chatcmpl-…","object":"chat.completion.chunk","model":"mark-1x-27b-2026-11-19","choices":[{"index":0,"delta":{"reasoning":"The question","reasoning_content":"The question"},"finish_reason":null}]}

data: {"id":"chatcmpl-…","object":"chat.completion.chunk","model":"mark-1x-27b-2026-11-19","choices":[{"index":0,"delta":{"content":"Sunlight"},"finish_reason":null}]}

data: {"id":"chatcmpl-…","object":"chat.completion.chunk","model":"mark-1x-27b-2026-11-19","choices":[],"usage":{"prompt_tokens":38,"completion_tokens":412,"total_tokens":450}}

data: [DONE]

What a chat request costs

Input tokens at the model's input price plus output tokens, reasoning included, at its output price, from the model's own counts. Before it starts, a request holds credit for its input and max_tokens of output; the difference comes back when it ends. A stream that is cut short is billed for what was sent. Requests the API refuses, and failed or timed-out ones, are free.

Errors

StatusCodeWhat to do
400missing_model, missing_messages, invalid_message, invalid_parameter, invalid_reasoning_effort, invalid_jsonFix the request; the message and param say what to change.
400wrong_endpointThe model is not a chat model. Clara is served by POST /v1/decisions.
400images_not_supported, tools_not_supported, unsupported_contentThe model does not take that input. Send text, or image_url parts to a model that reads images.
400invalid_image_urlSend an image as an https URL or a base64 data URL (data:image/...).
400context_length_exceededThe input is longer than the model reads. Shorten it.
400invalid_requestThe model refused the request; its reason is in message (for example, input plus max_tokens over the context).
402insufficient_creditAdd credit, or lower max_tokens: a request holds enough credit for max_tokens of output before it starts.
404model_not_foundNo model with that id is available to you.
429rate_limit_exceeded, project_spend_limitWait for Retry-After, or raise the project's limit.
502model_unavailableThe model could not answer. Retry shortly.
503model_warming_up, model_overloadedThe model is starting after a quiet period, or busy. Retry after Retry-After.
504response_timeoutA request without stream ran past 100 seconds. Stream it, or lower max_tokens or reasoning_effort.

Errors use the same envelope as every other endpoint: {"error": {"type", "code", "message", "param"}, "request_id"}. A stream that fails after it started ends with an error event and data: [DONE].

Legacy completions

POST/v1/completions

OpenAI's older text completions, with prompt instead of messages. It is there for tools that need it and is not recommended: it skips the chat template, so there is no separate reasoning and no system message.

System One compatibility

POST/v1/systemone

For clients written for the open System One format, such as JevBench. Point the client at https://api.saanora.com/v1/systemone and send your key in the Authorization header.

  • The body is the same as /v1/decisions, except that model is optional and defaults to clara-1.
  • The response, headers, errors, rate limits and billing are the same as /v1/decisions.
  • mode works the same way, in the body or as ?mode=.
cURL
curl https://api.saanora.com/v1/systemone \
  -H "Authorization: Bearer $SAANORA_API_KEY" \
  -H "Content-Type: application/json" \
  --max-time 120 \
  -d '{
  "state": "Customer writes: our nightly export has failed three nights in a row.",
  "questions": {
    "failing": { "type": "noul", "instructions": "Is a scheduled export currently failing?" }
  }
}'

OpenAI Decisions format

POST /v1/decisions also takes OpenAI's Decisions request, so the OpenAI SDKs' decisions.create works with base URL https://api.saanora.com/v1, your Saanora API key and model set to clara-1. It runs the same decision as the format above: the same answers, billing, rate limits, headers and errors. Send one format or the other; a body with both state and input gets 400.

import os
from openai import OpenAI

client = OpenAI(base_url="https://api.saanora.com/v1", api_key=os.environ["SAANORA_API_KEY"])

decision = client.decisions.create(
    model="clara-1",
    input="Our nightly export failed three nights in a row.",
    questions=[
        {"type": "predicate", "name": "failing", "instructions": "Is an export failing?"},
        {"type": "choice", "name": "team", "instructions": "Which team owns this?",
         "choices": [{"value": "engineering", "description": "Product bugs"},
                     {"value": "billing", "description": "Refunds"}]},
        {"type": "score", "name": "severity", "instructions": "How severe is it?",
         "levels": [{"label": "none"}, {"label": "low"}, {"label": "high"}, {"label": "critical"}]},
    ],
)
failing, team, severity = decision.answers          # in question order
print(failing.probability, team.choice, severity.score)

How the two formats line up

OpenAI's formatSaanora's format
input: a string, or messages (roles user, developer, system, assistant; content as a string or input_text, input_json, output_text and refusal parts) and tool items (function_call, function_call_output, custom_tool_call, custom_tool_call_output)state: the record, as a string or JSON
questions: an array, each with an optional namequestions: an object keyed by your own ids
predicate, answered with probabilitynoul, answered with noul
choice with choices: [{value, description}], value a string or a booleanchoice with criteria: {option: description}
score with levels: [{label, description}], lowest firstscore with criteria: [levels], lowest first
answers: an array, in question orderanswers: an object keyed by question id
  • mode (fast by default, or consistent) works the same way, in the body or as ?mode=. It is a Saanora addition.
  • prompt_cache_key, prompt_cache_options and safety_identifier are accepted and not used. Any other parameter, such as temperature, gets 400 unknown_parameter.
  • Choice values that read the same, such as the string "true" and the boolean true, are both supported; each comes back exactly as you sent it.
  • Error params name the field in your request, for example questions[1].choices[0].value.

Response

OpenAI's decision object: answers in question order, each with the question's name (or null), and OpenAI's usage fields. Clara writes no billed output, so output_tokens is 0. Saanora adds id, object, created, mode, usage.decisions, usage.cost_usd and latency_ms.

200 OK
{
  "id": "dec_5b0c2e8f9a1d4c7b3e6f8a20",
  "object": "decision",
  "created": 1795248000,
  "model": "clara-1",
  "mode": "fast",
  "answers": [
    { "type": "predicate", "name": "failing", "probability": 0.998 },
    { "type": "choice", "name": "team", "choice": "engineering", "confidence": 0.934,
      "probabilities": [ { "value": "engineering", "probability": 0.967 }, { "value": "billing", "probability": 0.033 } ] },
    { "type": "score", "name": "severity", "score": 2.01, "confidence": 0.794,
      "probabilities": [ { "label": "none", "value": 0, "probability": 0.003 }, { "label": "low", "value": 1, "probability": 0.091 },
                         { "label": "high", "value": 2, "probability": 0.794 }, { "label": "critical", "value": 3, "probability": 0.111 } ] }
  ],
  "usage": {
    "input_tokens": 166, "output_tokens": 0, "total_tokens": 166,
    "input_tokens_details": { "cached_tokens": 0, "cache_write_tokens": 0 },
    "output_tokens_details": { "reasoning_tokens": 0 },
    "decisions": 3, "cost_usd": 0.000017
  },
  "latency_ms": 116.0
}

Errors

Errors use standard HTTP status codes and a JSON body. Branch on error.code; message is written for people and can change.

422 Unprocessable Entity
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_criteria",
    "message": "choice needs criteria with 2 to 255 options",
    "param": "questions.team.criteria"
  },
  "request_id": "req_5b0c2e8f9a1d4c7b3e6f8a20"
}
FieldTypeDescription
error.typestringThe class of error, fixed by the status code (table below).
error.codestringThe specific reason, such as invalid_criteria.
error.messagestringA readable explanation of what to fix.
error.paramstring or nullThe field that caused the error, such as questions.team.criteria, or null when no single field did.
request_idstringSame value as the x-request-id header.
Statuserror.type
400, 413, 422invalid_request_error
401authentication_error
402insufficient_credit
404not_found_error
429rate_limit_error
502api_error
503overloaded_error

Error codes

StatuscodeMeaning
400invalid_jsonThe body is not valid JSON.
400missing_stateThe body has no state field, or is not a JSON object.
400missing_questionsquestions is missing, is not an object, or is empty.
400missing_modelNo model on /v1/decisions. (/v1/systemone defaults to clara-1.)
400wrong_endpointThe model is not a decision model, so this endpoint does not serve it.
401missing_api_keyNo key was sent, or it is not an sk_sa_ key.
401invalid_api_keyThe key is unknown or has been revoked.
402insufficient_creditYour credit cannot cover the hold for this request. Nothing ran.
404model_not_foundThe model id does not exist or is not available yet.
404not_foundThe path does not exist, for example /v1/decision. A known path with the wrong method, such as GET /v1/decisions, returns 405 with the same error body.
413request_too_largeThe body is over 1 MB.
422too_many_questionsMore questions than your tier allows in one request (32 on Tier 1, 64 from Tier 2).
422invalid_question_typeA question is not an object, or its type is not noul, choice or score. param is questions.<id>.type.
422invalid_criteriaChoice criteria are not an object of 2 to 255 options, or score criteria are not a list of 2 to 255 levels.
422invalid_modemode is not fast or consistent.
400 or 422invalid_requestThe model rejected a request that passed the checks above, for example noul criteria that are not an object. The message is the model's own reason. Fix the request before retrying.
429rate_limit_exceededYour organization is over its requests or tokens per minute. Wait for Retry-After.
429project_spend_limitThe project reached its monthly spend limit (UTC month). Retrying does not help: raise the limit or wait for the next month.
502model_unavailableThe model could not answer. Never charged. Retry with backoff.
503auth_unavailableThe key service is briefly unavailable. Retry with backoff.
503billing_unavailableThe billing service is briefly unavailable. Retry with backoff.
503catalog_unavailableThe model catalog is briefly unavailable. Retry with backoff.
Failed requests are free. You are never charged for a request that fails, including 502 model_unavailable. Retry 429 rate_limit_exceeded, 502 and 503; fix the request, credit or spend limit before retrying anything else. Retry strategy is in Errors.

Limits

LimitValueWhen exceeded
Request body1 MB413 request_too_large
Record (state)About 16K tokens, less when a question has a long option listNo error: the middle is shortened and billed as read
Questions per request32 on Tier 1, 64 from Tier 2422 too_many_questions
Choice options2 to 255422 invalid_criteria
Score levels2 to 255422 invalid_criteria
Requests per minuteBy tier, table below429 rate_limit_exceeded
Tokens per minuteBy tier, table below429 rate_limit_exceeded
Project monthly spendOptional, set per project (UTC month)429 project_spend_limit
CreditYour prepaid balance402 insufficient_credit

Rate limits apply to the whole organization, across all projects, keys and models. Both are sliding 60-second windows. Tokens per minute counts billed tokens, the same number as usage.input_tokens; failed or refused requests do not count. Your tier rises automatically the moment both conditions are met.

TierQualifies atRequests/minTokens/minQuestions/request
Tier 0Sign up3050K16
Tier 1$5 paid300300K32
Tier 2$50 paid, 7+ days since first payment700700K64
Tier 3$250 paid, 14+ days since first payment1,5001.5M64
Tier 4$1,000 paid, 30+ days since first payment2,5002.5M64
Tier 5$2,500 paid, 60+ days since first payment5,0005M64

Beyond Tier 5, write to support@saanora.com. More in Rate limits.