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

# Decisions

{% hint style="warning" %}
This endpoint is currently in beta. For any issues or feedback, please contact us via [Discord](https://discord.com/invite/bPFEFcWBhp) or <support@cortecs.ai>.
{% endhint %}

## Create decisions

> Accepts input and a questions array. Also accepts the System One format (state and a questions object). Responses use the submitted format. Use one format per request.

```json
{"openapi":"3.0.0","info":{"title":"Cortecs Decisions API","version":"1.0.0"},"servers":[{"url":"https://api.cortecs.ai/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OpenAIDecisionsRequest":{"type":"object","required":["model","input","questions"],"properties":{"model":{"type":"string","description":"Choose an available model tagged Decision."},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/InputMessage"}}]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/OpenAIQuestion"},"minItems":1,"maxItems":128,"description":"Typed questions. Use names to identify answers."},"preference":{"type":"string","description":"The provider preference for handling the request.","enum":["speed","cost","balanced"]},"allowed_providers":{"type":"array","items":{"type":"string"},"description":"Provider IDs allowed to process the request, subject to project settings.","nullable":true},"eu_native":{"type":"boolean","description":"Whether to use only providers based and regulated within the EU.","nullable":true},"provider_order":{"type":"string","description":"Set to `custom` to try `allowed_providers` in the listed order instead of using preference-based routing.","enum":["custom"],"nullable":true},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"description":"Allowed endpoint quantizations. fp4 and fp8 include their variants; unknown matches unspecified quantization.","nullable":true},"allow_zero_data_retention":{"type":"boolean","description":"Whether to use only zero-data-retention providers.","nullable":true},"require_model_presets":{"type":"boolean","description":"Require a project preset alias for all model requests.","nullable":true},"enable_model_fallback":{"type":"boolean","description":"Allow automatic model fallback. Project settings may override this value.","nullable":true},"fallbacks":{"type":"array","items":{"type":"string"},"description":"Explicit fallback model IDs, tried in order. A nonempty list takes precedence over automatic fallback settings.","nullable":true}}},"InputMessage":{"type":"object","required":["content"],"properties":{"role":{"type":"string","enum":["user"],"default":"user"},"type":{"type":"string","enum":["message"],"default":"message"},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/InputText"}}]}},"additionalProperties":false},"InputText":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"additionalProperties":false},"OpenAIQuestion":{"oneOf":[{"$ref":"#/components/schemas/PredicateQuestion"},{"$ref":"#/components/schemas/OpenAIChoiceQuestion"},{"$ref":"#/components/schemas/OpenAIScoreQuestion"}]},"PredicateQuestion":{"type":"object","required":["type","instructions"],"properties":{"type":{"type":"string","enum":["predicate"]},"name":{"type":"string","nullable":true},"instructions":{"type":"string"}},"additionalProperties":false},"OpenAIChoiceQuestion":{"type":"object","required":["type","instructions","choices"],"properties":{"type":{"type":"string","enum":["choice"]},"name":{"type":"string","nullable":true},"instructions":{"type":"string"},"choices":{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"description":{"type":"string","nullable":true}},"additionalProperties":false},"minItems":2,"maxItems":255}},"additionalProperties":false},"OpenAIScoreQuestion":{"type":"object","required":["type","instructions","levels"],"properties":{"type":{"type":"string","enum":["score"]},"name":{"type":"string","nullable":true},"instructions":{"type":"string"},"levels":{"type":"array","items":{"type":"object","required":["label"],"properties":{"label":{"type":"string"},"description":{"type":"string","nullable":true}},"additionalProperties":false},"minItems":2,"maxItems":10}},"additionalProperties":false},"SystemOneRequest":{"type":"object","required":["model","state","questions"],"properties":{"model":{"type":"string","description":"Choose an available model tagged Decision."},"state":{"$ref":"#/components/schemas/State"},"questions":{"type":"object","minProperties":1,"maxProperties":128,"description":"Questions keyed by nonempty caller-chosen IDs.","additionalProperties":{"$ref":"#/components/schemas/SystemOneQuestion"}},"preference":{"type":"string","description":"The provider preference for handling the request.","enum":["speed","cost","balanced"]},"allowed_providers":{"type":"array","items":{"type":"string"},"description":"Provider IDs allowed to process the request, subject to project settings.","nullable":true},"eu_native":{"type":"boolean","description":"Whether to use only providers based and regulated within the EU.","nullable":true},"provider_order":{"type":"string","description":"Set to `custom` to try `allowed_providers` in the listed order instead of using preference-based routing.","enum":["custom"],"nullable":true},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"description":"Allowed endpoint quantizations. fp4 and fp8 include their variants; unknown matches unspecified quantization.","nullable":true},"allow_zero_data_retention":{"type":"boolean","description":"Whether to use only zero-data-retention providers.","nullable":true},"require_model_presets":{"type":"boolean","description":"Require a project preset alias for all model requests.","nullable":true},"enable_model_fallback":{"type":"boolean","description":"Allow automatic model fallback. Project settings may override this value.","nullable":true},"fallbacks":{"type":"array","items":{"type":"string"},"description":"Explicit fallback model IDs, tried in order. A nonempty list takes precedence over automatic fallback settings.","nullable":true}}},"State":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"Application state as text, an object, or an array."},"SystemOneQuestion":{"oneOf":[{"$ref":"#/components/schemas/NoulQuestion"},{"$ref":"#/components/schemas/SystemOneChoiceQuestion"},{"$ref":"#/components/schemas/SystemOneScoreQuestion"}]},"NoulQuestion":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["noul"]},"instructions":{"$ref":"#/components/schemas/OptionalQuestionText"},"criteria":{"type":"object","properties":{"true":{"$ref":"#/components/schemas/OptionalQuestionText"},"false":{"$ref":"#/components/schemas/OptionalQuestionText"}},"nullable":true,"additionalProperties":false}},"description":"Returns the probability that the condition is true. Supply instructions or criteria.","anyOf":[{"required":["instructions"],"properties":{"instructions":{"$ref":"#/components/schemas/QuestionText"}}},{"required":["criteria"],"properties":{"criteria":{"type":"object"}}}]},"OptionalQuestionText":{"oneOf":[{"type":"string","nullable":true},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]},"QuestionText":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]},"SystemOneChoiceQuestion":{"type":"object","required":["type","criteria"],"properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"$ref":"#/components/schemas/OptionalQuestionText"},"criteria":{"type":"object","minProperties":1,"maxProperties":255,"additionalProperties":{"$ref":"#/components/schemas/OptionalQuestionText"},"description":"Option IDs mapped to descriptions."}}},"SystemOneScoreQuestion":{"type":"object","required":["type","criteria"],"properties":{"type":{"type":"string","enum":["score"]},"instructions":{"$ref":"#/components/schemas/OptionalQuestionText"},"criteria":{"type":"array","items":{"$ref":"#/components/schemas/QuestionText"},"minItems":1,"maxItems":10,"description":"Ordered levels, lowest first."}}},"OpenAIDecisionsResponse":{"type":"object","required":["model","answers","usage"],"properties":{"model":{"type":"string"},"answers":{"type":"array","items":{"$ref":"#/components/schemas/OpenAIAnswer"}},"usage":{"$ref":"#/components/schemas/Usage"}}},"OpenAIAnswer":{"type":"object","required":["type","name"],"properties":{"type":{"type":"string","enum":["predicate","choice","score","refusal"]},"name":{"type":"string","description":"Question name, or null if omitted.","nullable":true},"probability":{"type":"number","description":"Probability for a predicate question.","minimum":0,"maximum":1},"choice":{"oneOf":[{"type":"string"},{"type":"boolean"}],"description":"Selected value for a choice question."},"score":{"type":"number","description":"Score for a score question; may be fractional and uses zero-based level indices."},"confidence":{"type":"number","description":"Included for choice and score answers."},"probabilities":{"type":"array","description":"Included for choice and score answers.","items":{"type":"object","required":["value","probability"],"properties":{"value":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"integer"}],"description":"Choice value or zero-based score index."},"label":{"type":"string","description":"Included for score levels."},"probability":{"type":"number","minimum":0,"maximum":1}}}}}},"Usage":{"type":"object","required":["input_tokens","output_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0},"input_tokens_details":{"type":"object"},"output_tokens_details":{"type":"object"},"cost":{"type":"number","minimum":0,"description":"Total cost in the unit selected by `x-cortecs-cost-unit` (credits by default; 1,000,000 credits = €1)."},"cost_details":{"type":"object","description":"Cost breakdown in the selected cost unit.","required":["prompt_cost","completion_cost"],"properties":{"prompt_cost":{"type":"number","minimum":0,"description":"Prompt cost in the selected cost unit."},"completion_cost":{"type":"number","minimum":0,"description":"Completion cost in the selected cost unit."}}}}},"SystemOneResponse":{"type":"object","required":["answers"],"properties":{"model":{"type":"string","nullable":true},"answers":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SystemOneAnswer"},"description":"Answers keyed by the question IDs from the request."},"usage":{"allOf":[{"$ref":"#/components/schemas/Usage"}],"type":"object","nullable":true}}},"SystemOneAnswer":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["noul","choice","score"]},"noul":{"type":"number","description":"Probability for a noul question.","minimum":0,"maximum":1},"choice":{"type":"string","description":"Selected option ID for a choice question."},"score":{"type":"number","description":"Score for a score question."},"confidence":{"type":"number","description":"Included for choice and score answers."},"probabilities":{"type":"object","description":"Choice IDs or score indices mapped to probabilities.","additionalProperties":{"type":"number"}},"legend":{"type":"object","description":"Score indices mapped to the requested level descriptions.","additionalProperties":{"$ref":"#/components/schemas/QuestionText"}}}}}},"paths":{"/decisions":{"post":{"parameters":[{"in":"header","name":"x-cortecs-cost-unit","description":"Unit for returned usage cost values. Defaults to CREDITS (1,000,000 credits = €1); EUR and USD select currency amounts.","required":false,"schema":{"type":"string","enum":["CREDITS","EUR","USD"],"default":"CREDITS"}}],"summary":"Create decisions","description":"Accepts input and a questions array. Also accepts the System One format (state and a questions object). Responses use the submitted format. Use one format per request.","operationId":"createDecisions","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/OpenAIDecisionsRequest"},{"$ref":"#/components/schemas/SystemOneRequest"}]}}}},"responses":{"200":{"description":"Typed answers and token usage. Example costs are illustrative.","headers":{},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/OpenAIDecisionsResponse"},{"$ref":"#/components/schemas/SystemOneResponse"}]}}}},"400":{"description":"Invalid request or unsupported input."},"500":{"description":"Internal server error."}}}}}}
```

## Answer System One questions

> Accepts state and a named questions object and returns a named answers object. Use /decisions for input and a questions array. Use one format per request.

```json
{"openapi":"3.0.0","info":{"title":"Cortecs Decisions API","version":"1.0.0"},"servers":[{"url":"https://api.cortecs.ai/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SystemOneRequest":{"type":"object","required":["model","state","questions"],"properties":{"model":{"type":"string","description":"Choose an available model tagged Decision."},"state":{"$ref":"#/components/schemas/State"},"questions":{"type":"object","minProperties":1,"maxProperties":128,"description":"Questions keyed by nonempty caller-chosen IDs.","additionalProperties":{"$ref":"#/components/schemas/SystemOneQuestion"}},"preference":{"type":"string","description":"The provider preference for handling the request.","enum":["speed","cost","balanced"]},"allowed_providers":{"type":"array","items":{"type":"string"},"description":"Provider IDs allowed to process the request, subject to project settings.","nullable":true},"eu_native":{"type":"boolean","description":"Whether to use only providers based and regulated within the EU.","nullable":true},"provider_order":{"type":"string","description":"Set to `custom` to try `allowed_providers` in the listed order instead of using preference-based routing.","enum":["custom"],"nullable":true},"quantizations":{"type":"array","items":{"type":"string","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32","unknown"]},"description":"Allowed endpoint quantizations. fp4 and fp8 include their variants; unknown matches unspecified quantization.","nullable":true},"allow_zero_data_retention":{"type":"boolean","description":"Whether to use only zero-data-retention providers.","nullable":true},"require_model_presets":{"type":"boolean","description":"Require a project preset alias for all model requests.","nullable":true},"enable_model_fallback":{"type":"boolean","description":"Allow automatic model fallback. Project settings may override this value.","nullable":true},"fallbacks":{"type":"array","items":{"type":"string"},"description":"Explicit fallback model IDs, tried in order. A nonempty list takes precedence over automatic fallback settings.","nullable":true}}},"State":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"Application state as text, an object, or an array."},"SystemOneQuestion":{"oneOf":[{"$ref":"#/components/schemas/NoulQuestion"},{"$ref":"#/components/schemas/SystemOneChoiceQuestion"},{"$ref":"#/components/schemas/SystemOneScoreQuestion"}]},"NoulQuestion":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["noul"]},"instructions":{"$ref":"#/components/schemas/OptionalQuestionText"},"criteria":{"type":"object","properties":{"true":{"$ref":"#/components/schemas/OptionalQuestionText"},"false":{"$ref":"#/components/schemas/OptionalQuestionText"}},"nullable":true,"additionalProperties":false}},"description":"Returns the probability that the condition is true. Supply instructions or criteria.","anyOf":[{"required":["instructions"],"properties":{"instructions":{"$ref":"#/components/schemas/QuestionText"}}},{"required":["criteria"],"properties":{"criteria":{"type":"object"}}}]},"OptionalQuestionText":{"oneOf":[{"type":"string","nullable":true},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]},"QuestionText":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true},{"type":"array","items":{}}]},"SystemOneChoiceQuestion":{"type":"object","required":["type","criteria"],"properties":{"type":{"type":"string","enum":["choice"]},"instructions":{"$ref":"#/components/schemas/OptionalQuestionText"},"criteria":{"type":"object","minProperties":1,"maxProperties":255,"additionalProperties":{"$ref":"#/components/schemas/OptionalQuestionText"},"description":"Option IDs mapped to descriptions."}}},"SystemOneScoreQuestion":{"type":"object","required":["type","criteria"],"properties":{"type":{"type":"string","enum":["score"]},"instructions":{"$ref":"#/components/schemas/OptionalQuestionText"},"criteria":{"type":"array","items":{"$ref":"#/components/schemas/QuestionText"},"minItems":1,"maxItems":10,"description":"Ordered levels, lowest first."}}},"SystemOneResponse":{"type":"object","required":["answers"],"properties":{"model":{"type":"string","nullable":true},"answers":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SystemOneAnswer"},"description":"Answers keyed by the question IDs from the request."},"usage":{"allOf":[{"$ref":"#/components/schemas/Usage"}],"type":"object","nullable":true}}},"SystemOneAnswer":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["noul","choice","score"]},"noul":{"type":"number","description":"Probability for a noul question.","minimum":0,"maximum":1},"choice":{"type":"string","description":"Selected option ID for a choice question."},"score":{"type":"number","description":"Score for a score question."},"confidence":{"type":"number","description":"Included for choice and score answers."},"probabilities":{"type":"object","description":"Choice IDs or score indices mapped to probabilities.","additionalProperties":{"type":"number"}},"legend":{"type":"object","description":"Score indices mapped to the requested level descriptions.","additionalProperties":{"$ref":"#/components/schemas/QuestionText"}}}},"Usage":{"type":"object","required":["input_tokens","output_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0},"input_tokens_details":{"type":"object"},"output_tokens_details":{"type":"object"},"cost":{"type":"number","minimum":0,"description":"Total cost in the unit selected by `x-cortecs-cost-unit` (credits by default; 1,000,000 credits = €1)."},"cost_details":{"type":"object","description":"Cost breakdown in the selected cost unit.","required":["prompt_cost","completion_cost"],"properties":{"prompt_cost":{"type":"number","minimum":0,"description":"Prompt cost in the selected cost unit."},"completion_cost":{"type":"number","minimum":0,"description":"Completion cost in the selected cost unit."}}}}}}},"paths":{"/systemone":{"post":{"parameters":[{"in":"header","name":"x-cortecs-cost-unit","description":"Unit for returned usage cost values. Defaults to CREDITS (1,000,000 credits = €1); EUR and USD select currency amounts.","required":false,"schema":{"type":"string","enum":["CREDITS","EUR","USD"],"default":"CREDITS"}}],"summary":"Answer System One questions","description":"Accepts state and a named questions object and returns a named answers object. Use /decisions for input and a questions array. Use one format per request.","operationId":"createSystemOne","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemOneRequest"}}}},"responses":{"200":{"description":"Typed answers and token usage.","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemOneResponse"}}}},"400":{"description":"Invalid request or unsupported input."},"500":{"description":"Internal server error."}}}}}}
```
