Skip to content

Decide

Every field of POST /v1/decide: the request, the response, headers and body limits.

http
POST https://api.mellix.com/v1/decide

Answers 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

FieldTypeMeaning
statetext or JSONThe situation to decide about. JSON is passed to the model as indented JSON. See State.
questionsobjectOne 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.
assetsobject, optionalImages 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_budgetinteger, optionalThe 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.
modeltextA 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

FieldTypeMeaning
typetextnoul, choice or score.
instructionstextThe question, in plain language. null is read as no instructions.
criteriaobject or listFor 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

FieldMeaning
modelThe model that answered.
answersOne 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_charsOnly 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.
usageinput_tokens and output_tokens for the request. Images count as input tokens (see Billing). Hosted pricing counts input tokens only.

Example

bash
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"]}
    }
  }'
json
{
  "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

HeaderMeaning
X-Request-IdAn id for this call, on every response (errors included). Quote it to support.
X-State-TruncatedOnly 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-ExpiresThe calling key's id and expiry date, so a program can plan key rotation. See Authentication.
Retry-AfterOn 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: gzip or Content-Encoding: zstd with a compressed body. Any other encoding returns 415.
  • Multipart: a multipart/form-data body is accepted when its first part is named request and holds the JSON body. File parts carry images, named from assets; see Images.

Compatibility

The API works with existing decision-model clients:

  • POST /v1/systemone accepts the same request and returns the same response as POST /v1/decide. On that path a model the 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 null descriptions, for example {"true": null, "false": null} or {"approve": null, "reject": null}, are read by option name.
  • choice and score answers carry confidence, and score answers carry legend, beside the fields described above. Clients that ignore fields they do not know see no change.
  • Compressed (gzip, zstd) and multipart/form-data bodies are accepted, as above.
  • GET /v1/models lists the models both as data and as models.
  • An image opt-in header that some clients send is accepted and not required.