Laya AI online playground · Jev AI

Laya AI. Try your next workflow online.

Bring a support ticket, a sales enquiry or an agent task. Explore how structured decisions could handle the next step, starting with ready-made examples.

Sign in to run Laya API requests using your account credits.

Choice, score and yes/noReady-made examplesNo local installation
A support workflow in actionExample

An incoming ticket

“Our checkout stopped working after the update. Customers cannot pay and we need help now.”

choice

Where should this go?

Technical
score

What priority does it need?

Critical
noul

Does it need attention now?

Yes

Illustrative workflow. Run your own request below to see actual results.

Try it online

Choose an example. Make it your own.

Load a workflow, edit the input and adjust its questions. Generate decisions to inspect the answers, probabilities and request JSON.

Requests consume account credits. See the returned result for the actual credits used.

Read the Laya API integration guide

1. State

Provide the context shared by every question.

1/15

All questions share this context and are answered independently.

2. Questions

Define up to eight typed questions for the same state.

5 / 8

3. Run decision

Run the decision request.

Results

Click “Generate decisions” to see typed output with probabilities.

4. API request

Preview or copy the JSON shape to call the same endpoint from your app.

Results are returned in a structured format so you can connect them to your application logic.

01 / What you can do

Turn a real task into a small, testable decision

Start with a decision you already make: who handles a ticket, how urgent a request is, or whether an action needs review. The playground keeps the input, questions and result together.

Change one part of the example and compare the output. When the questions fit your task, inspect the request JSON as a starting point for your own integration.

Learn about the Laya model

Route work to the right place

List your teams, tools or next actions and ask which option best fits the input.

Set a useful priority

Describe an ordered scale, from routine work to an urgent case, and inspect the assessment.

Decide when to ask for review

Ask a focused yes/no question and examine its probability before choosing a threshold.

02 / Workflow ideas

Six practical ways to get started

Use these as experiments for your own process. The playground includes examples you can edit and run.

Support triage

Identify the department, assess urgency and flag customers who may need extra attention.

Lead qualification

Review an enquiry for buying intent, budget signals and the next follow-up action.

Content review

Test moderation questions and decide which submissions should go to a human reviewer.

Code and tool risk

Assess a proposed change or tool call before deciding whether it needs manual approval.

Agent and model routing

Compare available routes for a task and decide which tool or model should handle it.

Document assessment

Paste a document excerpt or structured data and ask focused questions about its contents.

03 / Your first run

Try a complete workflow in three steps

Load an example and try the Laya API in your browser. No local installation is needed.

01

Load an example

Choose a preset such as Support triage, Lead scoring or Model routing, then replace the text with your own sample.

02

Adjust the questions

Edit instructions, choice options or scoring criteria to match the decisions your workflow needs.

03

Run and inspect

Sign in, generate decisions and review the output. Use the JSON preview to understand the request you sent.

Start with an example

04 / Laya API

Laya API integration guide

Connect your application to the Laya decision endpoint. Authenticate with your account API key, submit context and typed questions, then use the structured answers in your workflow.

1. Create a key and connect

Sign in, open API Keys in your account settings and create a key. Keep enough credits in your account, then send a POST request to the URL below. The API path has no language prefix, even when this page is translated.

POSThttps://thejevai.com/laya/v1/systemone

Authorization: Bearer YOUR_API_KEY

Content-Type: application/json

Use your own application server to make API calls. Store the key in a server environment variable named LAYA_API_KEY; never put it in browser code or a public repository. The playground uses your signed-in session instead of asking for a key.

2. Choose a model and define the request

english

Model identifier for English-language decision workflows.

multilingual

Model identifier for workflows with multilingual inputs.

typed-decisions

Model identifier for typed decision workflows.

Set model to english, multilingual or typed-decisions. All three options accept choice, score and noul questions.

2. Choose a model and define the request
FieldTypeHow to use it
modelstringRequired. Use english, multilingual or typed-decisions.
statestring | object | arrayRequired. Shared context for all questions: text, a JSON object or an array.
questionsobjectRequired. An object containing 1–8 questions, keyed by your own question IDs.
questions.<id>objectUse a non-empty, unique ID for each question. The same ID appears in answers.
questions.<id>.typechoice | score | noulRequired. Select one of the three supported decision types.
questions.<id>.instructionsstringRequired string. State clearly what this question should evaluate.
questions.<id>.criteriaobject | arrayRequired for choice and score; optional for noul. Use the format described below.

choice

Provide 2–100 options as an object mapping labels to descriptions (string or null), or an array of labels. The answer contains the selected label and may include option probabilities.

score

Provide an array of 2–10 descriptions ordered from low to high. The scale begins at 0; returned scores can be fractional.

noul

Ask a yes/no question. Optional criteria uses the keys "true" and "false" with string or null descriptions. The returned noul value is the probability of yes, not a boolean.

3. Send your first request

Set LAYA_API_KEY to the key you created. This example evaluates one message with all three question types. Run JavaScript on Node.js 18+ (as an .mjs file), or use Python 3 with its built-in urllib module; no Python package installation is needed.

export LAYA_API_KEY="YOUR_API_KEY"

curl --fail-with-body --request POST 'https://thejevai.com/laya/v1/systemone' \
  --header "Authorization: Bearer $LAYA_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "english",
  "state": "I was charged twice for my subscription. Please refund the extra payment today.",
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "Which team should handle this request?",
      "criteria": {
        "billing": "Payments and refunds",
        "technical": "Bugs and outages"
      }
    },
    "priority": {
      "type": "score",
      "instructions": "How urgent is this request?",
      "criteria": [
        "Low",
        "Medium",
        "High"
      ]
    },
    "refund": {
      "type": "noul",
      "instructions": "Is the customer requesting a refund?",
      "criteria": {
        "true": "A refund is requested",
        "false": "No refund is requested"
      }
    }
  }
}'

4. Read answers, usage and credits

Check both the HTTP status and code === 0 before using the result. Success returns answers inside data.result; it does not return a chat completion or a streaming text response.

Illustrative response: decisions, token counts and latency vary with the request.

{
  "code": 0,
  "message": "ok",
  "data": {
    "result": {
      "model": "english",
      "answers": {
        "department": {
          "type": "choice",
          "choice": "billing",
          "probabilities": {
            "billing": 0.97,
            "technical": 0.03
          }
        },
        "priority": {
          "type": "score",
          "score": 1.8,
          "legend": {
            "0": "Low",
            "1": "Medium",
            "2": "High"
          }
        },
        "refund": {
          "type": "noul",
          "noul": 0.98
        }
      },
      "usage": {
        "input_tokens": 1200,
        "output_tokens": 0
      },
      "elapsedMs": 142
    },
    "creditsUsed": 2
  }
}
data.result.answers
Look up each result by the question ID you sent. Read choice, score or noul according to its type; additional probability fields may be present.
data.result.usage
input_tokens and output_tokens report measured token usage. See data.creditsUsed for the credits consumed.
data.result.elapsedMs
Time in milliseconds spent handling the request. This is an observation, not a latency guarantee.
data.creditsUsed
Credits deducted for this request. Use this field to show the actual charge in your application.

Use the request and response format documented here when integrating this endpoint. If you switch to another Laya service, check its authentication and response structure and update your client as needed.

5. Plan for usage limits and failures

Account credits

API calls and signed-in playground runs consume account credits. The response field creditsUsed shows the actual credits deducted for each request.

Request limits

Maximum UTF-8 JSON body: 32 KiB. Maximum questions per request: 8. Signed-in playground requests must be at least 3 seconds apart. The inference request has a 30-second timeout; allow additional time in your client for the full HTTP response.

400
Invalid JSON, model, state, question type or criteria. Correct the request before retrying.
401
Missing or invalid authentication. Check your Bearer API key or sign in to the playground.
402
Insufficient credits. Add credits and retry with enough balance for the request.
413
Request body exceeds 32 KiB. Shorten the context or split the request.
429
Requests are too close together. Respect the Retry-After header before retrying.
502
Inference failed, timed out or returned an invalid result. Check the error message and retry only when appropriate.
503
The service is unavailable. Try later or contact support.

Read the HTTP status and message on errors. This endpoint has no idempotency key: blindly retrying after a client timeout may create another charge if the first request completed. Confirm the outcome before retrying paid requests.

Test the request in the playground

Credits for the Laya playground

Use your existing account credit balance for Laya API requests.

Requests consume account credits. See the returned result for the actual credits used.

Starter

$10

Validate one real workflow, from the playground to your first API call

  • 100,000 credits, no expiry
  • 1 workspace
  • 3 concurrent requests
  • Standard speed
  • Choice, score, and noul questions
  • Typed decision output
  • Probability and confidence results
  • Online playground
  • API key management
  • Email support
Recommended

Pro

$100

Connect classification, routing, and safety decisions to a production product

  • 1,000,000 credits, no expiry
  • Unlimited workspaces
  • 10 concurrent requests
  • Fast lane
  • Choice, score, and noul questions
  • Typed decision output
  • Parallel questions per request
  • API access
  • Usage and request history
  • Priority support

Enterprise

$1,000

For multiple workspaces, team collaboration, and custom production integrations, with 10% extra credits

  • 11,000,000 credits (10% extra included)
  • Everything in Pro
  • Unlimited concurrency
  • Dedicated fast lane
  • Team workspaces and collaboration
  • Custom integration support
  • Security and permission guidance
  • Dedicated support
  • Priority production processing
  • Product roadmap feedback

Using the Laya AI playground

Start with a task you already know

Try an example, change the input and inspect the structured answers for your workflow.

Open the playground