KBAISE/ for lovable
Library
Docs

Connect your app to Replicate

about 10 minBuildingchecked 3d agoOfficial page
The short version

You can connect your Lovable app to Replicate to use many different open-source AI models for generating images, video, audio, and text. This is useful when your app needs a specific AI model not built into Lovable.

Anyone building an app that needs to use a specific open-source AI model for creative generation or transcription.

Do this, in order

  1. 1

    Sign in to Replicate and go to your API tokens page in Account settings.

    You need a special key (API token) from Replicate to allow Lovable to use its services.

  2. 2

    Create a new API token, give it a clear name like 'Lovable integration', and copy the token that starts with 'r8_'.

    This token is your app's unique password for Replicate, so keep it safe.

  3. 3

    In Lovable, go to 'Connectors', select 'Replicate', and click 'Add connection'.

    This starts the process of linking your Replicate account to your Lovable workspace.

  4. 4

    Give your connection a display name (e.g., 'Replicate Prod') and paste the Replicate API token you copied earlier into the 'API token' field.

    The display name helps you identify this specific connection later, and the API token authenticates your Lovable app with Replicate.

  5. 5

    Choose who can use this connection by either keeping it private, adding specific workspace members, or inviting your entire workspace.

    This controls who in your team can use this Replicate connection in their projects.

  6. 6

    Click 'Connect' to finish setting up the connection.

    Lovable will check if the token is valid and then save your connection, making Replicate available for your projects.

Paste this into your project

Use Replicate and build an app that turns text prompts into images with FLUX.

Words decoded

API token
A secret code, like a password, that allows one computer program (Lovable) to securely talk to another program (Replicate) and use its features.
Open-source AI models
Artificial intelligence programs whose underlying code is publicly available, allowing many people to use, modify, and improve them. Examples include models for generating images, video, or text.
Fine-tune
To take an existing AI model and train it further on a smaller, specific dataset to make it better at a particular task or style.

Where people get stuck

  • Sharing your Replicate API token publicly, as it acts like a password and could be misused.
  • Not having enough credit on your Replicate account, which will cause predictions to fail with an 'Insufficient credit' error.
  • Expecting generated files to stay at the Replicate URL; you must save them to your own storage as these URLs expire.
  • Assuming API tokens will rotate automatically; you need to manually create a new token in Replicate and update the Lovable connection.
  • Trying to use per-end-user Replicate logins; each Lovable connection uses a single Replicate account shared across all linked projects.

The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.