typetext
{
"text": "a cat"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_6D8**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run mattrothenberg/hello-world using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"mattrothenberg/hello-world:adcd95ef40538bfcb461cfbcd0686915443f3b3585cbd5919ec3ecf42664076b",
{
input: {
text: "a cat"
}
}
);
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_6D8**********************************
This is your API token. Keep it to yourself.
import replicate
Run mattrothenberg/hello-world using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"mattrothenberg/hello-world:adcd95ef40538bfcb461cfbcd0686915443f3b3585cbd5919ec3ecf42664076b",
input={
"text": "a cat"
}
)
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_6D8**********************************
This is your API token. Keep it to yourself.
Run mattrothenberg/hello-world 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 $'{
"version": "mattrothenberg/hello-world:adcd95ef40538bfcb461cfbcd0686915443f3b3585cbd5919ec3ecf42664076b",
"input": {
"text": "a cat"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
hello a cat
{
"id": "pk08zv4175rm80cpcn4afpjga0",
"model": "mattrothenberg/hello-world",
"version": "adcd95ef40538bfcb461cfbcd0686915443f3b3585cbd5919ec3ecf42664076b",
"input": {
"text": "a cat"
},
"logs": "",
"output": "hello a cat",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-04-24T00:52:52.665Z",
"started_at": "2025-04-24T00:52:58.111775Z",
"completed_at": "2025-04-24T00:52:58.111793Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/pk08zv4175rm80cpcn4afpjga0/cancel",
"get": "https://api.replicate.com/v1/predictions/pk08zv4175rm80cpcn4afpjga0",
"web": "https://replicate.com/p/pk08zv4175rm80cpcn4afpjga0"
},
"metrics": {
"predict_time": 0.00001792,
"total_time": 5.446793
}
}