API reference

Every endpoint of the Laya Studio decision API, with request and response schemas. New here? Start with the quickstart. Below: the live OpenAPI spec, rendered by Scalar. Try requests in-page with your own API key, in curl, JS, Python, or Go. Source spec at /v1/openapi.

Base URL
https://api.laya.studio
Auth
Authorization: Bearer lsk_live_… (or x-api-key) on every call. Create keys in the dashboard under API keys; paste one into Scalar below for try-it-now requests.
Content type
application/json requests and responses. Max body 512 KB.
Metering
1 credit = 1 input token: a successful request is billed its usage.input_tokens(0 during a workspace’s 5 free runs), reported in the x-credits-charged header, with the free runs left in x-free-runs-remaining. Failed requests are free. See pricing.

The API at a glance

Four endpoints. Most integrations only ever call the first one.

  1. 1 · You send{ state, questions }text or JSON + up to 32 questions
  2. 2 · Laya decidesPOST /v1/systemoneone forward pass, no text generated
  3. 3 · You getanswers.<id>answer + probabilities + confidence
  • POST/v1/systemonestart here

    Answer typed questions about a state in one forward pass

    The main call. Send text plus questions, get an answer and probabilities for each. Jev-compatible.

  • POST/v1/systemone/batch

    Up to 64 decisions in one call

    Many independent texts at once, for backfills and bulk jobs.

  • GET/v1/models

    List served checkpoints

    Which models are live (English, multilingual, typed decisions). No key needed.

  • GET/v1/usage

    Credit balance and 30-day usage

    How many questions you have left and have used.