Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aisdk/replicate

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.

About

Official Replicate provider for the PHP AI SDK.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages