# Connect Replicate

> Connect a Replicate API token, generate an illustration inside your app and check how images load and remain available after reopening.

Canonical: https://www.rnblocks.dev/docs/connectors/replicate
Updated: 2026-10-01

Add generated images to your app—for example, a new cover illustration for each story. Connect Replicate, test one generation and decide how the finished image should be kept.

## Before you start

- An app in Studio.
- A Replicate account with access and billing or credit available for the selected image model.

## Create an API token

Section: https://www.rnblocks.dev/docs/connectors/replicate#token

Open [Replicate API tokens](https://replicate.com/account/api-tokens) and create a token with a name you will recognize for this app. Copy the secret value privately. Replicate’s [token guide](https://replicate.com/docs/topics/security/api-tokens) explains creating and disabling tokens.


## Connect Replicate to this app

Section: https://www.rnblocks.dev/docs/connectors/replicate#connect

1. **Open the app in Studio** — Select **App options (+) → Connectors → Replicate**. A **Connect Replicate** request in the conversation opens the same setup. Connections belong to the app you have open.

2. **Save the credential privately** — Paste your credential into **API Token** and select **Save**. Keep it out of the conversation and app source. RNBlocks stores the credential for this app; the saved value is masked in this form.

3. **Return to your conversation** — Close the connection panel and continue the feature you requested. **Connected** means a credential is saved; the feature still needs a successful request and a test in your app.

### Figure: Connect Replicate, step by step

App options (+) opens Connectors. Choose Replicate, enter its API Token privately and select Save. The saved view masks the value and shows Connected.

1. **App options** — The actual App options menu above the + button. It contains separate Supabase, Connectors and App memory actions.

2. **Choose a service** — The Connectors catalogue contains OpenAI, Anthropic, Groq, ElevenLabs and Replicate cards with their own logos.

3. **Add your key** — Replicate connector detail with its original logo, use cases, documentation link, private API Token field and Save button. The field is empty.

4. **Saved connection** — Illustrative saved Replicate connection. Connected appears beside its name, the saved value is masked, and Update and Disconnect controls are available. No credential is shown.

1. Open App options (+) → Connectors in the app you want to connect.
2. Choose Replicate in the catalogue, then enter your API Token in its private form and select Save.
3. Return to the conversation and test the feature. Connected means a credential is saved, not that a provider request has succeeded.

The actual connection screens. Empty form and illustrative saved state; no credential is shown.


## Generate an illustration in the app

Section: https://www.rnblocks.dev/docs/connectors/replicate#test

Try: “Generate a cover illustration for each bedtime story using Replicate. Show the artwork above the story title, with a loading state and a retry option if generation fails.”

1. **Request one image** — In the iOS or Android preview, enter a short story idea and generate its cover. Confirm that the finished image matches your request and fits its frame.

2. **Check the waiting state** — Keep the app open while the request completes. The screen should communicate that work is in progress and should not start duplicate generations from repeated taps.

3. **Check storage separately** — If people should keep their covers, ask Studio to save the finished image durably, then reopen the app and check it. A temporary generation link is not permanent app storage.

> **Keep a copy when the app needs one**
> Replicate removes API prediction data and output files after an hour by default. Design a saving step for artwork your users need later. See [Replicate data retention](https://replicate.com/docs/topics/predictions/data-retention).


## If an image does not arrive

Section: https://www.rnblocks.dev/docs/connectors/replicate#recovery

Check whether the request is still running, failed or completed before generating again. Review the token, account billing and selected model’s required inputs. If an older image disappears, inspect how it was stored rather than replacing the token first.


## Costs and the information your app sends

Section: https://www.rnblocks.dev/docs/connectors/replicate#costs-and-data

Your connected provider handles its own API usage and billing. Those charges are separate from RNBlocks credits used while building your app. Review the provider’s quota and billing before testing with a large audience.

An AI feature sends the information needed for that request to its provider. Decide what your app should send, explain that clearly to your users, and test any permission and decline choices before release. Connecting a service does not automatically add a saved history, private file library or every feature in that provider’s API.

- [Understand credits and usage](https://www.rnblocks.dev/docs/credits-and-usage)

## Update or disconnect

Section: https://www.rnblocks.dev/docs/connectors/replicate#manage

Open **App options (+) → Connectors → Replicate**. To replace the saved credential, enter the new value and select **Update**, then test the feature again.

**Disconnect** removes this app’s saved Replicate credential. Features that use it will need a working connection again. It does not close your provider account, cancel provider billing, revoke the original key at the provider, or erase data already sent there. Reopen Connectors to check the saved connection state.


## Continue

- [Connector overview](https://www.rnblocks.dev/docs/connectors)
- [Write stories with Claude](https://www.rnblocks.dev/docs/connectors/anthropic)
- [Connect Supabase for saved data](https://www.rnblocks.dev/docs/connectors/supabase)

## Official references

- [Replicate API tokens](https://replicate.com/docs/topics/security/api-tokens)
- [Replicate data retention](https://replicate.com/docs/topics/predictions/data-retention)
