返回资讯中心
外部精选
软件工程
#开发者实时流

Show HN: Clara – a decision model that returns a probability for every answer

API referenceGuidesBest practicesErrorsRate limits

Hacker News 最新AKSaathwik2026/10/25 · 11 天前14 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Get started

OverviewQuickstartAuthenticationModels

Using the API

API referenceGuidesBest practicesErrorsRate limits

Account

Organizations and projectsBilling and creditData handling

Resources

Changelog

Saanora Platform documentation

Send a record, such as a support ticket, an agent conversation or an invoice, together with typed questions about it. Clara returns a probability for every option you defined, for every question, in one call. You call it over HTTPS with one API key and pay from prepaid credit.

You describe a decision as questions with fixed options. Clara reads the record and answers each question with probabilities over those options. It never writes free text: every answer is one of your options, and the probabilities always sum to 1. That makes the result safe to branch on in code.

A typical integration acts on its own when a probability is high, sends the middle band to a person and declines when it is low. One request can carry 1 to 32 questions on Tier 1 and 64 from Tier 2.

You need an account, credit and an API key. The Quickstart covers all three. Then keep the key in an environment variable on your server:

Copy

export SAANORA_API_KEY="sk_sa_..."

This request asks two questions about one customer message: a yes/no question with a threshold, and a choice between three options.

Copy

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": "Order A-1042, delivered Oct 5. Customer writes: the blender arrived with a cracked jar. I want my money back, not a new one.", "questions": { "damaged": { "type": "noul", "instructions": "Does the customer say the item arrived damaged?", "threshold": 0.9 }, "wants": { "type": "choice", "instructions": "What does the customer want?", "criteria": { "refund": "Their money back", "replacement": "A new item sent to them", "other": "Anything else" } } } }'

The response carries one answer per question, keyed by the ids you chose (damaged, wants):

Copy

{ "id": "dec_3b9e71c04f2a8d65e1c07b94", "object": "decision", "created": 1792491003, "model": "clara-1", "mode": "fast", "answers": { "damaged": { "type": "noul", "noul": 0.98, "threshold": 0.9, "decision": true }, "wants": { "type": "choice", "choice": "refund", "probabilities": { "refund": 0.94, "replacement": 0.04, "other": 0.02 }, "confidence": 0.91 } }, "usage": { "input_tokens": 170, "decisions": 2, "cost_usd": 0.000085 }, "latency_ms": 88.7 }

FieldMeaningidThe decision id, starting with dec_.objectAlways "decision".createdWhen the decision was made, in Unix seconds.model, modeThe model that answered and the mode it ran in: fast (the default) or consistent.answersOne answer per question, in the shape for its type. Here damaged.noul is 0.98, above the 0.9 threshold, so decision is true. wants.choice is refund with probability 0.94 out of three options, so confidence is (0.94 − 1/3) / (1 − 1/3) = 0.91.usage.input_tokensBilled input tokens. The same number counts toward your tokens-per-minute limit.usage.decisionsThe number of questions answered.usage.cost_usdExactly what was deducted from your credit.latency_msTime spent in the model, in milliseconds. The saanora-processing-ms header has the total time in the platform.The first call after a quiet period. 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 keep a client timeout of 120 seconds. Later requests are fast. The retry loop on Errors handles it for you.

How a request flows

Every call to POST /v1/decisions (or POST /v1/systemone) goes through the same six steps. Credit moves at two of them: a hold before the model runs and the exact charge after it.

Copy

{ "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "invalid or revoked API key", "param": null }, "request_id": "req_5c1e9a0b7d3f42e8a61b9c04" }

Models

ModelWhat it doesStatusInput / 1MOutput / 1MClara clara-1Typed decisions: a probability for every option you defineLive$0.50$0Mark mark-1Language model behind Saanora ChatComing soonat launchat launchClara (clara-1) is Saanora's frontier decision model. It scores 91.9% on AgentDecisionBench tool routing and 94.9% on a held-out customer-service yes/no set, answers five questions about one record in about 0.1 s, and returns 0% malformed answers. It works in English only.

Mark (mark-1), the language model behind Saanora Chat, is coming soon. Until it opens, requests to it return 404 model_not_found.

To see which models your key can call, list them:

Copy

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

200 OKCopy

{ "object": "list", "data": [ { "id": "clara-1", "object": "model", "owned_by": "saanora", "kind": "decision", "status": "live" } ] }

Benchmarks, specifications and known limitations are on Models. Before you automate on Clara's answers, check them against a few hundred of your own labelled records.

Clara costs $0.50 per 1M input tokens. Output is $0 and there is no per-decision fee, so a request costs usage.input_tokens × $0.50 / 1,000,000. The example above read 170 tokens and cost $0.000085. The smallest top-up, $5, buys 10M input tokens, about 58,000 requests like it.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →