PHP SDK
Unofficial PHP 8.2+ client for TypeSafe's System One API with typed DTOs, Guzzle async promises, retries and PSR-3 logging.
Overview
typesafe-sdk-php is a community-maintained, unofficial PHP client for TypeSafe's System One API. It lets PHP applications ask Noul, Choice and Score questions about text or structured data and receive typed answers with probabilities, using typed DTOs and exceptions. Noul returns the probability of yes rather than a boolean, and Score returns an expected, possibly fractional, value on a zero-based rubric.
It supports synchronous calls and asynchronous requests via Guzzle promises, model discovery, configurable retries and timeouts, and PSR-3 logging. Raw question arrays can be passed to include additional API fields. It requires PHP 8.2+, cURL and JSON extensions and Composer 2, reads the key from the environment, and is MIT licensed with Russian documentation. Per the list summary, a Laravel package builds on it.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Is this about billing? | yes · no |
| Choice | Tone? | calm · angry |
| Score | Urgency? | low · medium · high |
How it works
- composer require the package and set TYPESAFE_API_KEY.
- Create a client and call systemOne with state and questions.
- Read typed choices, nouls and scores.
- Use the async client for concurrent requests.
Strengths
- Idiomatic typed PHP API.
- Async support via Guzzle.
- Retries, timeouts and logging built in.
Caveats
- Unofficial.
- Packagist release required for the simple install.
Getting started
composer require butochnikov/typesafe-sdk-php:^0.1 and export TYPESAFE_API_KEY.At a glance
- Type
- Library
- Status
- beta
- Language
- PHP
- Runtime
- library
- Has code
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Unofficial PHP client: typed DTOs, promises, and exceptions. Used by the Laravel package below.
AnotiaWang/awesome-decision-modelsA community TypeSafe SDK for PHP 8.2+, with synchronous calls and Guzzle-based async requests.
logicrw/awesome-jev-projects
Frequently asked questions
Does Noul return a boolean?
No, it returns the probability of yes.
Does it support async?
Yes, through Guzzle promises.
Is it official?
No, it is community-maintained.
Related projects
Ax, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.
PluginproductionTypeScriptEffect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.
ProjectproductionTypeScriptPHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.
ProjectproductionPHPElixir library for unified LLM calls across providers, with an evaluate interface that calls Jev via TypeSafe or OpenRouter.
ProjectproductionElixirSelf-hosted multi-tenant AI agent platform listed as including optional TypeSafe client tools for classification, scoring and yes/no.
LibraryproductionPythonProvider-agnostic TypeScript AI SDK; per list sources, an @tanstack/ai-typesafe adapter exposes Jev decisions through decide().
ServiceproductionTypeScript