API reference

Errors and limits

Status codes, error bodies and request limits.

Every error comes back as JSON with a message and, for most errors, a type:

{ "error": "what went wrong", "type": "out_of_credit" }

A 422 also carries detail, a list naming the field at fault as a path from the body, so a program can point at it:

{
  "error": "question 'eligible': noul criteria need both sides: the no (false) side is missing",
  "type": "invalid_question",
  "detail": [{ "loc": ["body", "questions", "eligible", "criteria"], "msg": "...", "type": "invalid_question" }]
}

Status codes

StatusMeaning
400The body is not JSON (type invalid_json), a compressed body does not decompress (bad_encoding), or a multipart body is malformed (bad_multipart).
400An image in assets cannot be used. Types invalid_assets, unsupported_image_format, invalid_image, image_too_large, image_dimensions, too_many_images, unreferenced_asset and image_reference_truncated; the message names the asset.
401Missing, wrong, expired or revoked API token.
402Type out_of_credit: the account has no prepaid credit left. Top up in the console. Do not retry until you have.
402Type budget_exceeded: the key's workspace has reached its monthly budget. Raise the budget in the console under Workspaces, or wait for the next month. Budgets reset on the 1st, UK time.
403Type model_not_allowed: the key's workspace is not allowed to use that model. Change the workspace's models in the console.
404Unknown path.
411No Content-Length header.
413Type body_too_large: the body is over 32 MiB, as sent or once decompressed.
415Type unsupported_encoding: a Content-Encoding other than gzip or zstd, or more than one. The Accept-Encoding header lists what is accepted.
422A question cannot be answered: no state or no questions, an unknown type, missing criteria for a choice or score, noul criteria that do not name both sides (or use keys other than true/yes and false/no), a label listed twice, more than 26 options, more than 16 questions in one request, or a state and question longer than the model's context window. detail names the field.
422Type invalid_image_budget: image_budget is not 70, 140 or 280.
422Type images_not_supported: the model asked for does not read images (only Myles-G 12B and Myles-G 31B do). Send the request without assets.
429Type rate_limited: over your key's per-minute limit, of requests or of request bytes. Type daily_limit_reached: over a daily cap. The Retry-After header (and retry_after in the body) gives the seconds to wait.
502The model behind the endpoint did not respond. Retry with backoff.
503The model is not available right now: the endpoint is switched off for maintenance, or no healthy server for that model is answering (type model_unavailable), or the server is busy with other large requests (type busy). The Retry-After header says when to try again.

Limits

LimitValue
Request body32 MiB as sent, and 32 MiB once decompressed
Request bytes per key256 MiB a minute
Questions per request16
Options or levels per question26
Images8 per request and 8 shown in one question; PNG or JPEG, up to 16 MiB, 280 to 1568 pixels a side (details)
State read by the modelThe first 20,000 characters (longer states are cut, not refused)
Context window32,768 tokens on the hosted Myles-G 12B; 16,384 on the hosted Myles-G 31B
Hosted key1,200 requests a minute by default, or the workspace's own per-key limit; no daily cap (more on request)

Retrying

Retry 429, 502 and 503 with backoff (for example 1, 2, then 4 seconds), or after the Retry-After seconds when the answer carries them. Do not retry 400, 401, 411, 413, 415 or 422 without changing the request. Do not retry 402 or 403 at all: they persist until someone changes the account or workspace in the console.

Privacy

The endpoint does not store states, questions or answers. Its access log records only the method, the path, the status, the time taken and the request id.

Request id

Every response carries an X-Request-Id header (req_ and 32 hexadecimal digits). Quote it when you contact support about a call: it finds the call in our logs without anyone seeing what you sent.