Laya AI

HOSTED MODEL · DEVELOPER API

Laya AI API for short text decisions

Ask a focused question about a message and get an answer your application can use. The Laya API returns a label, a yes probability, or an ordered score instead of chat prose.

Use the English or multilingual Laya model. Requests run on the same hosted service as the playground.

A LAYA API REQUEST
01 · TEXT“Checkout fails after I enter my card…”
02 · QUESTIONSWhich team? Is it urgent?
EXAMPLE ANSWERBilling · Yes

Illustration only. Run the request for live probabilities.

ONE REQUEST, TYPED ANSWERS

From Laya API call to application rule

Send model, state, and named questions to POST /api/v1/systemone. The response includes answer values, probabilities, the selected model, and token usage.

1

Choose a model

laya-english for English short text or laya-multilingual for multilingual input.

2

Define decisions

Use choice for a label, noul for a yes probability, or score for ordered levels.

3

Handle the result

Route a ticket or flag it for review using the structured answer. Inspect probabilities before automating a sensitive step.

FIRST CALL

Call the Laya AI API

Create a key below, keep it on your server, and send this request. The example uses the same support case as the homepage.

POST /api/v1/systemone
printf 'Paste your Laya AI API key (input hidden): '
read -rs LAYA_AI_API_KEY
printf '\n'
curl https://laya-ai.pro/api/v1/systemone \
  -H "Authorization: Bearer $LAYA_AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"laya-english","state":"Checkout fails after I enter my card. I need this order today.","questions":{"team":{"type":"choice","instructions":"Which team should handle this message?","criteria":{"billing":null,"engineering":null,"support":null}},"urgent":{"type":"noul","instructions":"Does the customer mention a time-sensitive need?"}}}'
unset LAYA_AI_API_KEY
Laya English512 total tokens per question
Laya Multilingual1024 total tokens per question

The per-question budget includes the text, instructions, and labels. Oversized input is rejected rather than silently shortened. Read the full API guide →

YOUR ACCOUNT

Your Laya AI API keys

Each key belongs to your Laya AI account. Store it on your server and revoke it here when you no longer need it.

New eligible accounts receive five welcome credits. API calls use purchased input tokens first, then one credit per successful request when tokens are insufficient. See plans and billing details →