API reference

POST /v1/decide

Answer one or more questions about one situation.

POST https://api.launchables.ai/v1/decide

Answers one or more questions about one situation. 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 Writing the state.
questionsobjectOne or more questions, each under a name you choose (up to 16). 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_budgetnumber, 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.
modeltext, optionalA model id from GET /v1/models. Leave it out for the endpoint's default (myles-g-12b on api.launchables.ai). An endpoint that serves one model ignores it; 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 26 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.
usageinput_tokens and output_tokens for the request. Images count as input tokens (see Billing). Hosted pricing counts input tokens only.

Example

curl https://api.launchables.ai/v1/decide \
  -H "Authorization: Bearer $LAUNCHABLES_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "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 }
}

Illustrative probabilities and token counts. 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.
Launchables-Key-Id, Launchables-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 answered by the default model.
  • 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.