Back to APIs
Replicate
Run thousands of open-source machine learning models — image generation, video, audio, language — with a single API call. No GPU setup required.
Base URL
https://api.replicate.com/v1image generationmodelsStable Diffusionopen-sourceGPU
Endpoints
POST
/predictionsRun a model to create a prediction.
const response = await fetch("https://api.replicate.com/v1/predictions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
body: JSON.stringify({
"version": "stability-ai/sdxl:latest",
"input": {
"prompt": "A photorealistic astronaut riding a horse"
}
})
});
const data = await response.json();
console.log(data);Response Preview
{
"id": "xyz789pred",
"status": "starting",
"model": "stability-ai/sdxl",
"urls": { "get": "https://api.replicate.com/v1/predictions/xyz789pred" }
}