Import and set up the client:
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.
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.
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.