Skip to main content
The Playground is the console page where you try a decision run by hand, before you write any code. You paste a state, write a few typed questions, press Run, and read every answer with the probabilities behind it and what the read cost. Use it to shape your questions and labels, then copy the exact request into your own code. Open it at console.opentype.dev/playground. It is also where the console opens after sign-in.
A Playground read is a real run. It goes to POST /v1/runs on https://api.opentype.dev as you, is answered by Neon 1.1, is charged to your organization’s balance, and appears on Usage. It needs the runs_write scope, which owners, admins and members hold.
Decision run answering a noul, a choice and a score question about a support ticket, with one gated question skipped

A decision read on a support ticket. The gated, skipped question is built in code, not in the Playground; see Conditional questions.

The page at a glance

The header reads Playground, with a status line under it: POST /v1/runs · kind decision · followed by one of these. Three buttons sit on the right:
  • Clear empties both editors and resets the answer panel.
  • Share copies a link that reopens the Playground with your state and questions. It reads Link copied for a moment.
  • Run sends the read. Press ⌘+Enter (or Ctrl+Enter) from anywhere on the page. Run is disabled while the editors have issues and while a read is in flight; it reads Reading then.
The left column holds State, Questions and Request as sent. The right column holds Decision, This read once a read has answered, and Example requests.

Write the state

State is the thing you want read: a support ticket, an email, a contract clause, a row of data.
  • Text is sent as is, as a JSON string.
  • Text that parses as a JSON object, such as {"ticket": "…", "plan": "pro"}, is sent as an object. Format appears and pretty-prints it.
  • The panel’s meta shows what will be sent and its size: text · 212 / 32,768 B, or json · 3 keys · 140 / 32,768 B.
The console refuses a state over 32,768 bytes before it sends anything. A state that fits that limit can still be too long for the model; the API then refuses it with 413 input_too_large. See input_too_large.

Write the questions

Questions holds up to 64 questions, and its meta counts them: 4 / 64 · ready, or 4 / 64 · 2 issues. Add one with the three buttons at the top of the panel. Each new question arrives filled with a starter you then edit: is_true for noul, pick for choice, rate for score. A second question of the same type gets _2, then _3, appended to its id. Each question row has four parts:
  • Id: the key the answer comes back under.
  • Type: noul, choice or score. You can change it in place.
  • The question, in one line: the instruction the model reads.
  • Labels: for a noul, the fixed text yes · no — returns P(yes). For a choice, the options as a comma-separated list (option, option, …). For a score, the levels in order from lowest to highest (lowest, …, highest).
Remove a question with × at the end of its row.

Limits the editor checks

The Playground checks everything below as you type, lists up to six issues under the questions as field — reason, and keeps Run disabled until they are fixed. Options and levels are separated by commas, so a label cannot contain a comma. Short, plain, single-word labels such as billing or furious work best: a question whose labels the model cannot answer with comes back as 503 decision_unavailable. Some of these limits are the Playground’s own. The API accepts longer ids and instructions, and more levels on a score question; see Decision questions for the API’s rules.

What the Playground does not build

The Playground sends only a state and questions. For these, write the request in code:
  • depends_on and ask_if, to ask a question only when another answer calls for it. See Conditional questions.
  • A shared instructions field for the whole run, draws, think_tokens, question_order and deadline_ms. See Decision runs.
  • Verdict runs against a JSON schema. See Verdict runs.

Load an example

Example requests (meta load into the editors) holds five ready-made reads. Choose one to replace both editors with it and reset the answer panel. The first one is loaded when the page opens. Each tag shows the question count and types, for example 4Q · noul choice score.

Run and read the answers

Press Run. While the read is in flight, Decision shows Reading 4 questions in one pass and an elapsed mm:ss counter. Nothing partial is shown: the answer arrives whole, or not at all. A read that takes longer than 30 seconds is stopped with 504 deadline_exceeded. Each Run sends a new request with a fresh idempotency key, so pressing it twice runs, and charges, two reads. When the read answers, Decision shows Neon 1.1 in its header and one card per question, in the order you wrote them. Scores count from 0: on the legend calm, annoyed, furious, calm is 0 and furious is 2, and a score of 1.34 sits between annoyed and furious, nearer annoyed.

This read

Under the answers, This read (meta measured, not published) describes the run.

Copy the request, or share it

Request as sent shows the exact HTTP request the Playground builds from your editors, with placeholders for the credential and idempotency key:
Choice options go out as an object of option name to description, with no descriptions (null). Score levels go out as an ordered list. Copy as cURL copies the same request as a curl command that reads your key from $OPENTYPE_API_KEY and makes a fresh idempotency key with uuidgen. Create a key on API keys first; the Playground itself runs with your console session and needs no key. Share copies a link of the form https://console.opentype.dev/playground#share=…. Opening it loads the same state and questions into the editors of whoever opens it; it does not carry the answer, and it does not run anything. The state travels inside the link, encoded but not encrypted, so share it only with people who may read that text.

Send the same read from code

This is the read above, sent with an API key that holds runs_write.
A completed read answers 200 with the whole answer set. The figures below are illustrative:
Money in the API is integer micro-USD: cost_micros: 9 is $0.000009. See Runs for every field.

When a read is refused

A refusal replaces the answers with a dark panel: a heading, the HTTP status, the error code, its message, and the raw error body. If your console session has ended, Run takes you to Sign in with Your session expired instead of showing a refusal. Sign in again and rerun. Every refusal from the API carries a request_id. Quote it, with the run_id if there is one, when you report a problem. See Errors.
  • Decision runs - everything a decision request can carry, beyond what the Playground builds.
  • Decision questions - noul, choice and score, their answers, and the API’s limits.
  • API keys - create the key that Copy as cURL expects in $OPENTYPE_API_KEY.
  • Usage - find each Playground read, its tokens and its cost.
  • Models and pricing - what Neon 1.1 costs per token, and how a read’s cost is computed.