typetext
{
"prompt": "dancing cat"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_AF0**********************************
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/animoji using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
prompt: "dancing cat"
};
const output = await replicate.run("andreasjansson/animoji", { 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_AF0**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/animoji using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/animoji",
input={
"prompt": "dancing cat"
}
)
# 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_AF0**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/animoji 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": {
"prompt": "dancing cat"
}
}' \
https://api.replicate.com/v1/models/andreasjansson/animoji/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "qecjm148znrmc0cs2pkb4nzt4g",
"model": "andreasjansson/animoji",
"version": "hidden",
"input": {
"prompt": "dancing cat"
},
"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(",
"output": "https://replicate.delivery/xezq/P342fIkte7qtGEfo6UWZteFUIiUmGTG6ITI5BO4aAPoNqdHVB/tmp3g8k37k2.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-09-04T16:54:19.645Z",
"started_at": "2025-09-04T16:54:22.205487Z",
"completed_at": "2025-09-04T16:56:03.763799Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/qecjm148znrmc0cs2pkb4nzt4g/cancel",
"children": "https://api.replicate.com/v1/predictions/qecjm148znrmc0cs2pkb4nzt4g/children",
"get": "https://api.replicate.com/v1/predictions/qecjm148znrmc0cs2pkb4nzt4g",
"root": "https://api.replicate.com/v1/predictions/qecjm148znrmc0cs2pkb4nzt4g",
"stream": "https://stream.replicate.com/v1/files/bcwr-2vufaok7zaw3j6yvj72myfpnhrzyigbvkczy57gtdigwk45oksrq",
"web": "https://replicate.com/p/qecjm148znrmc0cs2pkb4nzt4g"
},
"metrics": {
"predict_time": 101.558312149,
"total_time": 104.118799
}
}