Start here

Quickstart

Send one curl call to decision-machine-1 and read a typed decision back in about a second.

decision-machine-1 runs at https://api.milliseconds.ai. Every capability is a single POST with a JSON body.

No API key is required during the launch period. The API is public. It costs $0.04 per million input tokens and $0 per output token. See Pricing. Send no Authorization header.

Make your first call

1

Pick a capability

Start with Classify. It takes text and labels, and returns one label with a probability.

2

Send the request

Copy this call into a terminal. It classifies a support message into three labels.

curl
curl -X POST https://api.milliseconds.ai/v1/decision-machine-1/classify \
-H "Content-Type: application/json" \
-d '{
"text": "I was charged twice for my subscription this month and support has not replied.",
"labels": {
"billing": "payments, invoices, charges or refunds",
"shipping": "delivery, tracking or returns",
"account": "login, password or profile settings"
}
}'
3

Read the decision

The call returns in about a second:

Response
{
"label": "billing",
"probability": 0.999,
"confidence": 0.995,
"scores": { "billing": 0.999, "shipping": 0, "account": 0.001 }
}

No parsing, no prompt, no retry loop. The shape is fixed.

What each field means

FieldMeaning
labelThe winning label name. Never the description.
probabilityThe winner’s normalized share of the scores.
confidence1 − normalized entropy. 1 means one clear winner, 0 means a flat distribution.
scoresOne normalized probability per label name. The values sum to 1.

Two headers come back on every capability response: x-input-chars (79 here), the number of input characters, and x-input-tokens (20 here), the input tokens billed for this call.

Label descriptions improve accuracy. The model reads the label text, so "billing": "payments, invoices, charges or refunds" scores better than a bare billing. Read more in writing good statements and labels.

The same call from your code

No SDK exists. Use your language’s HTTP client.

import requests
response = requests.post(
"https://api.milliseconds.ai/v1/decision-machine-1/classify",
json={
"text": "I was charged twice for my subscription this month and support has not replied.",
"labels": {
"billing": "payments, invoices, charges or refunds",
"shipping": "delivery, tracking or returns",
"account": "login, password or profile settings",
},
},
timeout=30,
)
response.raise_for_status()
result = response.json()
print(result["label"], result["probability"]) # billing 0.999
if result["confidence"] < 0.5:
print("Low confidence. Send this ticket to a person.")

Ask several questions at once

Every capability accepts texts for a batch of inputs. yes-no also accepts statements, and answer accepts questions. Statements share one model call, so they cost almost nothing extra.

curl
curl -X POST https://api.milliseconds.ai/v1/decision-machine-1/yes-no \
-H "Content-Type: application/json" \
-d '{
"text": "I need this fixed today, my launch is tomorrow.",
"statements": [
"The customer expresses urgency.",
"The customer is asking about shipping."
]
}'
Response
{
"results": [
{ "statement": "The customer expresses urgency.", "answer": true, "probability": 1 },
{ "statement": "The customer is asking about shipping.", "answer": false, "probability": 0 }
]
}

Results come back in input order. The limits are 32 texts, 32 statements and 32 questions per call. Batching covers the ordering rules and the fan-out.

When a call fails

Every capability returns errors in one envelope:

Error
{ "error": { "code": "invalid_request", "message": "labels: Too small: expected array to have >=2 items" } }

Two codes need a retry, not a code change. runner_error (502) means inference failed twice. overloaded (529) means every inference slot stayed busy. Retry both with backoff. Errors lists every code.

Next