Limits and rate limits

Every field limit the API enforces, why there is no rate limit yet, and how to handle 529.

decision-machine-1 enforces size limits on each request body. It does not enforce a rate limit today. The API is public and costs $0.04 per million input tokens and $0 per output token. See Pricing.

No API key is required during the launch period. Send content-type: application/json and a body.

Field limits

Every capability reads text or texts. The other fields depend on the capability.

FieldCapabilityLimit
textall seven1 to 20,000 characters
textsall seven1 to 32 items, each 1 to 20,000 characters
statementyes-nominimum 1 character
statementsyes-no1 to 32 items, each minimum 1 character
when_true, when_falseyes-nono length limit
labels (array form)classify2 to 64 items, each minimum 1 character
labels (object form)classifyname to description map, each name minimum 1 character, no item count limit
scalerate2 to 10 items, each minimum 1 character, ordered low to high
questionanswerminimum 1 character
questionsanswer1 to 32 items, each minimum 1 character
types (array form)entities1 to 64 items, each minimum 1 character
types (object form)entitiestype to description map, no item count limit
schemaextractobject with properties, no size limit
fieldverifyobject { name, description }, name minimum 1 character
valueverifystring or number, required

Send text or texts, never both. Six capabilities reject a request that carries both keys. yes-no is the exception: it accepts both and reads text.

A request that carries neither text nor texts also fails with the message body: provide text or texts, not both. The message names the wrong case. Read it as “provide exactly one of the two”.

What a breach returns

A limit breach returns 400 with the standard error envelope. The message names the field and the bound. These captures are real responses:

{"error":{"code":"invalid_request","message":"text: Too big: expected string to have <=20000 characters"}}
{"error":{"code":"invalid_request","message":"texts: Too big: expected array to have <=32 items"}}
{"error":{"code":"invalid_request","message":"labels: Too small: expected array to have >=2 items"}}
{"error":{"code":"invalid_request","message":"labels: Too big: expected array to have <=64 items"}}
{"error":{"code":"invalid_request","message":"scale: Too big: expected array to have <=10 items"}}

Validation reports up to three problems, joined with ; . Each one reads path: message. See Errors for every code.

No rate limit yet

The API applies no per-client quota, no burst limit and no daily cap during the launch period. This can change. Build the retry path now.

Every capability response carries the input size in headers:

HeaderMeaning
x-input-charsThe number of input characters. For texts, the sum over all items.
x-input-tokensThe input tokens billed for this call. This is the billing unit.

The OpenAI-compatible routes omit these headers. They report the same count inside usage.

529 is the backpressure signal

Inference runs on a fixed pool of slots. When every slot stays busy, the API returns 529:

{"error":{"code":"overloaded","message":"Every inference slot stayed busy. Retry with backoff."}}

Treat 529 as “retry later”, never as “the request was wrong”. The body is unchanged and correct. Retry with exponential backoff and jitter. The call goes through once a slot frees.

Retry 529 and 502. Never retry 400 or 404: the body must change first.

curl -s --retry 5 --retry-delay 1 --retry-all-errors \
https://api.milliseconds.ai/v1/decision-machine-1/yes-no \
-H 'content-type: application/json' \
-d '{
"text": "The customer asks for a refund before Friday.",
"statement": "This message is urgent"
}'

A Retry-After header is not documented. Pick your own backoff schedule.

Stay inside the limits

  • Split documents above 20,000 characters yourself. Send each part as one item of texts.
  • Keep a batch at 32 items or fewer. Chunk a longer queue into groups of 32 and send them in sequence.
  • Batch statements and questions instead of texts where you can. They cost one inference call, while each item of texts costs its own call.
  • Prefer the object form of labels and types when you need more than 64 entries. Descriptions also improve accuracy.
  • Log x-input-tokens on every call. It records the input tokens billed for that call.

Next