https://api.opentype.dev.
Every example sends a key from the OPENTYPE_API_KEY environment variable. Create one on the API keys page of the console.
Decision runs
Ask typed questions about a JSON state and get a probability for every answer, in one call to Neon 1.1.Decision runs
Every request field, the response, stages, costs, and the limits that shape a question set.
Yes/no questions (noul)
Read P(yes) and turn it into an action with thresholds you choose.
Choice questions
Pick one of 2 to 20 named options, with a probability for each.
Score questions
Rate on an ordered scale and read the expected level.
Conditional questions
Order questions with
depends_on and ask them only when ask_if holds.Verdict runs
The schema-validated JSON contract, and why Neon 1.1 does not serve it today.
Model Router
Pick the best model for a prompt from a benchmark catalog, with Neon 1.1 classifying the task.Model Router
Send a task, choose a policy and filters, and read the ranked shortlist.
Task types and policies
The 27 task types, their families, and the benchmarks each one is ranked on.
Reliable requests
Send runs that survive timeouts, retries and restarts without paying twice.Idempotency
The required
Idempotency-Key header, replays, and when to mint a new key.Error handling
Branch on
code, decide what to retry, and log the request_id.Polling
Recover a run you lost track of with
GET /v1/runs/{run_id}.Streaming
Observe a run’s stored state over server-sent events.
Pagination
Walk the run list with
limit and offset, and size usage ledger reads.Spend and billing
Pay for runs with prepaid credit and keep track of where it goes.Credits and billing
How credit is bought, held for a run, and drawn down.
Auto-recharge
Top up automatically when the balance falls below a threshold.
Handling insufficient credits
What a
402 insufficient_credits means and how to recover.Usage reporting
Totals, the per-call ledger, and one run’s cost.
Spend limits and quotas
The per-request ceiling and the period quotas that refuse with
429.Go to production
Prepare keys and code for real traffic.Key rotation
Rotate a key and roll the new secret out to your services.
Production checklist
What to check before real traffic reaches OpenType.
Code examples
Ready-to-adapt requests in curl, TypeScript and Python.
Related
- Quickstart - make a first decision run before you start on a guide.
- Decision questions - the concepts behind noul, choice and score questions.
- Errors - every error code the API returns and what it means.
- API reference - the full request and response contract for every route.