promptjuggler / sdk
PHP SDK for the PromptJuggler API
v1.0.3
2026-06-26 14:39 UTC
Requires
- php: ^8.2
- microsoft/kiota-bundle: ^2.0.2
Requires (Dev)
- motley/ecs-config: ^3.0.2
- phpstan/phpstan: ^2.2.2
- phpunit/phpunit: ^11.5
README
The official PHP client for the PromptJuggler API. Run prompts and workflows, manage knowledge bases, and verify webhooks — fully typed, with flat, synchronous methods.
Requirements
- PHP 8.2+
Installation
composer require promptjuggler/sdk
Usage
use PromptJuggler\Client\PromptJuggler; use PromptJuggler\Client\Models\RunStatus; $pj = new PromptJuggler('your-api-key'); // Trigger a run (async — returns the run ID) $created = $pj->runPrompt('greeting', 'production', inputs: ['name' => 'Ada']); // Poll for the result $run = $pj->getPromptRun($created->getId()); if ($run->getStatus()?->is(RunStatus::COMPLETED)) { echo $run->getOutput(); }
Errors surface as PromptJuggler\Client\Exception\ApiException (with a statusCode).
Verify incoming webhooks with PromptJuggler\Client\Webhook\WebhookSignature::isValid().
Documentation
Full guides and the API reference: https://docs.promptjuggler.com/sdks/php/overview
License
MIT