/v1/decisions
POST /v1/decisions, the OpenAI-style route, generated from the backend OpenAPI contract.
POST /v1/decisions returns the same decisions as System One in the shape of OpenAI's Decisions API. Use it if your code already calls client.decisions.create in an OpenAI SDK. It maps one-to-one onto the same internal request as System One.
curl https://api.sieve.one/v1/decisions \
-H "Authorization: Bearer $TYPESAFE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sieve-latest",
"input": "I was charged twice for my subscription this month. Please refund the extra charge.",
"questions": [
{ "name": "billing", "type": "predicate", "instructions": "This message is about billing." },
{
"name": "tone",
"type": "choice",
"instructions": "What is the tone of this message?",
"choices": [
{ "value": "angry", "description": "An upset or hostile message" },
{ "value": "calm", "description": "A neutral or polite message" }
]
},
{
"name": "urgency",
"type": "score",
"instructions": "How urgent is this message?",
"levels": [
{ "label": "low", "description": "Can wait" },
{ "label": "medium", "description": "Needs attention this week" },
{ "label": "high", "description": "Needs attention today" }
]
}
]
}'How it differs from System One
| System One | /v1/decisions | |
|---|---|---|
| State | state | input (a string, or user messages) |
| Questions | Map keyed by name | Ordered list; optional unique name |
| Yes/no | noul | predicate |
| Choice options | criteria map | choices: list of value and description |
| Number of options | 1 to 255 | 2 to 255, unique values |
| Score levels | criteria list | levels: list of label and description (2 to 10, unique labels) |
| Questions per request | Token limits only | 1 to 400 |
| Answers | Keyed by name | Same order as the questions |
| Question over the per-question token limit | Whole request fails (400) | That question comes back as {"name": ..., "type": "refusal"}; the others are answered |
| Malformed question | Whole request fails (422) | Whole request fails (400) |
| Errors | detail shape, 422 for validation | OpenAI error shape, 400 for validation |
| Overload | 529 | 503 |
box | 400 until a vision model ships | 400 (not a question type here) |
| Streaming | n/a | stream: true is a 400 unsupported_parameter |
Decisions are not generative, so parameters such as max_tokens and temperature are refused with wrong_model_type. Only user messages are accepted. Images must be data: URLs (the gateway never fetches a URL). prompt_cache_key, prompt_cache_options and safety_identifier are accepted and ignored.
Sieve extras
Send Sieve-Extras: true to add a top-level sieve object with model_version, answered_by (model per question name), temperature (per question name), escalated, state_tokens and latency_ms. The same header works on System One.