Decisions
POST https://api-staging.impossiblecarrot.cc/api/v1/systemone
System One inference answers typed questions about one supplied state. Each question is evaluated in
one encoder row and returns probabilities rather than prose. A bearer API key
and an explicit marketplace model id are required. The TypeSafe clients default to jev-latest, which
is not a marketplace model id.
Request body
| Field | Type | Notes |
|---|---|---|
model | string | Required marketplace model id. |
state | string, object or array | Required content to judge. |
questions | object | Required nonempty map of caller chosen ids to typed questions. |
questions.*.type | choice, score or noul | Required discriminator. |
questions.*.instructions | string, object or array | Required guidance. |
questions.*.criteria | object or array | Choice keys map to guidance or null; score uses a nonempty array; noul optionally names both true and false. |
provider | object | Provider preferences. |
user, session_id | string | Optional opaque identifiers, at most 256 characters each. |
trace | object | Optional trace metadata; the marketplace accepts it and does not forward it to the engine. |
curl https://api-staging.impossiblecarrot.cc/api/v1/systemone -H "Authorization: Bearer $HEIMDALL_API_KEY" -H "Content-Type: application/json" -d '{"model":"convaiinnovations/laya","state":"We were billed twice. Please refund the duplicate charge.","questions":{"dept":{"type":"choice","instructions":"Which team?","criteria":{"billing":"Invoices and refunds","engineering":"Bugs and outages"}}}}'
{
"id": "gen_01J8Z4K6V9",
"model": "convaiinnovations/laya",
"provider": "ImpCC",
"answers": {
"dept": {
"type": "choice",
"choice": "billing",
"probabilities": { "billing": 0.94, "engineering": 0.06 },
"confidence": 0.81
}
},
"usage": { "input_tokens": 123, "output_tokens": 0, "cost": 0.0000052 }
}
Response fields
| Field | Meaning |
|---|---|
answers | One typed answer per submitted question id. |
choice, score, noul | The answer value for that question type. |
probabilities | Per-option probabilities on choice and score answers. |
confidence | Confidence on choice and score answers. |
legend | Score level descriptions keyed 0 through the last level. |
usage.input_tokens | Tokens processed across all question rows; the state counts once per question. |
usage.output_tokens | Always zero, since no output text is generated. |
usage.cost | USD charged at the endpoint's prompt-token price, or null if no price is declared. |
An endpoint must declare the decisions output. decisions_unsupported and
decisions_ask_unsupported appear in a 503 no_route response when no endpoint offers the rail or
fits the question types and count. Each row must fit the endpoint's context window. An oversized row
is filtered with context_too_small; an engine's exact tokenizer may still refuse it with
400 context_length_exceeded. The state is never silently trimmed.
TypeSafe SDK
The Node and Python TypeSafe clients append /v1/systemone to the configured base URL. Set
TYPESAFE_BASE_URL to {apiOrigin()}/api and TYPESAFE_API_KEY to the marketplace key, then pass
model explicitly:
import { TypeSafeClient, choice } from '@typesafe-ai/sdk';
const client = new TypeSafeClient({
baseURL: `${API_ORIGIN}/api`,
apiKey: process.env.HEIMDALL_API_KEY,
});
const reply = await client.systemOne({
model: 'convaiinnovations/laya',
state: 'Refund the duplicate charge.',
questions: { dept: choice('Which team?', { billing: null, engineering: null }) },
});
The Python typesafe-sdk client accepts base_url with the same /api suffix. The SDKs retry
408, 429 and server errors and honour Retry-After.