Decide
Every field of POST /v1/decide: the request, the response, headers and body limits.
POST https://api.mellix.com/v1/decideAnswers one or more questions about one situation. It needs a bearer token and a JSON body with a Content-Length header (see Request bodies for compressed and multipart bodies). This endpoint serves the Myles-G models. The CPU models (Myles-400M, 150M and 22M) are not called over HTTP; see Model types. There is no text-generation endpoint.
Request body
| Field | Type | Meaning |
|---|---|---|
state | text or JSON | The situation to decide about. JSON is passed to the model as indented JSON. See State. |
questions | object | One or more questions, each under a name you choose (up to 256, with up to 256 options each and 4,096 over all of them). Each answer comes back under the same name. |
assets | object, optional | Images for the model to read (Myles-G 12B and Myles-G 31B), each under a reference you then write in the state, the instructions or the criteria descriptions. See Images. |
image_budget | integer, optional | The most input tokens one image may use: 70, 140 or 280 (the default). Lower is cheaper and faster but sees less detail. See Image budget. |
model | text | A model id from GET /v1/models, for example myles-g-12b or myles-g-31b. Required: every request names its model. During a transition, a request without one is still answered by Myles-G 12B; this is being withdrawn, after which such a request is refused with 400 model_required. The response's model says which model answered. |
Question object
| Field | Type | Meaning |
|---|---|---|
type | text | noul, choice or score. |
instructions | text | The question, in plain language. null is read as no instructions. |
criteria | object or list | For choice: labels mapped to descriptions, or a list of labels. For score: level descriptions, lowest first. Optional for noul: what true and false mean (or yes and no), both sides given. A description may be null: the option is then shown by its name (Yes or No, the label, or "Level 2"). Up to 256 options. |
Response
| Field | Meaning |
|---|---|
model | The model that answered. |
answers | One answer per question name. noul: the probability of yes; uncertain answers are committed, at least 0.80 towards the chosen side. choice: choice, confidence and probabilities. score: level, score, confidence, legend and probabilities. See Question types. |
truncated, state_chars | Only when the model did not read the whole state: truncated is true and state_chars gives original (characters sent) and kept (characters the model read). A text state too long for the context window keeps its beginning and its end; a state with images keeps its first 20,000 characters. See State. |
usage | input_tokens and output_tokens for the request. Images count as input tokens (see Billing). Hosted pricing counts input tokens only. |
Example
curl https://api.mellix.com/v1/decide \
-H "Authorization: Bearer $MELLIX_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "myles-g-12b",
"state": "Charged twice for order 4471, need the extra payment back",
"questions": {
"route": {"type": "choice", "instructions": "Which team?", "criteria": ["billing", "returns", "technical", "other"]}
}
}'{
"model": "myles-g-12b",
"answers": {
"route": {
"type": "choice",
"choice": "billing",
"confidence": 0.89,
"probabilities": { "billing": 0.93, "returns": 0.04, "technical": 0.01, "other": 0.02 }
}
},
"usage": { "input_tokens": 118, "output_tokens": 1 }
}The probabilities and token counts are illustrative. The response is one JSON object, sent when every question is answered; there is no streaming. To send an image with the request, see Images.
Response headers
| Header | Meaning |
|---|---|
X-Request-Id | An id for this call, on every response (errors included). Quote it to support. |
X-State-Truncated | Only when the model did not read the whole state: original=N; kept=M, in characters, as in the response's state_chars. |
Mellix-Key-Id, Mellix-Key-Expires | The calling key's id and expiry date, so a program can plan key rotation. See Authentication. |
Retry-After | On 429 and 503: the seconds to wait before trying again. |
Request bodies
- Size: up to 32 MiB as sent, and 32 MiB once decompressed.
- Compression: send
Content-Encoding: gziporContent-Encoding: zstdwith a compressed body. Any other encoding returns415. - Multipart: a
multipart/form-databody is accepted when its first part is namedrequestand holds the JSON body. File parts carry images, named fromassets; see Images.
Compatibility
The API works with existing decision-model clients:
POST /v1/systemoneaccepts the same request and returns the same response asPOST /v1/decide. On that path amodelthe endpoint does not serve is, during the same transition, answered by Myles-G 12B; name a served model so the answer does not change when the transition ends.- Criteria given as an object with
nulldescriptions, for example{"true": null, "false": null}or{"approve": null, "reject": null}, are read by option name. choiceandscoreanswers carryconfidence, andscoreanswers carrylegend, beside the fields described above. Clients that ignore fields they do not know see no change.- Compressed (
gzip,zstd) andmultipart/form-databodies are accepted, as above. GET /v1/modelslists the models both asdataand asmodels.- An image opt-in header that some clients send is accepted and not required.

