All provider guides

Set up Replicate

PHP

Researched from Replicate's official documentation on 2026-11-02. Not yet walked through end to end.

Open your Replicate console (sign-in required)

  1. Current: Review your account and billing

    Create a Replicate account or sign in, then review the account’s billing and payment settings.

  2. Not started: Create an application token

    Open API tokens. Create a separate, descriptively named token for your application rather than sharing one across environments.

  3. Not started: Check the image model price

    Store the token only in your local environment. Choose the single-image example only after checking the model’s current price.

  4. Not started: Configure your .env

    Use the environment names below in your own application. Keep its environment file out of source control. Never paste a key into this website.

  5. Not started: Run the local check

    Choose a model you can use and run the matching example below on your own machine. Check any applicable usage charges first.

This provider is available in PHP Prism. The TypeScript and Python ports do not implement it.

Configure and verify locally

Environment names and defaults below come from the installed package. Choose a model you can use by setting PRISM_SETUP_MODEL on your machine. Run the verification only when you are ready for one billed request. No request is sent by this page.

Approximate text cost is input tokens × your model’s input rate, plus at most 32 output tokens × its output rate, divided by the rate’s token unit. Add any provider fees. Check your model and region’s current price; the token limit is not a money cap.

php environment names
# Set REPLICATE_API_KEY privately if required for your configuration.
# url (default)
# REPLICATE_URL=https://api.replicate.com/v1
# Set REPLICATE_WEBHOOK_URL privately if required for your configuration.
# use_sync_mode (default)
# REPLICATE_USE_SYNC_MODE=true
# polling_interval (default)
# REPLICATE_POLLING_INTERVAL=1000
# max_wait_time (default)
# REPLICATE_MAX_WAIT_TIME=60
php local verification
use Prism\Prism\Facades\Prism;

// One billed image; approximately US$0.003, subject to current model pricing.
$result = Prism::image()
    ->using('replicate', 'black-forest-labs/flux-schnell')
    ->withPrompt('A small blue circle on a white background')
    ->withProviderOptions(['num_outputs' => 1, 'aspect_ratio' => '1:1'])
    ->generate();

echo count($result->images), PHP_EOL;

Official sources