typetext
{
"name": "Sakib"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_OWF**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run zsxkib/hello-world using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"zsxkib/hello-world:8fe0684c36b60b517c54485af209cada754d9ebfd3b891f7fee83e8b568e736a",
{
input: {
name: "Sakib"
}
}
);
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_OWF**********************************
This is your API token. Keep it to yourself.
import replicate
Run zsxkib/hello-world using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"zsxkib/hello-world:8fe0684c36b60b517c54485af209cada754d9ebfd3b891f7fee83e8b568e736a",
input={
"name": "Sakib"
}
)
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_OWF**********************************
This is your API token. Keep it to yourself.
Run zsxkib/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": "zsxkib/hello-world:8fe0684c36b60b517c54485af209cada754d9ebfd3b891f7fee83e8b568e736a",
"input": {
"name": "Sakib"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Hello, Sakib!
{
"id": "lwtvx6bnszazxgzjc5xyevzz64",
"model": "zsxkib/hello-world",
"version": "8fe0684c36b60b517c54485af209cada754d9ebfd3b891f7fee83e8b568e736a",
"input": {
"name": "Sakib"
},
"logs": "",
"output": "Hello, Sakib!",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-06-05T19:17:31.552305Z",
"started_at": "2023-06-05T19:17:41.957749Z",
"completed_at": "2023-06-05T19:17:41.982112Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/lwtvx6bnszazxgzjc5xyevzz64/cancel",
"get": "https://api.replicate.com/v1/predictions/lwtvx6bnszazxgzjc5xyevzz64"
},
"metrics": {
"predict_time": 0.024363,
"total_time": 10.429807
}
}