# System One > Build AI agent decisions with an open-source TypeScript SDK and a hosted decision API. Turn text and application state into choices, scores, and probabilities for tool routing, ranking, and condition checks. Use the SDK to define questions and handle typed results. Connect it to System One API for hosted inference, or configure a supported provider directly. Your code controls what happens next. ## When to use System One Use System One to route a request among named choices, score a condition against an ordered rubric, or estimate P(true) before an application branches. Define the answer space first. Keep business actions in application code, and escalate uncertain decisions to a person or a reasoning model. Validate performance on representative inputs before relying on a threshold. ## Start here - [Developer documentation](https://docs.system-one.dev/en) - [Versioning and deprecation](https://docs.system-one.dev/en/docs/api/versioning) - [Idempotency and retries](https://docs.system-one.dev/en/docs/api/idempotency) - [API errors](https://docs.system-one.dev/en/docs/api/errors) - [TypeScript SDK](https://system-one.dev/en/sdk) - [API reference](https://system-one.dev/en/api) - [Models](https://system-one.dev/en/models) - [Model catalog](https://docs.system-one.dev/en/docs/models) - [Authentication](https://system-one.dev/en/auth.md) - [Pricing](https://system-one.dev/en/pricing) - [Credit billing](https://docs.system-one.dev/en/docs/billing) - [OpenAPI specification](https://system-one.dev/openapi.json) - [Agent integration guide](https://system-one.dev/en/skill.md) - [System One for Coding Agents: Cursor, Claude Code, Codex](https://docs.system-one.dev/en/docs/coding-agents) - [Installable coding-agent skill](https://system-one.dev/skills/system-one/SKILL.md) - [About](https://system-one.dev/en/about) - [Contact](https://system-one.dev/en/contact) - [Playground samples](https://system-one.dev/en/demo) - [Blog](https://system-one.dev/en/blog) - [SDK source](https://github.com/ziyu/system-one-sdk) - [@system-one-ai/core (npm)](https://www.npmjs.com/package/@system-one-ai/core) ## Playground - [One API call to make a decision in your app](https://system-one.dev/en/demo): Yes/no, pick-one, a score, or fields such as an invoice number and amount — each sample includes a confidence. Below are sample results from six scenarios. Sign in to try them with your own content. - [What should the character do next?](https://system-one.dev/en/demo/npc-action): Turn a game character's state (health, enemies, inventory, terrain) into JSON and get back one of five actions, with a probability for each. - [Is this email phishing?](https://system-one.dev/en/demo/phishing-email): A fake Apple notice is judged high risk; an internal company maintenance notice is judged low risk. - [Will this post be deleted?](https://system-one.dev/en/demo/tweet-moderation): A joke about Monday meetings stays up; abuse aimed at a group is flagged for deletion. - [Which answer is more reliable?](https://system-one.dev/en/demo/llm-judge): Picks the more accurate one. Swap the order of the two answers and the verdict stays the same. - [Is this change safe to merge?](https://system-one.dev/en/demo/code-review-risk): Score a diff's merge risk from "No risk" to "Block merge" and get a yes/no probability that it touches security or data safety, both from one request. - [Invoice extraction: what is the invoice number and amount?](https://system-one.dev/en/demo/invoice-extraction): Clairic extracts the invoice number and amount from invoice text; when the total due has no figure, the amount comes back null. ## Models - [Clairic](https://system-one.dev/en/models/clairic): An extraction model that returns typed values from text, JSON and images. ## Docs - [Extract typed fields with Clairic](https://docs.system-one.dev/en/docs/sdk/clairic): Call extract({ state, fields }) with the public model name clairic. - [用 Clairic 抽取类型化字段](https://docs.system-one.dev/zh-CN/docs/sdk/clairic): 使用公开模型名 clairic 调用 extract({ state, fields })。 ## Articles - [What Is a Decision Model? Typed AI Decisions vs LLM Text Generation](https://system-one.dev/en/blog/what-is-a-decision-model): A decision model answers choice, score and yes/no questions with probabilities instead of generating text. Learn how it differs from an LLM and how to call one from TypeScript. - [Jev Alternatives in 2026: Decision Models and a TypeScript SDK That Lets You Switch](https://system-one.dev/en/blog/jev-alternatives): Comparing hosted and open decision models? Map the options by inputs, hosting and lock-in, and see how one TypeScript SDK lets you swap models by changing an ID. - [An LLM-as-a-Judge Alternative: Use a Decision Model as the First Pass](https://system-one.dev/en/blog/llm-as-a-judge-alternative): LLM judges are slow and can score the same answer differently. See which evaluations a decision model can take over, which it can't, and how to escalate low-confidence verdicts. - [Too Many Tools? Route Agent Tool Calls with a Choice Question (TypeScript)](https://system-one.dev/en/blog/agent-tool-routing): When an agent has dozens of tools, it picks wrong and burns context. Combine retrieval, lazy loading and a Choice question with a confidence threshold, with TypeScript code. - [AI Agent Stop Conditions: Decide \"Done\" with Yes/No Probabilities](https://system-one.dev/en/blog/agent-stop-condition): Agents loop forever or declare victory too early. Split \"done\" into yes/no checks, combine probability thresholds with deterministic tests, and keep a hard step limit. - [LLM Model Routing: Judge Difficulty First, Then Send to a Small or Large Model](https://system-one.dev/en/blog/llm-model-routing): Sending every request to your biggest model wastes money, and asking an LLM to route is slow. Use a decision model to score difficulty, route by threshold and escalate. - [Microsoft-Decision-1 是什么?用途与常见问题](https://system-one.dev/zh-CN/blog/microsoft-decision-1): Microsoft-Decision-1 是微软的决策模型,返回选项、评分和是非概率,而不是文本。本页整理微软官方说明中的用途与常见问题。 - [AI Agent Guardrails: Gate Risky Tool Calls with Yes/No Probabilities](https://system-one.dev/en/blog/agent-guardrails): Guardrail frameworks tell you where to check, not how to decide. Turn a policy into yes/no questions and use probability bands to allow, escalate to a human or block. - [Jev 和 ChatGPT 有什么区别?什么任务交给决策模型,什么交给大模型](https://system-one.dev/zh-CN/blog/jev-vs-chatgpt): ChatGPT 生成文本,Jev 只回答类型化问题并返回概率。用一张表和一段 TypeScript 代码看清两者分工,以及怎么在 Agent 里组合使用。 - [Jev、Clef、Clef Flash、Clef Omni、Decider 怎么选?决策模型对比与积分对照](https://system-one.dev/zh-CN/blog/jev-vs-clef): 五个决策模型用同一个 TypeScript SDK、同一种请求,切换只需换模型 ID。看输入类型、每块积分怎么对比,以及如何用自己的数据选模型。 - [决策模型和结构化输出有什么区别?用了 JSON Schema 还需要它吗](https://system-one.dev/zh-CN/blog/decision-model-vs-structured-output): 结构化输出保证 JSON 格式合法,但不告诉你答案有多确定。看 enum、boolean、评分字段怎么换成决策模型问题,拿到每个选项的概率。 - [Jev 和 Claude 有什么区别?在 Claude Agent 里把判断交给决策模型](https://system-one.dev/zh-CN/blog/jev-vs-claude): Claude 负责理解和写,Jev 只回答选一项、打个分或判断是否这类问题并返回概率。看 Claude 驱动的 Agent 里哪四个判断点适合交给 Jev,以及怎么用 TypeScript 接起来。 - [What Is Clairic? Extraction Models Explained](https://system-one.dev/en/blog/what-is-clairic): Clairic is an extraction model that pulls typed values (text, numbers, dates, estimates) out of text, JSON and images, and returns null when the input doesn't determine a value. Value types, use cases, limits and pricing. - [Clairic vs Jev and Clef: Extraction vs Decision Models, and How to Chain Them](https://system-one.dev/en/blog/clairic-vs-jev-clef): Clairic pulls typed values out of text and images; Jev and Clef decide among options you list. One table of the differences, how billing differs, and the extract, decide, then reply pattern. - [Prompting an LLM for JSON vs Using an Extraction Model](https://system-one.dev/en/blog/clairic-vs-llm-extraction): Prompting an LLM for JSON vs a dedicated extraction model: null handling, confidence, spans, per-request billing. - [OCR vs AI Field Extraction: Text Out or Fields Out?](https://system-one.dev/en/blog/clairic-vs-ocr): OCR gives you text; Clairic gives you typed fields with confidence. Compare outputs, pipelines and when to combine them. - [Turn Screenshots into Typed JSON for Your Agent](https://system-one.dev/en/use-cases/screenshot-to-json): Turn screenshots into typed JSON fields with Clairic's extract(): text, numbers, dates, with confidence and null when a value is missing. - [Extract Invoice and Receipt Fields with One API Call](https://system-one.dev/en/use-cases/invoice-receipt-extraction): Extract invoice number, dates, totals and tax from invoice text or receipt photos with a typed TypeScript SDK. ## Optional - [OpenAPI specification](https://system-one.dev/openapi.json) - [Sitemap](https://system-one.dev/sitemap.xml) - [llms.txt](https://system-one.dev/llms.txt) - [Agent integration guide](https://system-one.dev/en/skill.md) ## Response metadata Read X-System-One-Credits for the current debit, X-Request-Id for platform tracking, X-Idempotency-Replayed for replay status and X-System-One-Response-Mode for the transport. Safe native provider JSON and extensions are preserved. Platform metadata is not inserted into the provider response body. ## Failure and retry accounting Credits are reserved before inference and returned on a recorded failed inference. A successful replay using the same Idempotency-Key and body incurs no new inference or debit while its replay record remains available. Different input with the same key is rejected. After a timeout or uncertain result, check recorded usage before retrying and preserve the key. Reconciliation can be pending; do not assume a refund until the recorded outcome confirms it.