Replicate API Token Troubleshooting Guide

Important: The application requires a valid Replicate API token to function correctly.

Common Issues

1. Missing or Empty Token

If you see an error message about a missing token, make sure you've added your token to the .env file.

REPLICATE_API_TOKEN=r8_YourTokenHere

2. Invalid Token Format

Replicate API tokens must:

Correct format:

REPLICATE_API_TOKEN=r8_AbCdEfGhIjKlMnOpQrStUvWxYz

Incorrect formats:

REPLICATE_API_TOKEN="r8_AbCdEfGhIjKlMnOpQrStUvWxYz"  # Don't use quotes
REPLICATE_API_TOKEN= r8_AbCdEfGhIjKlMnOpQrStUvWxYz  # Don't include spaces
REPLICATE_API_TOKEN=AbCdEfGhIjKlMnOpQrStUvWxYz  # Must start with r8_

3. Expired or Invalid Token

If your token is correctly formatted but still doesn't work, it might be expired or invalid.

You can test your token using the included test script:

npm run test-token

If the test fails, generate a new token from your Replicate account.

How to Get a Valid Token

1. Create a Replicate Account

If you don't have one already, sign up at https://replicate.com/signin

2. Generate an API Token

Go to https://replicate.com/account/api-tokens

Click on "Create API token" and give it a name.

3. Copy the Token

Copy the generated token (it will start with r8_).

Important: This is the only time Replicate will show you the full token, so make sure to copy it immediately.

4. Add to Your .env File

Open the .env file in the project root and add your token:

REPLICATE_API_TOKEN=r8_YourNewTokenHere

5. Restart the Server

After updating the token, restart the server:

npm start

Testing Your Setup

You can verify your token is working correctly by running:

npm run test-token

If successful, you should see a message confirming your token is valid.

Back to Application