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.
composer require aisdk/replicate| 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.
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.
- Contributing
- Support
- For private security reports, email security@phpaisdk.com.
MIT.