runapi-ai / typesafe
RunAPI TypeSafe Composer package for PHP applications
v0.3.0
2026-09-30 12:40 UTC
Requires
- php: >=8.2
- runapi-ai/core: ^0.9.0
Requires (Dev)
- phpunit/phpunit: ^11.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-30 12:43:17 UTC
README
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
- Model page: https://runapi.ai/models/jev
- SDK docs: https://runapi.ai/docs/resources/sdks
- Product docs: https://runapi.ai/docs/api/typesafe/system-one
- Pricing and rate limits: https://runapi.ai/models/jev/jev-latest
- Full catalog: https://runapi.ai/models
- GitHub repository: https://github.com/runapi-ai/typesafe-php
- Multi-language SDK repository: https://github.com/runapi-ai/typesafe-sdk
License
Licensed under the Apache License, Version 2.0.