typetext
{
"prompt": "hello"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Mfp**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run andreasjansson/fn-upcase using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"andreasjansson/fn-upcase:9acb2b2058d1a5a41bdb2675c05d1953e633f8ec2eac972f92abaf49809ad58f",
{
input: {
prompt: "hello"
}
}
);
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_Mfp**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/fn-upcase using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/fn-upcase:9acb2b2058d1a5a41bdb2675c05d1953e633f8ec2eac972f92abaf49809ad58f",
input={
"prompt": "hello"
}
)
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_Mfp**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/fn-upcase 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": "andreasjansson/fn-upcase:9acb2b2058d1a5a41bdb2675c05d1953e633f8ec2eac972f92abaf49809ad58f",
"input": {
"prompt": "hello"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
HELLO
{
"id": "cavq5pjc2drg80cmdyqth29vvg",
"model": "andreasjansson/fn-upcase",
"version": "9acb2b2058d1a5a41bdb2675c05d1953e633f8ec2eac972f92abaf49809ad58f",
"input": {
"prompt": "hello"
},
"logs": "",
"output": "HELLO",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-01-16T15:15:46.835Z",
"started_at": "2025-01-16T15:16:16.569051Z",
"completed_at": "2025-01-16T15:16:16.569088Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/cavq5pjc2drg80cmdyqth29vvg/cancel",
"get": "https://api.replicate.com/v1/predictions/cavq5pjc2drg80cmdyqth29vvg",
"web": "https://replicate.com/p/cavq5pjc2drg80cmdyqth29vvg"
},
"metrics": {
"predict_time": 0.000036746,
"total_time": 29.734088
}
}