typetext
{
"image_input": [
"https://replicate.delivery/pbxt/MvnA4wptE8FOHD44bKsfVj8hQdXSvdDAcFgYs5GEODou9OP9/4b2ebb2d-89d8-43de-bc84-51c380365a40.jpg"
],
"prompt": "What is happening in this image?",
"system_prompt": "You are a helpful assistant.",
"temperature": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_bis**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run openai/gpt-4.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
image_input: ["https://replicate.delivery/pbxt/MvnA4wptE8FOHD44bKsfVj8hQdXSvdDAcFgYs5GEODou9OP9/4b2ebb2d-89d8-43de-bc84-51c380365a40.jpg"],
prompt: "What is happening in this image?",
system_prompt: "You are a helpful assistant.",
temperature: 1
};
const output = await replicate.run("openai/gpt-4.1", { 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_bis**********************************
This is your API token. Keep it to yourself.
import replicate
Run openai/gpt-4.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"openai/gpt-4.1",
input={
"image_input": ["https://replicate.delivery/pbxt/MvnA4wptE8FOHD44bKsfVj8hQdXSvdDAcFgYs5GEODou9OP9/4b2ebb2d-89d8-43de-bc84-51c380365a40.jpg"],
"prompt": "What is happening in this image?",
"system_prompt": "You are a helpful assistant.",
"temperature": 1
}
)
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_bis**********************************
This is your API token. Keep it to yourself.
Run openai/gpt-4.1 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_input": ["https://replicate.delivery/pbxt/MvnA4wptE8FOHD44bKsfVj8hQdXSvdDAcFgYs5GEODou9OP9/4b2ebb2d-89d8-43de-bc84-51c380365a40.jpg"],
"prompt": "What is happening in this image?",
"system_prompt": "You are a helpful assistant.",
"temperature": 1
}
}' \
https://api.replicate.com/v1/models/openai/gpt-4.1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
In the image, someone is spreading butter on a slice of toast using a product labeled "BUTTER STICK TYPE." The product resembles a glue stick, but it is meant for butter, allowing the user to easily apply butter to toast by rubbing the stick directly onto the bread. This is a creative and convenient way to spread butter, especially while the toast is still warm and the butter softens and melts quickly.
{
"id": "n1gq5kjxwdrme0cph9natayvjw",
"model": "openai/gpt-4.1",
"version": "hidden",
"input": {
"image_input": [
"https://replicate.delivery/pbxt/MvnA4wptE8FOHD44bKsfVj8hQdXSvdDAcFgYs5GEODou9OP9/4b2ebb2d-89d8-43de-bc84-51c380365a40.jpg"
],
"prompt": "What is happening in this image?",
"system_prompt": "You are a helpful assistant.",
"temperature": 1
},
"logs": "Image size: 100.1KB\nGenerated response in 3.8sec\n/usr/local/lib/python3.12/site-packages/cog/server/scope.py:21: ExperimentalFeatureWarning: current_scope is an experimental internal function. It may change or be removed without warning.\n warnings.warn(",
"output": "In the image, someone is spreading butter on a slice of toast using a product labeled \"BUTTER STICK TYPE.\" The product resembles a glue stick, but it is meant for butter, allowing the user to easily apply butter to toast by rubbing the stick directly onto the bread. This is a creative and convenient way to spread butter, especially while the toast is still warm and the butter softens and melts quickly.",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-05-01T05:55:48.835Z",
"started_at": "2025-05-01T05:55:48.854715Z",
"completed_at": "2025-05-01T05:55:52.843346Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/n1gq5kjxwdrme0cph9natayvjw/cancel",
"get": "https://api.replicate.com/v1/predictions/n1gq5kjxwdrme0cph9natayvjw",
"web": "https://replicate.com/p/n1gq5kjxwdrme0cph9natayvjw"
},
"metrics": {
"input_token_count": 789,
"output_token_count": 84,
"predict_time": 3.98863048,
"time_to_first_token": 0.019745326,
"tokens_per_second": 21.060020246892865,
"total_time": 4.008346
}
}