{}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_2N1**********************************
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/heineken-commercial using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {};
const output = await replicate.run("andreasjansson/heineken-commercial", { 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_2N1**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/heineken-commercial using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run("andreasjansson/heineken-commercial")
# 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_2N1**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/heineken-commercial 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": {}
}' \
https://api.replicate.com/v1/models/andreasjansson/heineken-commercial/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "jrqsxw5n89rme0cs55vvegsqdc",
"model": "andreasjansson/heineken-commercial",
"version": "hidden",
"input": {},
"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 @ 0x73f465f6ed80] Auto-inserting h264_mp4toannexb bitstream filter\nInput #0, concat, from '/tmp/cog-runner-tmp-615757616/tmpxkit4sw2/concat.txt':\n Duration: N/A, start: 0.000000, bitrate: 5853 kb/s\n Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1080x1080, 5853 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/heineken_spec_ad.mp4':\n Metadata:\n encoder : Lavf61.7.100\n Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1080x1080, q=2-31, 5853 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 @ 0x73f465f57d80] Auto-inserting h264_mp4toannexb bitstream filter\n[mov,mp4,m4a,3gp,3g2,mj2 @ 0x73f465f6ed80] Auto-inserting h264_mp4toannexb bitstream filter\n Last message repeated 3 times\n[out#0/mp4 @ 0x73f465f6b6c0] video:24911KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.040903%\nframe= 852 fps=0.0 q=-1.0 Lsize= 24922KiB time=00:00:35.41 bitrate=5764.4kbits/s speed= 190x \nINFO:coglet:prediction completed: id=jrqsxw5n89rme0cs55vvegsqdc",
"output": "https://replicate.delivery/xezq/ARYKyICt1DZvIZXz2meZ5lVj16hejnkcdg40szGcXRb8mITVA/heineken_spec_ad.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-09-08T13:15:35.106Z",
"started_at": "2025-09-08T13:15:43.979848Z",
"completed_at": "2025-09-08T13:18:52.771674Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/jrqsxw5n89rme0cs55vvegsqdc/cancel",
"children": "https://api.replicate.com/v1/predictions/jrqsxw5n89rme0cs55vvegsqdc/children",
"get": "https://api.replicate.com/v1/predictions/jrqsxw5n89rme0cs55vvegsqdc",
"root": "https://api.replicate.com/v1/predictions/jrqsxw5n89rme0cs55vvegsqdc",
"stream": "https://stream.replicate.com/v1/files/bcwr-4u4iyt76qy2rbgjyjohs5r26nhmorh7ghocjp7hyngiqn5zdizgq",
"web": "https://replicate.com/p/jrqsxw5n89rme0cs55vvegsqdc"
},
"metrics": {
"predict_time": 188.791825462,
"total_time": 197.665674
}
}