Support triage from a ticket to a gate

Use this when a desk needs a queue, an urgency, and two yes or no flags, and does not need a drafted reply. The support-triage tool is that call with the questions already written. This page is the same call from a worker.

What the tool asks

The state is three strings: from, subject, and body. The sample ticket on the tool is a duplicate March charge, with a request to refund today and a threat to cancel. You can replace that text. Empty text returns 400 with code empty_state. The route also accepts a full state plus questions object if you want to override the template. If both styles are present, the explicit state and questions win.

Four questions are attached when you use the template. department is a choice among billing, technical, account, and other. The glosses are invoices and refunds, bugs and outages, login and profile, and everything else. urgency is a score on an ordered list: not urgent, soon, today, critical. churn_risk is a noul: does the user threaten to cancel or leave. refund_requested is a noul: does the user explicitly request a refund. One forward pass returns all four. The model does not write the customer email.

Read answers.department.choice for the queue and probabilities if you want the spread across labels. Read answers.urgency.score together with legend, which maps the index back to the words you sent. Read answers.churn_risk.noul and answers.refund_requested.noul as probabilities from 0 to 1, not as booleans the model has already thresholded. A value of 0.81 is not a policy. It is an input to a policy you write.

POST /v1/support/triage
curl https://laya-model.com/v1/support/triage \
  -H "Authorization: Bearer laya_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "user@acme.com",
    "subject": "Duplicate charge on invoice #4411",
    "body": "Hi, we were billed twice for March. Please refund the duplicate today or we will cancel our plan."
  }'

Auth and cost for this route

The application route is metered like POST /v1/decide. A laya_ key or a signed-in session draws the prepaid balance. Input tokens only, $0.0004 per 1,000, minimum one unit. Output is free. The first anonymous call can use the free run. After that the route returns 401. The request shape, the aliases, and the full status list are in the decide API guide. Packs, the monthly grant, and what the ledger stores are in the credits and keys guide.

The ledger row for this call stores the route /v1/support/triage, the input-token count, the cost, and the time. It does not store the ticket. Keep the ticket in your own system if you need to audit a label later. Do not send passwords, card numbers, or other secrets in body. The text is forwarded to the inference host even though this site does not put it in the ledger.

The hosted gateway does not auto-select a checkpoint from the language of the ticket. The default model is convaiinnovations/laya unless the deploy sets another id. Pass model as multilingual when you want that checkpoint. The local Router() documented on get started does choose from the script of the text. That behavior is in the package, not added by this HTTP route. Score questions on the multilingual checkpoint have a position bias. If the rubric is English and the ticket is short, pinning english avoids that bias. The note is on Chinese routing.

Turn the answers into allow, review, or block

POST /v1/gate does not call the model. You post the answers you already have, plus a policy, and it returns one decision: allow, review, or block, with a list of reasons. It does not spend tokens and it does not require a key. For a support desk, read those words as what your automation may do. Allow can mean auto-route. Review can mean leave the ticket for a person. Block can mean do not auto-apply the label. The gate does not close the ticket, send mail, or refund anyone. It only classifies the answers against the rules you sent.

The default floor is 0.55. If an answer includes a numeric confidence below policy.min_confidence, the decision becomes review. For a noul answer that omits confidence, the gate uses the larger of noul and one minus noul. It does not look at answer_confidence unless you copy that number into confidence yourself. Entropy confidence and max-class probability are different. The calibration guide says which field the README tells you to gate on, and why the act head is not a signal. Do not pass action.act_probability into this policy and expect it to mean anything. The gate ignores fields it does not know.

Noul rules are thresholds on the probability. review_above moves the decision to review when noul is at least that value. block_above moves it to block, and block outranks review. Choice rules can list labels under allow, review, and block. A label outside an allow list, when that list is non-empty, becomes review. The strictest reason wins, so a confident billing label can still be review if churn is over your threshold. That is the point of sending both questions.

POST /v1/gate
curl https://laya-model.com/v1/gate \
  -H "Content-Type: application/json" \
  -d '{
    "answers": {
      "department": { "type": "choice", "choice": "billing", "confidence": 0.72 },
      "churn_risk": { "type": "noul", "noul": 0.81 }
    },
    "policy": {
      "min_confidence": 0.55,
      "noul": { "churn_risk": { "review_above": 0.6 } }
    }
  }'

The sample above is a policy, not a measured result. The confidence and noul numbers are placeholders so the JSON is valid. A live decide response is what you should paste into answers. The offline demo on the playground fills the panel with a preview so the page is not empty. Do not tune a threshold on that preview and then assume live traffic matches it.

Neighboring tools, and when not to use triage

Email triage is the same idea for a mailbox: a folder choice, a reply-priority score, and a noul for whether a person should answer. The prompt guard is a choice of allow, review, or block on a prompt, plus nouls for instruction override and secret extraction. Content moderate and scam spotter are the trust tools. They share the balance and the key. They do not share questions. Copying the support-triage criteria onto a phishing email will label a department, not a phish. Use the tool whose questions match the decision. The catalog is on tools, and a shorter map is on use cases.

Stop adding labels when the choice list gets long. A head with a small budget cannot read a 77-way intent list as if it were four departments. The many labels guide is the upstream note on that failure, and the three workarounds: shortlist, widen the budget, or split the question. A support desk that needs billing versus technical does not need that machinery. A desk that needs every intent code in a taxonomy does.

Do not use this route when the product needs a sentence. Decide will not draft the refund email, the public review reply, or the explanation to the customer. It will tell you the queue, how urgent the rubric says the note is, and the probability of a cancel threat and of an explicit refund ask. A person or a chat model writes the words after that. If the gateway probe on status says the upstream is not configured, the tool page can still show an offline demo. That is not this HTTP call succeeding. Wait until configured is true, or run the Apache-2.0 package locally, before you treat a label as a model answer.

Support triage · Laya AI