Skip to content

PHP SDK

Unofficial PHP 8.2+ client for TypeSafe's System One API with typed DTOs, Guzzle async promises, retries and PSR-3 logging.

LibrarybetaMIT

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

TypeQuestionAnswers
Yes / noIs this about billing?yes · no
ChoiceTone?calm · angry
ScoreUrgency?low · medium · high

How it works

  1. composer require the package and set TYPESAFE_API_KEY.
  2. Create a client and call systemOne with state and questions.
  3. Read typed choices, nouls and scores.
  4. 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

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.

    PluginproductionTypeScript
  • Effect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.

    ProjectproductionTypeScript
  • PHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.

    ProjectproductionPHP
  • Elixir library for unified LLM calls across providers, with an evaluate interface that calls Jev via TypeSafe or OpenRouter.

    ProjectproductionElixir
  • Self-hosted multi-tenant AI agent platform listed as including optional TypeSafe client tools for classification, scoring and yes/no.

    LibraryproductionPython
  • Provider-agnostic TypeScript AI SDK; per list sources, an @tanstack/ai-typesafe adapter exposes Jev decisions through decide().

    ServiceproductionTypeScript