Skip to main content
Read through this guide to set up Replicate & get familiar with how it is used across the different apps.

Set up Replicate

First, create a Replicate account or sign in. Next, navigate to the API key page and “Create token”. Make sure to save this somewhere safe and do not share it with anyone. Once you have your API key, paste it in your .env file:
REPLICATE_API_TOKEN=your_replicate_api_key

Apps Using Replicate

Replicate is primarily used for async media generation tasks including video generation and image generation.

Features

  • Async generation — Video and image generation tasks are submitted to Replicate and processed asynchronously with progress tracking.
  • Video Studio — Generate AI videos using state-of-the-art models available on Replicate.
  • Image Studio — Access image generation models like Flux through the Replicate API.
  • Uploads generated media to cloud storage.
  • Stores generation data in the ‘generations’ table in Supabase.
  • Reduces user’s credits (configurable in toolConfig.ts) per generation.

Structure

Replicate is used for async media generation workflows. Unlike the chat-based providers that use the Vercel AI SDK model registry, Replicate handles long-running generation tasks with progress tracking. The typical flow for a generation request:
  1. The user submits a prompt and configuration from the front-end
  2. The request is sent to Replicate to start async generation
  3. Progress is tracked and reported back to the user
  4. Once complete, the generated media (video or image) is retrieved
  5. The media is uploaded to cloud storage
  6. Results are stored in Supabase
More information on structure of the codebase can be found here:

Structure

Understand the project structure of the codebase