> For the complete documentation index, see [llms.txt](https://docs.otari.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otari.ai/otari/for-integrators/api-reference/decisions.md).

# Decisions

## Create Decision

> Answer typed questions (noul, choice, score) about a state.\
> \
> \`\`model\`\` is \`\`\<provider>:\<model>\`\`, where the provider is a \`\`decision\_providers\`\`\
> entry, for example \`\`typesafe:jev-latest\`\` or \`\`openrouter:typesafe/jev-1.13\`\`.\
> \
> Authentication modes:\
> \- Master key: the \`\`user\`\` field is required and may name any existing user.\
> \- API key: usage and spend bind to the key's own user; a \`\`user\`\` naming a\
> &#x20; different user is rejected with 403 unless mismatch rejection is off.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"DecisionRequest":{"description":"A decisions request: typed questions to answer about one state.","properties":{"images":{"anyOf":[{"items":{"type":"string"},"maxItems":16,"type":"array"},{"type":"null"}],"description":"Images for a vision decision model, as data URLs (data:image/...;base64,...). An extension llama-server supports; a provider that does not refuses the request.","title":"Images"},"model":{"description":"Decision provider and model, e.g. 'typesafe:jev-latest'","title":"Model","type":"string"},"questions":{"additionalProperties":{"discriminator":{"mapping":{"choice":"#/components/schemas/ChoiceQuestion","noul":"#/components/schemas/NoulQuestion","score":"#/components/schemas/ScoreQuestion"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/NoulQuestion"},{"$ref":"#/components/schemas/ChoiceQuestion"},{"$ref":"#/components/schemas/ScoreQuestion"}]},"description":"Questions, keyed by answer name","minProperties":1,"title":"Questions","type":"object"},"state":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"description":"The content the questions are about","title":"State"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User ID for usage attribution; not sent upstream","title":"User"}},"required":["model","state","questions"],"title":"DecisionRequest","type":"object"},"NoulQuestion":{"additionalProperties":true,"description":"A yes-or-no question, answered with the probability of yes.","properties":{"criteria":{"anyOf":[{"$ref":"#/components/schemas/NoulCriteria"},{"type":"null"}]},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Instructions"},"type":{"const":"noul","title":"Type","type":"string"}},"required":["type","instructions"],"title":"NoulQuestion","type":"object"},"NoulCriteria":{"additionalProperties":true,"description":"What a yes and a no each mean, for a ``noul`` question.","properties":{"false":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"False"},"true":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"True"}},"title":"NoulCriteria","type":"object"},"ChoiceQuestion":{"additionalProperties":true,"description":"A question answered with one of the named options.","properties":{"criteria":{"additionalProperties":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}]},"description":"Option name to what it means","maxProperties":255,"minProperties":2,"title":"Criteria","type":"object"},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Instructions"},"type":{"const":"choice","title":"Type","type":"string"}},"required":["type","instructions","criteria"],"title":"ChoiceQuestion","type":"object"},"ScoreQuestion":{"additionalProperties":true,"description":"A question answered with a level on an ordered scale.","properties":{"criteria":{"description":"Level descriptions, lowest first","items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}]},"maxItems":10,"minItems":2,"title":"Criteria","type":"array"},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Instructions"},"type":{"const":"score","title":"Type","type":"string"}},"required":["type","instructions","criteria"],"title":"ScoreQuestion","type":"object"},"DecisionResponse":{"additionalProperties":true,"description":"The provider's answers, keyed like the request's questions.","properties":{"answers":{"additionalProperties":{"$ref":"#/components/schemas/DecisionAnswer"},"title":"Answers","type":"object"},"model":{"title":"Model","type":"string"},"usage":{"anyOf":[{"$ref":"#/components/schemas/DecisionUsage"},{"type":"null"}]}},"required":["model","answers"],"title":"DecisionResponse","type":"object"},"DecisionAnswer":{"additionalProperties":true,"description":"One question's answer. Which value field is set follows ``type``.","properties":{"choice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The chosen option, for a choice question","title":"Choice"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"legend":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Legend"},"noul":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Probability of yes, for a noul question","title":"Noul"},"probabilities":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Probabilities"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The level, for a score question","title":"Score"},"type":{"title":"Type","type":"string"}},"required":["type"],"title":"DecisionAnswer","type":"object"},"DecisionUsage":{"additionalProperties":true,"description":"Token counts the provider reported, plus its own cost where it reports one.","properties":{"cost":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"The provider's own charge in USD, when it reports one","title":"Cost"},"input_tokens":{"default":0,"title":"Input Tokens","type":"integer"},"output_tokens":{"default":0,"title":"Output Tokens","type":"integer"}},"title":"DecisionUsage","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/decisions":{"post":{"description":"Answer typed questions (noul, choice, score) about a state.\n\n``model`` is ``<provider>:<model>``, where the provider is a ``decision_providers``\nentry, for example ``typesafe:jev-latest`` or ``openrouter:typesafe/jev-1.13``.\n\nAuthentication modes:\n- Master key: the ``user`` field is required and may name any existing user.\n- API key: usage and spend bind to the key's own user; a ``user`` naming a\n  different user is rejected with 403 unless mismatch rejection is off.","operationId":"decisions-create_decision","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Create Decision","tags":["decisions"]}}}}
```

## Create Systemone Decision

> Answer typed questions at the path TypeSafe's SDK and llama-server use.\
> \
> Identical to \`\`POST /api/v1/decisions\`\`; point the client's base URL at the gateway's \`\`/api\`\`.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"DecisionRequest":{"description":"A decisions request: typed questions to answer about one state.","properties":{"images":{"anyOf":[{"items":{"type":"string"},"maxItems":16,"type":"array"},{"type":"null"}],"description":"Images for a vision decision model, as data URLs (data:image/...;base64,...). An extension llama-server supports; a provider that does not refuses the request.","title":"Images"},"model":{"description":"Decision provider and model, e.g. 'typesafe:jev-latest'","title":"Model","type":"string"},"questions":{"additionalProperties":{"discriminator":{"mapping":{"choice":"#/components/schemas/ChoiceQuestion","noul":"#/components/schemas/NoulQuestion","score":"#/components/schemas/ScoreQuestion"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/NoulQuestion"},{"$ref":"#/components/schemas/ChoiceQuestion"},{"$ref":"#/components/schemas/ScoreQuestion"}]},"description":"Questions, keyed by answer name","minProperties":1,"title":"Questions","type":"object"},"state":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"description":"The content the questions are about","title":"State"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User ID for usage attribution; not sent upstream","title":"User"}},"required":["model","state","questions"],"title":"DecisionRequest","type":"object"},"NoulQuestion":{"additionalProperties":true,"description":"A yes-or-no question, answered with the probability of yes.","properties":{"criteria":{"anyOf":[{"$ref":"#/components/schemas/NoulCriteria"},{"type":"null"}]},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Instructions"},"type":{"const":"noul","title":"Type","type":"string"}},"required":["type","instructions"],"title":"NoulQuestion","type":"object"},"NoulCriteria":{"additionalProperties":true,"description":"What a yes and a no each mean, for a ``noul`` question.","properties":{"false":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"False"},"true":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"title":"True"}},"title":"NoulCriteria","type":"object"},"ChoiceQuestion":{"additionalProperties":true,"description":"A question answered with one of the named options.","properties":{"criteria":{"additionalProperties":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}]},"description":"Option name to what it means","maxProperties":255,"minProperties":2,"title":"Criteria","type":"object"},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Instructions"},"type":{"const":"choice","title":"Type","type":"string"}},"required":["type","instructions","criteria"],"title":"ChoiceQuestion","type":"object"},"ScoreQuestion":{"additionalProperties":true,"description":"A question answered with a level on an ordered scale.","properties":{"criteria":{"description":"Level descriptions, lowest first","items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}]},"maxItems":10,"minItems":2,"title":"Criteria","type":"array"},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Instructions"},"type":{"const":"score","title":"Type","type":"string"}},"required":["type","instructions","criteria"],"title":"ScoreQuestion","type":"object"},"DecisionResponse":{"additionalProperties":true,"description":"The provider's answers, keyed like the request's questions.","properties":{"answers":{"additionalProperties":{"$ref":"#/components/schemas/DecisionAnswer"},"title":"Answers","type":"object"},"model":{"title":"Model","type":"string"},"usage":{"anyOf":[{"$ref":"#/components/schemas/DecisionUsage"},{"type":"null"}]}},"required":["model","answers"],"title":"DecisionResponse","type":"object"},"DecisionAnswer":{"additionalProperties":true,"description":"One question's answer. Which value field is set follows ``type``.","properties":{"choice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The chosen option, for a choice question","title":"Choice"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"legend":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Legend"},"noul":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Probability of yes, for a noul question","title":"Noul"},"probabilities":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Probabilities"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The level, for a score question","title":"Score"},"type":{"title":"Type","type":"string"}},"required":["type"],"title":"DecisionAnswer","type":"object"},"DecisionUsage":{"additionalProperties":true,"description":"Token counts the provider reported, plus its own cost where it reports one.","properties":{"cost":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"The provider's own charge in USD, when it reports one","title":"Cost"},"input_tokens":{"default":0,"title":"Input Tokens","type":"integer"},"output_tokens":{"default":0,"title":"Output Tokens","type":"integer"}},"title":"DecisionUsage","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/systemone":{"post":{"description":"Answer typed questions at the path TypeSafe's SDK and llama-server use.\n\nIdentical to ``POST /api/v1/decisions``; point the client's base URL at the gateway's ``/api``.","operationId":"decisions-create_systemone_decision","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionResponse"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Create Systemone Decision","tags":["decisions"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otari.ai/otari/for-integrators/api-reference/decisions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
