aisdk/replicate

Official Replicate provider for the PHP AI SDK.

Maintainers

Package info

github.com/phpaisdk/replicate

pkg:composer/aisdk/replicate

Transparency log

Fund package maintenance!

Open Collective

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.8.0 2026-07-15 12:28 UTC

This package is auto-updated.

Last update: 2026-07-17 02:24:58 UTC


README

GitHub Workflow Status Total Downloads Latest Version License Why PHP in 2026

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

License

MIT.