> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lovable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect your app to Replicate

> Connect your app to Replicate to run thousands of open-source AI models for image, video, audio, and text generation from your Lovable app.

export const connector_0 = "Replicate"

[Replicate](https://replicate.com/) is a platform for running open-source AI models through a single API. The Replicate connector lets your Lovable app run thousands of models for image, video, audio, and text generation. It's designed for apps that need a specific or open-source model beyond Lovable's built-in AI, such as a particular FLUX fine-tune, a community video model, or a specific Whisper variant.

With Replicate, your app can:

* Generate images, video, and audio with thousands of open-source models
* Run popular models like FLUX, Stable Diffusion, and Whisper
* Stream long-running predictions or wait synchronously for fast models
* Train and fine-tune custom models on your own data

Replicate is a good fit when your app needs a specific model that isn't available through Lovable's built-in AI.

## Common use cases and example apps

| Example app                       | Example prompt                                                                          | Description                                                                                                                                         |
| :-------------------------------- | :-------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Text-to-image generators**      | *Use Replicate and build an app that turns text prompts into images with FLUX.*         | **Generate images from text prompts on demand.**<br />The app sends prompts to a Replicate image model and shows the results to the user.           |
| **Image-to-video tools**          | *Use Replicate and build a tool that animates a product photo into a short video clip.* | **Turn still images into short video clips.**<br />The app uploads a source image, runs an image-to-video model, and plays back the generated clip. |
| **Audio transcription apps**      | *Use Replicate and build an app that transcribes uploaded audio with Whisper.*          | **Transcribe spoken audio into text.**<br />The app sends recordings to a transcription model and returns the transcript in-app.                    |
| **Image editing tools**           | *Use Replicate and build a tool that removes backgrounds from uploaded product photos.* | **Edit and enhance images automatically.**<br />The app runs an image-processing model and returns the edited file to the user.                     |
| **Avatar and sticker generators** | *Use Replicate and build an app that creates custom avatar stickers from a selfie.*     | **Create personalized image content from user uploads.**<br />The app feeds a user photo to a generation model and produces styled results.         |
| **Custom model apps**             | *Use Replicate and build an app that runs our fine-tuned model on customer inputs.*     | **Serve your own fine-tuned models inside your app.**<br />The app calls a model you've trained on Replicate and shows the output to users.         |

## How to connect Replicate

Workspace **admins** and **owners** can connect Replicate.

You can create multiple Replicate connections using different API tokens, which is useful for separating environments (for example, development and production) or managing rate limits.

When the connection is created, Replicate becomes available across all projects in the workspace. Anyone building in a project can ask Lovable in chat to link their project to it.

### Prerequisites

Before connecting Replicate, make sure you have:

* A Replicate account
* A Replicate API token
* Lovable workspace owner or admin role

<Note>
  All predictions run through this connector are billed by Replicate based on the model and how long each run takes. Billing and quota are handled directly by Replicate, not Lovable.
</Note>

### Step 1: Get a Replicate API token

A Replicate API token lets your Lovable app authenticate with the Replicate API.

To create a Replicate API token:

<Steps>
  <Step title="Open your Replicate account">
    Sign in to [Replicate](https://replicate.com/).
  </Step>

  <Step title="Open API tokens">
    Go to **Account settings → [API tokens](https://replicate.com/account/api-tokens)**.
  </Step>

  <Step title="Create a token">
    Click **Create token** and give it a descriptive name, for example `Lovable integration`.
  </Step>

  <Step title="Copy the token">
    Copy the token (it starts with `r8_`) and store it securely.
  </Step>
</Steps>

<Warning>
  Your API token functions like a password. Keep it secure and never share it publicly. You'll need it in the next step.
</Warning>

See Replicate documentation for more: [API tokens and security](https://replicate.com/docs/topics/security/api-tokens).

### Step 2: Connect Replicate to Lovable

You can create multiple connections using different API tokens.

<Steps>
  <Step title="Open Replicate in Connectors">
    Go to **Connectors → App connectors** and select **Replicate**.
  </Step>

  <Step title="Add a connection">
    Click **Add connection**.
  </Step>

  <Step title="Configure the connection">
    1. **Display name**: name the connection, for example `Replicate Prod`. This name is only used inside Lovable to identify the connection.
    2. **API token**: paste your Replicate API token (it starts with `r8_`).
  </Step>

  <Step title="Choose who can access this connection">
    Under **Who can access this connection**, decide who in your workspace can use the connection:

    * **Only you** (default): only the person creating the connection can use it and its associated data.
    * **Invite specific people**: only you and explicitly added workspace members can use the connection and its associated data.
    * **Invite entire workspace**: click **Invite entire workspace** to make the connection available to everyone in your Lovable workspace.

    See [Who can manage connections](/integrations/introduction#who-can-manage-connections) for more information.
  </Step>

  <Step title="Connect">
    Click **Connect**.
  </Step>
</Steps>

When connected, anyone building in a project can ask Lovable in chat to link their project to Replicate (based on configured connection-level access). Your Lovable apps can then generate images, video, audio, and text using Replicate models.

## Limitations

The Replicate connector cannot:

* Run predictions from client-side code. Calls go through Lovable from a server-side endpoint.
* Refresh or rotate API tokens automatically. To rotate, create a new token in Replicate and update the Lovable connection.
* Support per-end-user Replicate login. Each connection represents a single Replicate account shared across all projects linked to it.

## How to unlink projects from a {connector_0} connection

Editors and above can remove specific projects from a connection without deleting the connection entirely. The connection will remain available for other projects.

To unlink projects:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to manage.
  </Step>

  <Step title="Select projects">
    Under **Linked projects**, check the projects you want to unlink.
  </Step>

  <Step title="Confirm">
    Click **Unlink projects** and confirm.
  </Step>
</Steps>

When unlinked, those projects will no longer have access to {connector_0} through this connection. If a project needs {connector_0} again, you can link it to any available connection.

## How to delete a {connector_0} connection

Workspace admins and owners can delete {connector_0} connections. Other members can delete a connection if they created it, or if they have been explicitly granted access to it.

<Warning>
  Deleting a connection is permanent and cannot be undone. It will remove the credentials from all linked projects, and any apps using this connection will stop working until a new connection is added.
</Warning>

Before deleting, review the **Linked projects** section to see which projects are currently using the connection.

To delete a connection:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to remove.
  </Step>

  <Step title="Review linked projects">
    Review the **Linked projects** section.
  </Step>

  <Step title="Delete">
    Under **Delete this connection**, click **Delete** and confirm.
  </Step>
</Steps>
