Releases: marceloeatworld/replicate-php
Releases · marceloeatworld/replicate-php
v1.1.0
v1.0.0 - Full Replicate API coverage with Saloon v4
What's new
Complete rewrite of the Replicate PHP client. This package is a fork of benbjurstrom/replicate-php which only supported predictions. This version covers the entire Replicate HTTP API with 36 endpoints across 9 resources.
Highlights
- Saloon v4 with security patches (CVE-2026-33942, CVE-2026-33182, CVE-2026-33183)
- PHP 8.2+ required
- Bearer authentication (was Token prefix)
- 17 typed DTOs with readonly properties
- Compatible with Laravel 11, 12, 13
Full API coverage
| Resource | Methods |
|---|---|
| Predictions | list, get, create, cancel |
| Models | list, get, create, update, delete, createPrediction |
| Model Versions | getVersion, listVersions, deleteVersion |
| Deployments | list, get, create, update, delete, createPrediction |
| Trainings | list, get, create, cancel |
| Files | list, get, upload, delete |
| Collections | list, get |
| Hardware | list |
| Webhooks | getSecret |
| Account | get |
New features
- Synchronous predictions with
waitparameter (Prefer: wait=Nheader) - Streaming support via
streamparameter - Webhook parameters directly on create methods
- File uploads with multipart support
- Cursor-based pagination on all list endpoints
Bug fixes
- Fixed trailing newline in cancel endpoint URL (broke every cancel request)
- Fixed
PredictionsDatareadingmodelfrom wrong JSON level - Fixed missing null-coalescing on nullable fields in list responses
Breaking changes from the original package
- Namespace:
BenBjurstrom\Replicate→MarceloEatWorld\Replicate - Webhook:
->withWebhook()->create()chain removed, passwebhookparam directly tocreate() - Deployment predictions moved from
predictions()->createForDeployment()todeployments()->createPrediction() - Requires PHP 8.2+ (was 8.1)
- Requires Saloon v4 (was v3)
Installation
composer require marceloeatworld/replicate-phpuse MarceloEatWorld\Replicate\Replicate;
$replicate = new Replicate(apiToken: $_ENV['REPLICATE_API_TOKEN']);
$prediction = $replicate->predictions()->create(
version: 'stability-ai/sdxl:c221b2b8...',
input: ['prompt' => 'a photo of an astronaut riding a horse on mars'],
);