typearray
value typestring
{
"colors": [
"#F7CDE0",
"#D9E5C2",
"#F6E2AE",
"#F6E2AE"
],
"logo": "https://avatars.githubusercontent.com/u/60410876?s=400&u=dfcb763b56d1d743fae5396aad8c4826fd11dd02&v=4",
"messages": [
"We’re bringing AI to every software developer.",
"Run AI with an API",
"Replicate"
],
"prompts": [
"robot cat",
"robot bird",
"robot duck",
"robot monkey"
]
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_asy**********************************
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 andreasjansson/ad-carousel using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
colors: ["#F7CDE0","#D9E5C2","#F6E2AE","#F6E2AE"],
logo: "https://avatars.githubusercontent.com/u/60410876?s=400&u=dfcb763b56d1d743fae5396aad8c4826fd11dd02&v=4",
messages: ["We’re bringing AI to every software developer.","Run AI with an API","Replicate"],
prompts: ["robot cat","robot bird","robot duck","robot monkey"]
};
const output = await replicate.run("andreasjansson/ad-carousel", { 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_asy**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/ad-carousel using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/ad-carousel",
input={
"colors": ["#F7CDE0","#D9E5C2","#F6E2AE","#F6E2AE"],
"logo": "https://avatars.githubusercontent.com/u/60410876?s=400&u=dfcb763b56d1d743fae5396aad8c4826fd11dd02&v=4",
"messages": ["We’re bringing AI to every software developer.","Run AI with an API","Replicate"],
"prompts": ["robot cat","robot bird","robot duck","robot monkey"]
}
)
# 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_asy**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/ad-carousel 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": {
"colors": ["#F7CDE0","#D9E5C2","#F6E2AE","#F6E2AE"],
"logo": "https://avatars.githubusercontent.com/u/60410876?s=400&u=dfcb763b56d1d743fae5396aad8c4826fd11dd02&v=4",
"messages": ["We’re bringing AI to every software developer.","Run AI with an API","Replicate"],
"prompts": ["robot cat","robot bird","robot duck","robot monkey"]
}
}' \
https://api.replicate.com/v1/models/andreasjansson/ad-carousel/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "dkkq40fbp9rme0cs2rktsqxvfm",
"model": "andreasjansson/ad-carousel",
"version": "hidden",
"input": {
"colors": [
"#F7CDE0",
"#D9E5C2",
"#F6E2AE",
"#F6E2AE"
],
"logo": "https://avatars.githubusercontent.com/u/60410876?s=400&u=dfcb763b56d1d743fae5396aad8c4826fd11dd02&v=4",
"messages": [
"We’re bringing AI to every software developer.",
"Run AI with an API",
"Replicate"
],
"prompts": [
"robot cat",
"robot bird",
"robot duck",
"robot monkey"
]
},
"logs": "/app/.venv/lib/python3.13/site-packages/coglet/scope.py:36: ExperimentalFeatureWarning: current_scope is an experimental internal function. It may change or be removed without warning.\n warnings.warn(\nffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers\n built with gcc 13.2.1 (Alpine 13.2.1_git20240309) 20240309\n configuration: --pkg-config-flags=--static --extra-cflags=-fopenmp --extra-ldflags='-fopenmp -Wl,--allow-multiple-definition -Wl,-z,stack-size=2097152' --toolchain=hardened --disable-debug --disable-shared --disable-ffplay --enable-static --enable-gpl --enable-version3 --enable-fontconfig --enable-gray --enable-iconv --enable-lcms2 --enable-libaom --enable-libaribb24 --enable-libass --enable-libbluray --enable-libdav1d --enable-libdavs2 --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libjxl --enable-libkvazaar --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librabbitmq --enable-librav1e --enable-librsvg --enable-librtmp --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libvvenc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxevd --enable-libxeve --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-openssl\n libavutil 59. 39.100 / 59. 39.100\n libavcodec 61. 19.101 / 61. 19.101\n libavformat 61. 7.100 / 61. 7.100\n libavdevice 61. 3.100 / 61. 3.100\n libavfilter 10. 4.100 / 10. 4.100\n libswscale 8. 3.100 / 8. 3.100\n libswresample 5. 3.100 / 5. 3.100\n libpostproc 58. 3.100 / 58. 3.100\n[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7cf09d71ad80] Auto-inserting h264_mp4toannexb bitstream filter\nInput #0, concat, from '/tmp/filelist.txt':\n Duration: N/A, start: 0.000000, bitrate: 176 kb/s\n Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 768x768, 176 kb/s, 24 fps, 24 tbr, 12288 tbn\n Metadata:\n handler_name : VideoHandler\n vendor_id : [0][0][0][0]\nStream mapping:\n Stream #0:0 -> #0:0 (copy)\nOutput #0, mp4, to '/tmp/concatenated_video.mp4':\n Metadata:\n encoder : Lavf61.7.100\n Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 768x768, q=2-31, 176 kb/s, 24 fps, 24 tbr, 12288 tbn\n Metadata:\n handler_name : VideoHandler\n vendor_id : [0][0][0][0]\nPress [q] to stop, [?] for help\n[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7cf09d71ad80] Auto-inserting h264_mp4toannexb bitstream filter\n Last message repeated 2 times\n[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7cf09d704d80] Auto-inserting h264_mp4toannexb bitstream filter\n[out#0/mp4 @ 0x7cf09d7176c0] video:1829KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.459023%\nframe= 710 fps=0.0 q=-1.0 Lsize= 1838KiB time=00:00:29.50 bitrate= 510.4kbits/s speed= 668x",
"output": "https://replicate.delivery/xezq/gPPFoeSenQi1lUeqgraP0rdBEHtZGE5kQ69JPiXode0BfLPqC/concatenated_video.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-09-04T19:15:39.058Z",
"started_at": "2025-09-04T19:15:39.618391Z",
"completed_at": "2025-09-04T19:18:08.913588Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/dkkq40fbp9rme0cs2rktsqxvfm/cancel",
"children": "https://api.replicate.com/v1/predictions/dkkq40fbp9rme0cs2rktsqxvfm/children",
"get": "https://api.replicate.com/v1/predictions/dkkq40fbp9rme0cs2rktsqxvfm",
"root": "https://api.replicate.com/v1/predictions/dkkq40fbp9rme0cs2rktsqxvfm",
"stream": "https://stream.replicate.com/v1/files/bcwr-7n7g5xikbzpfy7sywivkfznobqueecycqjzwe6hydt4gtjmx22ra",
"web": "https://replicate.com/p/dkkq40fbp9rme0cs2rktsqxvfm"
},
"metrics": {
"predict_time": 149.295196707,
"total_time": 149.855588
}
}