typetext
{
"aspect_ratio": "3:4",
"prompt": "A minimalist poster for a jazz festival. Bold text reads 'BLUE NOTE SESSIONS' at the top. A saxophone player silhouetted against a deep indigo gradient, with warm amber stage lighting cutting through fog. Clean typography, editorial design."
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_ZOg**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run recraft-ai/recraft-v4 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "3:4",
prompt: "A minimalist poster for a jazz festival. Bold text reads 'BLUE NOTE SESSIONS' at the top. A saxophone player silhouetted against a deep indigo gradient, with warm amber stage lighting cutting through fog. Clean typography, editorial design."
};
const output = await replicate.run("recraft-ai/recraft-v4", { input });
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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_ZOg**********************************
This is your API token. Keep it to yourself.
import replicate
Run recraft-ai/recraft-v4 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"recraft-ai/recraft-v4",
input={
"aspect_ratio": "3:4",
"prompt": "A minimalist poster for a jazz festival. Bold text reads 'BLUE NOTE SESSIONS' at the top. A saxophone player silhouetted against a deep indigo gradient, with warm amber stage lighting cutting through fog. Clean typography, editorial design."
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_ZOg**********************************
This is your API token. Keep it to yourself.
Run recraft-ai/recraft-v4 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": {
"aspect_ratio": "3:4",
"prompt": "A minimalist poster for a jazz festival. Bold text reads \'BLUE NOTE SESSIONS\' at the top. A saxophone player silhouetted against a deep indigo gradient, with warm amber stage lighting cutting through fog. Clean typography, editorial design."
}
}' \
https://api.replicate.com/v1/models/recraft-ai/recraft-v4/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "dcvzdj9h1hrmt0cwe6vshkp9ac",
"model": "recraft-ai/recraft-v4",
"version": "hidden",
"input": {
"aspect_ratio": "3:4",
"prompt": "A minimalist poster for a jazz festival. Bold text reads 'BLUE NOTE SESSIONS' at the top. A saxophone player silhouetted against a deep indigo gradient, with warm amber stage lighting cutting through fog. Clean typography, editorial design."
},
"logs": "Moderating content...\nWarning: Moderation check failed\nStarting image generation...\nGenerated image in 13.29sec\nDownloading 1234028 bytes\nDownloaded 1.18MB in 0.11sec",
"output": "https://replicate.delivery/xezq/gm76rP1QNZ74LJxIeU3ZDwwLdXX6b4VtMKpK9CnzUObBHdELA/tmplh_pvyqn.webp",
"data_removed": false,
"error": null,
"source": "api",
"status": "succeeded",
"created_at": "2026-02-18T17:05:57.004Z",
"started_at": "2026-02-18T17:05:57.153022Z",
"completed_at": "2026-02-18T17:06:11.177555Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/dcvzdj9h1hrmt0cwe6vshkp9ac/cancel",
"get": "https://api.replicate.com/v1/predictions/dcvzdj9h1hrmt0cwe6vshkp9ac",
"stream": "https://stream.replicate.com/v1/files/jbxs-uucud25p443st7n6q3aj6u65welpb34oxmjl2bnsldvbne44mhrq",
"web": "https://replicate.com/p/dcvzdj9h1hrmt0cwe6vshkp9ac"
},
"metrics": {
"predict_time": 14.024532716,
"total_time": 14.173555521
}
}