typefile
{
"image": "https://replicate.delivery/pbxt/NUpLg5V4oPfWI5Px6KduMqz8E7DK0AGxaGn0wMz4XYf4aOJ3/replicate-prediction-h1jdds1cbhrma0crg12s1cnm00.jpg",
"prompt": "Write a caption for this image"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_d35**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run lucataco/image-caption using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
image: "https://replicate.delivery/pbxt/NUpLg5V4oPfWI5Px6KduMqz8E7DK0AGxaGn0wMz4XYf4aOJ3/replicate-prediction-h1jdds1cbhrma0crg12s1cnm00.jpg",
prompt: "Write a caption for this image"
};
const output = await replicate.run("lucataco/image-caption", { input });
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_d35**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/image-caption using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/image-caption",
input={
"image": "https://replicate.delivery/pbxt/NUpLg5V4oPfWI5Px6KduMqz8E7DK0AGxaGn0wMz4XYf4aOJ3/replicate-prediction-h1jdds1cbhrma0crg12s1cnm00.jpg",
"prompt": "Write a caption for this image"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_d35**********************************
This is your API token. Keep it to yourself.
Run lucataco/image-caption using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"input": {
"image": "https://replicate.delivery/pbxt/NUpLg5V4oPfWI5Px6KduMqz8E7DK0AGxaGn0wMz4XYf4aOJ3/replicate-prediction-h1jdds1cbhrma0crg12s1cnm00.jpg",
"prompt": "Write a caption for this image"
}
}' \
https://api.replicate.com/v1/models/lucataco/image-caption/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Juicy grilled pork, sweet pineapple, red onion and fresh cilantro tucked into a charred tortilla — a perfect street-taco moment.
{
"id": "fvb36dsk9hrm80crgtwsq1hftw",
"model": "lucataco/image-caption",
"version": "hidden",
"input": {
"image": "https://replicate.delivery/pbxt/NUpLg5V4oPfWI5Px6KduMqz8E7DK0AGxaGn0wMz4XYf4aOJ3/replicate-prediction-h1jdds1cbhrma0crg12s1cnm00.jpg",
"prompt": "Write a caption for this image"
},
"logs": "",
"output": "Juicy grilled pork, sweet pineapple, red onion and fresh cilantro tucked into a charred tortilla — a perfect street-taco moment.",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-07T22:49:01.004Z",
"started_at": "2025-08-07T22:49:01.880026Z",
"completed_at": "2025-08-07T22:49:06.098817Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/fvb36dsk9hrm80crgtwsq1hftw/cancel",
"children": "https://api.replicate.com/v1/predictions/fvb36dsk9hrm80crgtwsq1hftw/children",
"get": "https://api.replicate.com/v1/predictions/fvb36dsk9hrm80crgtwsq1hftw",
"root": "https://api.replicate.com/v1/predictions/fvb36dsk9hrm80crgtwsq1hftw",
"web": "https://replicate.com/p/fvb36dsk9hrm80crgtwsq1hftw"
},
"metrics": {
"predict_time": 4.218791284,
"total_time": 5.094817
}
}