typetext
{
"name": "Wei"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_HVi**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run wei903979/hello-world using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"wei903979/hello-world:0d1cf6cfb407526bc6ac40d7390848cda00ffe309342d852f542f49e66d35ce6",
{
input: {
name: "Wei"
}
}
);
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_HVi**********************************
This is your API token. Keep it to yourself.
import replicate
Run wei903979/hello-world using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"wei903979/hello-world:0d1cf6cfb407526bc6ac40d7390848cda00ffe309342d852f542f49e66d35ce6",
input={
"name": "Wei"
}
)
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_HVi**********************************
This is your API token. Keep it to yourself.
Run wei903979/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": "wei903979/hello-world:0d1cf6cfb407526bc6ac40d7390848cda00ffe309342d852f542f49e66d35ce6",
"input": {
"name": "Wei"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Hello, Wei!
{
"id": "gyt55javdnrme0cnjpkr889dhc",
"model": "wei903979/hello-world",
"version": "0d1cf6cfb407526bc6ac40d7390848cda00ffe309342d852f542f49e66d35ce6",
"input": {
"name": "Wei"
},
"logs": "",
"output": "Hello, Wei!",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-03-14T17:15:27.981Z",
"started_at": "2025-03-14T17:15:34.889511Z",
"completed_at": "2025-03-14T17:15:34.889756Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/gyt55javdnrme0cnjpkr889dhc/cancel",
"get": "https://api.replicate.com/v1/predictions/gyt55javdnrme0cnjpkr889dhc",
"web": "https://replicate.com/p/gyt55javdnrme0cnjpkr889dhc"
},
"metrics": {
"predict_time": 0.000244707,
"total_time": 6.908756
}
}