# Replicate API

***

<figure><img src="/files/IWGoJbBf1xfBjP1jcHHK" alt=""><figcaption><p>Replicate</p></figcaption></figure>

## Replicate API Setup

Connect Replicate to generate AI images with Nano Banana Pro, Flux, and other models. Create stunning featured images for your articles, social posts, and carousels.

***

### What is Replicate?

Replicate hosts AI models you can run via API. Cuppa integrates with Replicate for AI image generation across:

* **Articles** — Featured images and inline images
* **Social posts** — Platform-optimized visuals
* **LinkedIn carousels** — Multi-slide lead magnets
* **Mood boards** — Brand visualization
* **Newsletters** — Header images

***

### Available Image Models

| Model                  | Quality     | Cost           | Best For                             |
| ---------------------- | ----------- | -------------- | ------------------------------------ |
| **Nano Banana Pro** 🍌 | **Premium** | \~$0.15/image  | **Recommended** — Best quality, fast |
| **Flux Pro 1.1 Ultra** | Excellent   | \~$0.06/image  | Hero images, marketing               |
| **Flux Pro 1.1**       | Excellent   | \~$0.055/image | Premium content                      |
| **Flux Pro**           | Very Good   | \~$0.05/image  | Featured images                      |
| **Flux**               | Good        | Free tier      | Testing, drafts                      |

#### Nano Banana Pro 🍌

Our **recommended model** for production use:

* **Best quality** — Photorealistic, detailed images
* **Fast generation** — 5-10 seconds per image
* **Resolution options** — 1K, 2K, or 4K output
* **Aspect ratios** — 16:9, 9:16, 1:1 supported
* **Default for social** — Automatically used for social posts and carousels

> **Tip**: Nano Banana Pro is the default for social automation, mood boards, and carousel generation.

***

### Plan Availability

| Feature                 | Hobby | Power | Business | Agency |
| ----------------------- | ----- | ----- | -------- | ------ |
| Single image generation | ✅     | ✅     | ✅        | ✅      |
| Bulk image generation   | ❌     | ✅     | ✅        | ✅      |
| Social post images      | ✅     | ✅     | ✅        | ✅      |
| LinkedIn carousels      | ❌     | ✅     | ✅        | ✅      |
| Mood board generation   | ✅     | ✅     | ✅        | ✅      |

***

### Step 1: Create a Replicate Account

1. Go to [replicate.com](https://replicate.com)
2. Click **Sign up**
3. Sign in with GitHub (recommended) or email

***

### Step 2: Get Your API Token

1. Go to [replicate.com/account/api-tokens](https://replicate.com/account/api-tokens)
2. Click **Create token**
3. Name it "Cuppa"
4. Copy the token

Your token looks like: `r8_xxxxxxxxxxxxxxxxxxxx`

***

### Step 3: Add Billing (Optional for Flux Free)

For Flux Pro models, add a payment method:

1. Go to [replicate.com/account/billing](https://replicate.com/account/billing)
2. Add a credit card
3. You're charged per image generated

> **Note**: Basic Flux is free tier. Flux Pro models require billing.

***

### Step 4: Add Token to Cuppa

1. Go to **Team Settings** → **API Keys**
2. Find the **Replicate** section
3. Paste your API token
4. Click **Save**

***

### Generating Images in Cuppa

#### During Article Generation

1. In generation settings, enable **"Include AI Images"**
2. Select your preferred model (Flux, Flux Pro, etc.)
3. Images are generated alongside your article

#### In the Editor

1. Open any article in the Cuppa Editor
2. Click **Generate Image** in the toolbar
3. Enter a prompt or use AI-suggested prompt
4. Select model and generate

#### For Featured Images

1. Open your article
2. Go to the **Featured Image** section
3. Click **Generate with AI**
4. Enter prompt and generate

***

### Writing Good Image Prompts

#### Basic Structure

```
[Subject] + [Style] + [Details] + [Quality modifiers]
```

#### Examples

**Blog featured image:**

```
Professional photograph of a modern office workspace with laptop and coffee, natural lighting, clean minimalist style, 4k quality
```

**Product image:**

```
Sleek wireless headphones floating on gradient background, product photography, studio lighting, commercial quality
```

**Lifestyle image:**

```
Young professional working from home on laptop, cozy apartment setting, warm natural light, editorial style photography
```

#### Tips

* Be specific about style (photograph, illustration, 3D render)
* Include lighting details (natural, studio, dramatic)
* Add quality modifiers (4k, professional, detailed)
* Mention the mood (warm, minimal, vibrant)

***

### Cost

Replicate charges per image:

| Model              | Cost per Image |
| ------------------ | -------------- |
| Flux (free tier)   | Free (limited) |
| Flux Pro           | \~$0.05        |
| Flux Pro 1.1       | \~$0.055       |
| Flux Pro 1.1 Ultra | \~$0.06        |

**Example**: 100 articles with Flux Pro images = \~$5

***

### Image in Bulk Generation

When bulk generating with images:

1. Enable images in bulk settings
2. Select your model
3. Each article gets a generated featured image
4. Images use AI-generated prompts based on article content

> **Note**: Bulk image generation is available on Power plans and higher.

***

### Troubleshooting

#### "Invalid API token"

* Verify you copied the full token
* Check token exists at [replicate.com/account/api-tokens](https://replicate.com/account/api-tokens)
* Create a new token if needed

#### "Model requires billing"

* Flux Pro models require a payment method
* Add billing at [replicate.com/account/billing](https://replicate.com/account/billing)
* Use free Flux tier if testing

#### "Generation failed"

* Check your Replicate account has credits
* Try a simpler prompt
* Retry — transient failures happen
* Check [replicate.com/status](https://replicate.com/status) for outages

#### "Image quality is poor"

* Use Flux Pro or higher for better quality
* Add quality modifiers to your prompt ("4k", "detailed", "professional")
* Be more specific in your prompt

***

### FAQ

**Do I need Replicate for images?**

No. You can also use:

* DALL-E (with OpenAI key)
* Midjourney (separate integration)
* Upload your own images

**Which image model is best?**

Flux Pro 1.1 offers the best balance of quality and cost. Ultra is for when quality is paramount.

**Can I use my own images instead?**

Absolutely! Upload images in the editor or set featured images manually.

**How many images can I generate per article?**

Currently, Cuppa generates one featured image per article. You can generate additional images in the editor.

**Are generated images licensed for commercial use?**

Yes. Images generated via Replicate are yours to use commercially.

***

### Related Docs

* OpenAI API Setup — DALL-E images with OpenAI
* Content Generation — Full generation guide
* Bulk Generation — Generate with images at scale


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.cuppa.ai/getting-started/replicate-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
