Decision API quickstart
Laya Studio answers questions about text. You send the text (we call it the state) and a few typed questions; in about 120 ms (a warm request from Europe) you get back an answer to each one, with a probability for every option. It picks from your options instead of writing text, so it can't invent a label.
- choicePick one label“refund, tracking or other?”
- scoreRate on a scale“calm … very angry”
- noulYes or no“Is this urgent?”
Try it first, no code needed
Type a message, add up to four questions and press Run. The JSON and cURL preview updates as you type: that is exactly what your code will send later. The demo is free, needs no account and always runs in Switzerland.
2. Your questions (2/4)
- Question 1
Pick one label from a list.
- Question 2
Yes or no: is this statement true?
3. What gets sent
Press Run it free to see each answer with its probabilities.
The demo takes up to 600 characters, 4 questions and 8 options per question. The real API takes up to 32 questions and 64 options; see limits.
For developers: three steps
Happy with the answers? Here is the same thing from your own code.
1. Get a key
Create an account — every workspace starts with 5 free runs (after that, 1 credit = 1 input token). In the dashboard, open API keys and create one. It is shown once; store it as LAYA_API_KEY.
2. Make a call
Base URL https://api.laya.studio. Authenticate with Authorization: Bearer lsk_live_….
3. Read the answer
Every question id you sent comes back under answers. Use confidence to decide what to automate and what to send to a person.
| Field | Description |
|---|---|
answers.<id>.choicestring | choice questions: the most probable label. |
answers.<id>.scorenumber | score questions: expected level index, Σ i·p(i). |
answers.<id>.noulnumber | noul questions: probability that the statement is true. |
answers.<id>.probabilitiesobject | The full distribution over options (choice, score). |
answers.<id>.confidencenumber | choice/score: 1 − H(p)/log k. noul: max(p, 1 − p). Gate automation on this. |
answers.<id>.action.act_probabilitynumber | Output of the act/escalate head. The model card reports it carries little signal today — prefer confidence. |
usage.input_tokensinteger | Tokens encoded across all questions. output_tokens is always 0. |
routingobject | Which checkpoint answered and why (english / multilingual / typed-decisions). |
Next
Learn how to write good questions, handle errors and retries, or switch from Jev. Handling sensitive data? Read Swiss data residency. Everything is in the API reference.