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
| Field | Type | Meaning |
|---|---|---|
state | text or JSON | The situation to decide about. JSON is passed to the model as indented JSON. See Writing the state. |
questions | object | One or more questions, each under a name you choose (up to 16). 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 | number, 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, optional | A 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
| 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 26 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. |
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.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
| Header | Meaning |
|---|---|
X-Request-Id | An id for this call, on every response (errors included). Quote it to support. |
Launchables-Key-Id, Launchables-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 answered by the default model.- 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.