# decision-machine-1 documentation ## Instructions for AI Agents - For clean Markdown of any page, append `.md` to the page URL - For section-specific indexes, append `/llms.txt` to any section URL - For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.milliseconds.ai/_mcp/server ## Docs - [Overview](https://docs.milliseconds.ai/.md): decision-machine-1 turns text into eight typed decisions, over a plain JSON API and an OpenAI-compatible surface. - [Quickstart](https://docs.milliseconds.ai/quickstart.md): Send one curl call to decision-machine-1 and read a typed decision back in about a second. - [Authentication](https://docs.milliseconds.ai/authentication.md): Every /v1 route needs an API key in the Authorization header. Keys look like sk-ms-.... - [Playground](https://docs.milliseconds.ai/playground.md): Run every capability from the browser in the API Reference tab, and read what comes back. - [Why a decisions model](https://docs.milliseconds.ai/why-a-decisions-model.md): Where a small typed decisions model beats a prompt, and where it does not. - [Input](https://docs.milliseconds.ai/concepts/input.md): Every capability takes one text or a batch of texts, and returns results in the order you sent them. - [Decisions and probabilities](https://docs.milliseconds.ai/concepts/decisions-and-probabilities.md): Every capability returns a typed decision plus the numbers behind it: probability, confidence, score, and character offsets. - [Thresholds and confidence routing](https://docs.milliseconds.ai/concepts/thresholds.md): Pick a cut-off per action, not per system. Raise the bar as the blast radius grows. - [Choosing a capability](https://docs.milliseconds.ai/concepts/choosing-a-capability.md): Pick the right endpoint from the shape of the answer you need. - [Writing good statements and labels](https://docs.milliseconds.ai/concepts/writing-good-questions.md): The text you send is the instruction: describe the case, never the verdict. - [Long text and chunking](https://docs.milliseconds.ai/concepts/long-text.md): How decision-machine-1 splits text over 2,000 characters, and when to split the text yourself. - [Languages](https://docs.milliseconds.ai/concepts/languages.md): decision-machine-1 reads non-English text, but you must write the labels, statements and descriptions in English. - [All capabilities](https://docs.milliseconds.ai/capabilities/overview.md): Eight typed decisions over text, the question each one answers, and how fast it returns. - [Yes / no](https://docs.milliseconds.ai/capabilities/yes-no.md): Score one statement, or up to 32 statements, against a text and get a boolean with a probability. - [Classify](https://docs.milliseconds.ai/capabilities/classify.md): Pick one label from a list, with a probability for every label. - [Classify tree](https://docs.milliseconds.ai/capabilities/classify-tree.md): Walk a nested label tree in one call and get the path, the compound numbers, and every level. - [Rate](https://docs.milliseconds.ai/capabilities/rate.md): Place text on an ordered scale and get a weighted score, a level and a confidence. - [Answer](https://docs.milliseconds.ai/capabilities/answer.md): Ask a question and get back the span of the text that answers it, with character offsets. - [Extract](https://docs.milliseconds.ai/capabilities/extract.md): Send a JSON Schema and get a typed object back, with null for every field the text does not carry. - [Entities](https://docs.milliseconds.ai/capabilities/entities.md): Find every span of every type you name, with character offsets you can slice. - [Verify](https://docs.milliseconds.ai/capabilities/verify.md): Check a value you already hold against the text, and see what the text actually says. - [Batching](https://docs.milliseconds.ai/capabilities/batching.md): Send up to 32 texts, statements or questions in one call and read the results back in input order. - [OpenAI-compatible API](https://docs.milliseconds.ai/openai/overview.md): Point any OpenAI client at decision-machine-1 for structured extraction and function calling. - [Structured extraction](https://docs.milliseconds.ai/openai/structured-extraction.md): Send response_format.json_schema to any OpenAI client and get a filled JSON object back as the assistant message. - [Function calling](https://docs.milliseconds.ai/openai/function-calling.md): Send OpenAI tools and get one tool call back: classification picks the tool, extraction fills the arguments. - [Streaming and differences](https://docs.milliseconds.ai/openai/streaming-and-differences.md): How stream:true behaves, and what the OpenAI surface does not implement. - [When to use the native API](https://docs.milliseconds.ai/openai/when-to-use-native.md): The OpenAI surface reaches two capabilities. The native endpoints reach all eight, and return the numbers you route on. - [Patterns](https://docs.milliseconds.ai/patterns/overview.md): Six ways to wire typed decisions into a system, and the problem each one removes. - [Confidence routing](https://docs.milliseconds.ai/patterns/confidence-routing.md): Treat confidence as a second axis and send every decision to act, confirm, review or escalate. - [LLM guardrails](https://docs.milliseconds.ai/patterns/llm-guardrails.md): Screen every message into and out of your LLM app with one batched yes-no call. - [Extract, then verify](https://docs.milliseconds.ai/patterns/extract-then-verify.md): Read a field out of the text, check it against the source, and queue the disagreements for a person. - [Cascade to an LLM](https://docs.milliseconds.ai/patterns/cascade.md): Decide the easy cases with decision-machine-1 and send only the uncertain ones to a large model. - [Composite scoring](https://docs.milliseconds.ai/patterns/composite-scoring.md): Split one broad judgment into atomic rate calls, then weight the scores in your own code. - [Intent routing](https://docs.milliseconds.ai/patterns/intent-routing.md): Send each incoming turn to the right tool, agent, or queue with one classify call over described labels. - [Recipes](https://docs.milliseconds.ai/recipes/overview.md): Six finished jobs, each with the labels, schema, thresholds and code already chosen. - [Support ticket triage](https://docs.milliseconds.ai/recipes/support-triage.md): Route, prioritise, and flag urgency for an inbound ticket with three decision calls. - [Invoice extraction with verification](https://docs.milliseconds.ai/recipes/invoice-extraction.md): Fill an invoice header schema, then check each risky field against the source text before you write it. - [Content moderation](https://docs.milliseconds.ai/recipes/content-moderation.md): Rate harm on a scale, flag the hard cases with yes-no, and send the uncertain middle to a person. - [RAG passage filtering](https://docs.milliseconds.ai/recipes/rag-passage-filtering.md): Score every retrieved passage with one yes/no statement, then keep, flag, or drop it before you build the prompt. - [PII detection](https://docs.milliseconds.ai/recipes/pii-detection.md): Find personal data with described entity types, then redact it with the returned character offsets. - [Taxonomy classification](https://docs.milliseconds.ai/recipes/taxonomy-classification.md): Walk a support taxonomy with one classify-tree call, then read the per-level numbers before you act. - [Golden sets](https://docs.milliseconds.ai/evaluate/golden-sets.md): Label 50 to 200 real examples, then score every change against them. - [Tuning thresholds](https://docs.milliseconds.ai/evaluate/tuning-thresholds.md): Score a golden set once, sweep every cut-off, and pick one number per action from the table. - [Monitoring](https://docs.milliseconds.ai/evaluate/monitoring.md): Log every decision, then watch confidence, escalation rate and label mix for drift. - [Pricing](https://docs.milliseconds.ai/reference/pricing.md): One price for every capability: $0.04 per million input tokens, nothing for output. The free plan includes 125 million input tokens each month. - [Errors](https://docs.milliseconds.ai/reference/errors.md): Every error code the API returns, what causes it, and which ones you retry. - [Limits and rate limits](https://docs.milliseconds.ai/reference/limits.md): Every field limit the API enforces, the per-organization rate limits, and how to handle 429 and 529. - [How it works](https://docs.milliseconds.ai/reference/how-it-works.md): Two small encoder models run on GPU, one pass over your text per call, with chunking at 2,000 characters. - [Changelog](https://docs.milliseconds.ai/changelog/llms.txt) ## API Docs - API Reference > decision-machine-1 [Is a statement true of the text?](https://docs.milliseconds.ai/api/decision-machine-1/yes-no.md) - API Reference > decision-machine-1 [Pick one label](https://docs.milliseconds.ai/api/decision-machine-1/classify.md) - API Reference > decision-machine-1 [Walk a label tree](https://docs.milliseconds.ai/api/decision-machine-1/classify-tree.md) - API Reference > decision-machine-1 [Place the text on a scale](https://docs.milliseconds.ai/api/decision-machine-1/rate.md) - API Reference > decision-machine-1 [Answer questions from the text](https://docs.milliseconds.ai/api/decision-machine-1/answer.md) - API Reference > decision-machine-1 [Extract structured data](https://docs.milliseconds.ai/api/decision-machine-1/extract.md) - API Reference > decision-machine-1 [Find entities](https://docs.milliseconds.ai/api/decision-machine-1/entities.md) - API Reference > decision-machine-1 [Check a value against the text](https://docs.milliseconds.ai/api/decision-machine-1/verify.md) - API Reference > openai [List models](https://docs.milliseconds.ai/api/openai/list-models.md) - API Reference > openai [Get a model](https://docs.milliseconds.ai/api/openai/get-model.md) - API Reference > openai [OpenAI-compatible chat completions](https://docs.milliseconds.ai/api/openai/chat-completions.md) ## OpenAPI Specification The raw OpenAPI 3.1 specification for this API is available at: - [OpenAPI JSON](https://docs.milliseconds.ai/openapi.json) - [OpenAPI YAML](https://docs.milliseconds.ai/openapi.yaml)