aisdk / replicate
Official Replicate provider for the PHP AI SDK.
Fund package maintenance!
v0.8.0
2026-07-15 12:28 UTC
Requires
- php: ^8.3
- aisdk/core: ^0.8.0
Requires (Dev)
- laravel/pint: ^1.18
- nyholm/psr7: ^1.8
- pestphp/pest: ^3.0 || ^4.0
- phpstan/phpstan: ^2.0
- rector/rector: ^2.0
README
The Replicate provider package for the PHP AI SDK supports image and video generation via the /v1/predictions API (prefer: wait + polling), consistent with @ai-sdk/replicate.
Installation
composer require aisdk/replicate
Configuration
| Variable | Purpose |
|---|---|
REPLICATE_API_TOKEN |
API token (required). |
REPLICATE_BASE_URL |
Defaults to https://api.replicate.com/v1. |
Model IDs use either owner/name or version-hash:version forms as in the upstream SDK.
Usage
use AiSdk\Generate; use AiSdk\Replicate; Generate::configure(Generate::factory()->make()); $result = Generate::image() ->model(Replicate::image('black-forest-labs/flux-schnell')) ->prompt('A red balloon') ->run();
Video jobs resolve to a VideoJob with a result URL in VideoData. Provider options under replicate support maxWaitTimeInSeconds, pollIntervalMs, and pollTimeoutMs, plus model-specific input fields.
Documentation
Community
- Contributing
- Support
- For private security reports, email security@phpaisdk.com.
License
MIT.