Vireo Decide documentation
Everything you need to call Vireo Decide from your application: how the model works, how to authenticate, the full API reference, and practical guides for taking it to production.
Introduction#
Vireo Decide is a decision model. You send it a piece of input, such as a support ticket, an invoice, a product listing or a log line, together with a schema that lists the fields you want back. For every field the model returns a value and a probability that the value is correct.
Unlike a general-purpose language model, Vireo Decide never produces free text. Each field is resolved by scoring the allowed values directly, so the response always conforms to your schema, and all fields in a request are computed in a single parallel pass. In practice this makes it faster and considerably cheaper than generating JSON with an LLM, and the probabilities are calibrated well enough to automate on.
When to use Vireo Decide
- Classification and routing: ticket triage, intent detection, content moderation, lead qualification.
- Extraction into fixed fields: pulling dates, amounts, categories or flags out of unstructured text.
- Scoring: risk levels, priority, sentiment, relevance.
It is not designed for open-ended writing, conversation, summarisation or multi-step planning. For those tasks, use a general-purpose model and consider Vireo Decide for the routing and validation steps around it.
Quickstart#
This guide takes you from a new account to a working request. You will need Python 3.9 or later, or Node.js 18 or later.
- Create an API keySign in to the Vireo Console and open API keys. Create a key and store it somewhere safe. Keys are only shown once.
- Install the SDK
pip install vireo
npm install @vireo/sdk
- Set your key as an environment variable
shell
export VIREO_API_KEY="vr_live_..." - Make your first decision
from vireo import Vireo from pydantic import BaseModel from typing import Literal class Triage(BaseModel): is_refund_request: bool urgency: Literal["low", "medium", "high"] team: Literal["billing", "support", "sales"] client = Vireo() result = client.decide( model="decide-1.2", input="I was charged twice for my November invoice. Please refund one.", schema=Triage, ) print(result.team.value, result.team.p) # billing 0.93
import { Vireo } from "@vireo/sdk"; import { z } from "zod"; const Triage = z.object({ is_refund_request: z.boolean(), urgency: z.enum(["low", "medium", "high"]), team: z.enum(["billing", "support", "sales"]), }); const client = new Vireo(); const result = await client.decide({ model: "decide-1.2", input: "I was charged twice for my November invoice. Please refund one.", schema: Triage, }); console.log(result.team.value, result.team.p); // billing 0.93
curl https://api.usevireo.dev/v1/decide \ -H "Authorization: Bearer $VIREO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "decide-1.2", "input": "I was charged twice for my November invoice. Please refund one.", "schema": { "is_refund_request": { "type": "boolean" }, "urgency": { "enum": ["low", "medium", "high"] }, "team": { "enum": ["billing", "support", "sales"] } } }'
- Act on the resultUse the probability to decide whether to proceed automatically. See Confidence thresholds for a recommended approach.
The Developer plan includes 50M free input tokens each month. Requests made with a vr_test_ key are free and rate limited to 20 requests per second.
Authentication#
The API uses bearer token authentication. Include your key in the Authorization header of every request. All requests must be made over HTTPS; plain HTTP requests are rejected.
Authorization: Bearer vr_live_8f2c...e41a
| Key prefix | Environment | Billing |
|---|---|---|
vr_live_ | Production | Billed per input token |
vr_test_ | Development | Free, limited to 20 requests per second |
Scoped keys
Keys can be restricted to specific endpoints, models or IP ranges. We recommend creating a separate key per service so that a leaked key can be revoked without affecting other systems.
Never expose a live key in client-side code or a public repository. If a key is leaked, revoke it immediately from the Console. We automatically revoke keys that we detect in public GitHub repositories and notify the account owner.
Schemas and decisions#
A schema describes the fields you want back. You can pass a JSON Schema object directly, or let the SDK convert a Pydantic model or Zod object for you. Each field becomes one decision.
Supported field types
| Type | JSON Schema | Notes |
|---|---|---|
| Boolean | {"type": "boolean"} | Returns true or false. |
| Enum | {"enum": [...]} | Up to 512 options. Option names are used as part of the input, so make them descriptive. |
| Integer | {"type": "integer", "minimum": 0, "maximum": 10} | Bounded range required, up to 1,000 values. |
| Number | {"type": "number"} | Extracted from the input text. Probability reflects extraction confidence. |
| Multi-label | {"type": "array", "items": {"enum": [...]}} | Each option receives an independent probability. |
| Span | {"type": "string", "x-vireo": "span"} | Returns a substring of the input, such as a name or order ID. |
Field descriptions
Adding a description to a field gives the model additional context and typically improves accuracy by a few points on ambiguous fields. Keep descriptions short and concrete.
{
"urgency": {
"enum": ["low", "medium", "high"],
"description": "high = customer cannot use the product or is losing money"
}
}A request can contain up to 256 fields. Fields are resolved independently, so adding fields increases cost only through the extra schema tokens, not through additional generation.
Probabilities and calibration#
Every field in a response includes p, the probability that the returned value is correct. A model is calibrated when these probabilities match observed accuracy: across all answers reported at 0.80, roughly 80% should be right.
Vireo Decide is trained with RLCP (reinforcement learning for calibrated prediction), which rewards the model for accurate probabilities rather than only for correct answers. On our internal evaluation suite, its expected calibration error is 1.8%, compared with 9% to 24% for verbalised confidence from general-purpose LLMs.
Full distributions
Set "return_distribution": true to receive the probability of every option, not only the top one. This is useful for ranking, for showing alternatives to a human reviewer, or for combining decisions in your own code.
"team": { "value": "billing", "p": 0.93, "distribution": { "billing": 0.93, "support": 0.06, "sales": 0.01 } }
Calibration holds on data similar to what the model was trained and evaluated on. If your inputs are unusual, for example very short, heavily abbreviated or in a niche domain, measure calibration on a labelled sample before relying on it. See Evaluating accuracy.
Confidence thresholds#
The most common pattern is to set a threshold per field. Results above the threshold are acted on automatically; results below it are sent to a human or to a fallback system.
THRESHOLDS = {"team": 0.90, "urgency": 0.80}
def route(ticket):
r = client.decide(model="decide-1.2", input=ticket.body, schema=Triage)
if all(r[f].p >= t for f, t in THRESHOLDS.items()):
return assign(ticket, team=r.team.value, urgency=r.urgency.value)
return review_queue.push(ticket, suggestion=r)Choosing a threshold
- Label 300 to 500 representative examples.
- Run them through Vireo Decide and record each field's value and probability.
- For each candidate threshold, compute two numbers: the share of items that would be automated, and the accuracy of those automated items.
- Pick the lowest threshold that meets your accuracy target. Revisit it monthly as you collect more review data.
The Console includes a threshold explorer that draws this curve for you from any evaluation run.
Determinism and versioning#
Given the same model version, input, schema and seed, Vireo Decide returns identical values and probabilities. This makes results easy to cache, test and audit.
Model identifiers come in two forms. A pinned identifier such as decide-1.2-20261101 never changes. An alias such as decide-1.2 points to the latest pinned release of that minor version and may be updated with bug fixes. For production, we recommend pinning.
| Identifier | Type | Status |
|---|---|---|
decide-1.2-20261101 | Pinned | Current |
decide-1.2 | Alias | Points to 20261101 |
decide-1.1-20260715 | Pinned | Supported until 31 May 2027 |
Deprecated versions remain available for at least six months after the deprecation notice, which is sent by email and listed in the changelog.
Create a decision#
Resolves every field in the schema for a single input and returns the values with their probabilities.
Request body
| Parameter | Description |
|---|---|
modelrequiredstring | Model identifier, for example decide-1.2. |
inputrequiredstring | object | The text to decide on, or an object whose string values are concatenated with their keys as headings. Maximum 64,000 tokens. |
schemarequiredobject | A map of field names to JSON Schema definitions. Up to 256 fields. |
instructionsstring | Optional guidance applied to all fields, such as company policy or definitions. Maximum 4,000 tokens. |
return_distributionboolean | Return the probability of every option. Defaults to false. |
seedinteger | Seed for reproducible results. Defaults to 0. |
metadataobject | Up to 16 key-value pairs stored with the request log, useful for tracing. Not used by the model. |
Response
{
"id": "dec_01JD8Q4Z7M2N5P",
"object": "decision",
"model": "decide-1.2-20261101",
"created": 1795619234,
"fields": {
"is_refund_request": { "value": true, "p": 0.97 },
"urgency": { "value": "high", "p": 0.81 },
"team": { "value": "billing", "p": 0.93 }
},
"usage": { "input_tokens": 2047, "schema_tokens": 38 },
"latency_ms": 108
}Create a batch#
Submits up to 100,000 inputs for asynchronous processing at 50% of the standard price. Batches complete within 24 hours and usually within 30 minutes.
| Parameter | Description |
|---|---|
modelrequiredstring | Model identifier. |
schemarequiredobject | Shared schema applied to every item. |
itemsrequiredarray | Objects with a unique custom_id and an input. Alternatively pass input_file_id for a JSONL upload. |
webhook_urlstring | HTTPS endpoint that receives a signed batch.completed event. |
batch = client.batches.create( model="decide-1.2", schema=Triage, items=[{"custom_id": t.id, "input": t.body} for t in tickets], webhook_url="https://example.com/hooks/vireo", ) print(batch.id, batch.status) # bat_01JD8R... queued
Retrieve a batch#
Returns the status of a batch. When status is completed, the output_file_id can be downloaded as JSONL, one decision per line in the original order.
| Status | Meaning |
|---|---|
queued | Accepted and waiting for capacity. |
running | Items are being processed. progress reports completed and total counts. |
completed | All items finished. Failed items are listed in error_file_id. |
cancelled | Cancelled by the user. Completed items are still billed and returned. |
List models#
Returns the models available to your organisation, with their context length, pricing and deprecation date if one has been announced.
{
"data": [
{ "id": "decide-1.2-20261101", "context_tokens": 64000, "input_price_per_m": 0.038, "deprecated_at": null },
{ "id": "decide-1.1-20260715", "context_tokens": 32000, "input_price_per_m": 0.045, "deprecated_at": "2026-11-30" }
]
}Errors#
Errors use conventional HTTP status codes and return a JSON body with a machine-readable type, a human-readable message and, where relevant, the param that caused the problem.
{
"error": {
"type": "invalid_schema",
"message": "Field 'priority' uses type 'string' without enum or span.",
"param": "schema.priority",
"request_id": "req_7Hk2Lq9"
}
}| Status | Type | What to do |
|---|---|---|
400 | invalid_request, invalid_schema | Fix the request. Do not retry unchanged. |
401 | authentication_error | Check that the key is present, valid and not revoked. |
403 | permission_denied | The key's scope does not allow this endpoint or model. |
413 | input_too_large | Shorten the input or split it into several requests. |
429 | rate_limited | Retry after the number of seconds in the Retry-After header. |
500, 503 | server_error, overloaded | Retry with exponential backoff. The SDKs do this automatically, up to three times. |
Include the request_id when contacting support. It lets us find the request in our logs even when zero data retention is enabled.
Rate limits#
Limits are applied per organisation and reported on every response through the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers.
| Plan | Requests per second | Input tokens per minute | Batch queue |
|---|---|---|---|
| Developer | 20 | 2M | 10,000 items |
| Production | 2,000 | 400M | 5M items |
| Enterprise | Custom | Custom | Custom |
If you expect a sudden increase in traffic, such as a launch or a backfill, contact us at least two business days in advance and we will raise your limits temporarily.
Migrating from an LLM#
Most teams arrive with a working prompt that asks a general-purpose model to return JSON. Moving that workload to Vireo Decide usually takes a few days and follows the same steps.
- Turn the output format into a schemaEvery key your prompt asks for becomes a field. Free-text fields with a small set of realistic values should become enums. Fields that genuinely need generated text, such as a reply draft, should stay with the LLM.
- Move instructions into descriptionsDefinitions that apply to a single field go into that field's
description. Policies that apply to every field go intoinstructions. - Run both systems in shadow modeSend production traffic to both for one to two weeks, keep using the LLM's output, and log both results.
- Compare against labels, not against the LLMAgreement with the old system is a poor metric if the old system was wrong. Label a sample of disagreements and measure both models against those labels.
- Set thresholds and switch overChoose thresholds as described in Confidence thresholds, then route traffic to Vireo Decide. Keep the LLM as a fallback for low-confidence items if that suits your workflow.
Evaluating accuracy#
Before going live, measure performance on your own data. Public benchmarks rarely reflect the details of a specific workflow.
- Sample size: 300 labelled examples per field is enough to estimate accuracy within about ±3 points. Use more for rare classes.
- Representative data: draw examples from recent production traffic rather than hand-picking them.
- Per-field metrics: report accuracy, calibration error and automation rate at your chosen threshold for each field separately.
Upload a labelled CSV or JSONL file in the Console under Evaluations and the report, including a reliability diagram and threshold curve, is generated automatically.
Production checklist#
Click items to mark them as done. Your progress is saved in this browser.
- Pin a model version instead of using an alias.
- Store the API key in a secrets manager, never in source code.
- Use a separate scoped key for each service.
- Handle
429and5xxresponses with backoff (built into the SDKs). - Log
request_idand probabilities for every decision. - Choose thresholds from a labelled evaluation, not intuition.
- Route low-confidence items to a review queue or fallback.
- Set up a usage alert in the Console.
- Enable zero data retention if your data is sensitive.
SDKs and libraries#
| Language | Package | Install |
|---|---|---|
| Python | vireo | pip install vireo |
| TypeScript / Node.js | @vireo/sdk | npm install @vireo/sdk |
| Go | github.com/vireo-ai/vireo-go | go get github.com/vireo-ai/vireo-go |
All official SDKs handle authentication, retries, timeouts and pagination, and convert native schema types (Pydantic, Zod, Go structs) to JSON Schema. Community libraries for Ruby, Java and Rust are listed on our GitHub organisation.
Data and security#
- No training on your data. API inputs and outputs are never used to train or improve our models.
- Retention. By default, request logs are kept for 30 days for abuse monitoring and debugging. With zero data retention enabled, inputs and outputs are not written to disk.
- Encryption. TLS 1.2 or later in transit, AES-256 at rest.
- Compliance. SOC 2 Type II audited annually. A Data Processing Agreement is available for GDPR.
- Regions. Choose
usoreuper project. Requests are processed only in the selected region.
To report a security issue, email security@usevireo.dev. We respond within one business day.
Changelog#
Added the batch endpoint at 50% of the standard price. Median latency reduced by 31%. Nested list fields are now supported. Expected calibration error improved from 2.4% to 1.8%.
First stable release of vireo-go with struct-tag schema generation.
Projects can now be created in the EU region. Existing projects remain in the US.
Context window increased to 32k tokens. Added span fields and return_distribution.