I have used the following code to call deployment, but failed. Would you tell me how to make it correct?
export default async function handler(req, res) {
const response = await fetch("https://api.replicate.com/v1/deployments", {
method: "POST",
headers: {
Authorization: Token ${process.env.REPLICATE_API_TOKEN},
"Content-Type": "application/json",
},
body: JSON.stringify({
version: "#################",
// This is the text prompt that will be submitted by a form on the frontend
input: req.body,
}),
});
I have used the following code to call deployment, but failed. Would you tell me how to make it correct?
export default async function handler(req, res) { const response = await fetch("https://api.replicate.com/v1/deployments", { method: "POST", headers: { Authorization:
Token ${process.env.REPLICATE_API_TOKEN}
, "Content-Type": "application/json", }, body: JSON.stringify({ version: "#################", // This is the text prompt that will be submitted by a form on the frontend input: req.body, }), });