Search by

runapi-ai / typesafe

runapi

RunAPI TypeSafe Composer package for PHP applications

v0.3.0 2026-09-30 12:40 UTC

This package is auto-updated.

Last update: 2026-09-30 12:43:17 UTC


README

Packagist License

Use the TypeSafe PHP SDK to run structured decisions through RunAPI with a synchronous Composer client.

Install

composer require runapi-ai/typesafe

Quick start

<?php

require __DIR__ . "/vendor/autoload.php";

use RunApi\Typesafe\TypesafeClient;

$client = new TypesafeClient(); // reads RUNAPI_API_KEY
$result = $client->systemOne->run([
    'model' => 'jev-latest',
    'questions' => ['recommendation' => [
        'type' => 'choice',
        'instructions' => 'Choose the matching candidate.',
        'criteria' => ['Option A' => 'The candidate is Option A.', 'Option B' => 'The candidate is Option B.'],
    ]],
    'state' => ['candidate' => 'Option A'],
]);

echo json_encode($result->answers) . PHP_EOL;

Pass request parameters as associative arrays with snake_case keys. Keep RUNAPI_API_KEY in the environment or your secret manager.

Links

License

Licensed under the Apache License, Version 2.0.