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

# Decisions

Get typed answers to questions about text and image inputs.

## Create a decision

> Get typed answers to questions about text and image inputs.\
> \
> \*\*Note:\*\* Currently supported only with \`GPT 6 Luna\` from the OpenAI provider.<br>

```json
{"openapi":"3.0.0","info":{"title":"Nexos AI Public API Production","version":"1.0.0"},"tags":[{"name":"Decisions","description":"Get typed answers to questions about text and image inputs."}],"servers":[{"url":"https://api.nexos.ai"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Authenticate by sending your nexos API key in the `X-Api-Key` header (e.g. `X-Api-Key: user-...` for a user key or `X-Api-Key: team-...` for a team key). This is an alternative to the `Authorization: Bearer` scheme. If both `X-Nexos-Key` and `X-Api-Key` are sent, `X-Nexos-Key` takes precedence."}},"schemas":{"DecisionsRequest":{"type":"object","description":"Request for typed answers to questions about the input.","properties":{"model":{"type":"string","description":"Decision model identifier. Currently only `GPT 6 Luna` from the OpenAI provider is supported."},"input":{"description":"Text string or a list of user messages with text and inline base64 images.","oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/DecisionInputMessage"}}]},"questions":{"type":"array","description":"Questions to answer about the input.","minItems":1,"items":{"$ref":"#/components/schemas/DecisionQuestion"}}},"required":["model","input","questions"],"additionalProperties":true},"DecisionInputMessage":{"type":"object","properties":{"role":{"type":"string","enum":["user"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/DecisionInputContentPart"}}]}},"required":["role","content"]},"DecisionInputContentPart":{"type":"object","properties":{"type":{"type":"string","enum":["input_text","input_image"]},"text":{"type":"string","description":"Text content. Used with `input_text`."},"image_url":{"type":"string","description":"Inline base64 data URL. Used with `input_image`. Remote URLs are not supported."}},"required":["type"],"additionalProperties":true},"DecisionQuestion":{"oneOf":[{"$ref":"#/components/schemas/DecisionPredicateQuestion"},{"$ref":"#/components/schemas/DecisionChoiceQuestion"},{"$ref":"#/components/schemas/DecisionScoreQuestion"}],"discriminator":{"propertyName":"type","mapping":{"predicate":"#/components/schemas/DecisionPredicateQuestion","choice":"#/components/schemas/DecisionChoiceQuestion","score":"#/components/schemas/DecisionScoreQuestion"}}},"DecisionPredicateQuestion":{"type":"object","description":"Returns the probability that a condition is true.","properties":{"type":{"type":"string","enum":["predicate"]},"name":{"type":"string"},"instructions":{"type":"string"}},"required":["type","name","instructions"]},"DecisionChoiceQuestion":{"type":"object","description":"Returns one option plus probabilities for each option.","properties":{"type":{"type":"string","enum":["choice"]},"name":{"type":"string"},"instructions":{"type":"string"},"choices":{"type":"array","minItems":2,"items":{"type":"object","properties":{"value":{"type":"string"},"description":{"type":"string"}},"required":["value"]}}},"required":["type","name","instructions","choices"]},"DecisionScoreQuestion":{"type":"object","description":"Returns a weighted position on ordered levels.","properties":{"type":{"type":"string","enum":["score"]},"name":{"type":"string"},"instructions":{"type":"string"},"levels":{"type":"array","minItems":2,"items":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"}},"required":["label"]}}},"required":["type","name","instructions","levels"]},"DecisionAnswer":{"type":"object","properties":{"type":{"type":"string","enum":["predicate","choice","score","refusal"]},"name":{"type":"string"},"probability":{"type":"number","description":"Probability that the condition is true. Predicate only."},"choice":{"type":"string","description":"Selected option value. Choice only."},"score":{"type":"number","description":"Weighted average position on the levels. Score only."},"confidence":{"type":"number","description":"Answer confidence. Choice and score only."},"probabilities":{"type":"array","description":"Probability per option or level. Choice and score only.","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"probability":{"type":"number"}},"additionalProperties":true}}},"required":["type","name"],"additionalProperties":true},"DecisionsUsage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}},"additionalProperties":true}},"responses":{"DecisionsResponse":{"description":"Typed answers to the requested questions.","content":{"application/json":{"schema":{"type":"object","properties":{"answers":{"type":"array","items":{"$ref":"#/components/schemas/DecisionAnswer"}},"usage":{"$ref":"#/components/schemas/DecisionsUsage"}},"required":["answers"],"additionalProperties":true}}}},"OutOfCredits":{"description":"The company has run out of AI credits. Returned when the company's budget limit has been reached.\n","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}}},"paths":{"/v1/decisions":{"post":{"operationId":"post-decisions-v1","summary":"Create a decision","tags":["Decisions"],"description":"Get typed answers to questions about text and image inputs.\n\n**Note:** Currently supported only with `GPT 6 Luna` from the OpenAI provider.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionsRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/DecisionsResponse"},"400":{"description":"Invalid request data."},"402":{"$ref":"#/components/responses/OutOfCredits"},"422":{"description":"Upstream validation error."},"500":{"description":"Server error."}}}}}}
```


---

# 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.nexos.ai/gateway-api/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.
