Replicate api
★★★★ 4.4 CE

Replicate API: Access, Rate Limits & SDKs 2026

Replicate turns any model into one call: replicate.run with a bearer token, from Python, JS or HTTP. Runs are async predictions, capped at 30 minutes.

Replicate API verdict

Verified today·4 sources checked

Replicate's API turns running any model into one call.

You authenticate with a bearer REPLICATE_API_TOKEN and call replicate.run with an owner/model id and an input object, from the official Python or JavaScript client. You can also drive the HTTP API directly from any language, with an OpenAI-compatible endpoint for the LLMs it serves.

How to build on it

Build on Replicate when you want to run or host many models, especially image, video, audio or custom models, with one API and no GPU management. replicate.run gets you a result in a few lines, FileOutput handles generated media, and webhooks plus the 30-minute prediction ceiling cover long jobs. Pin versions for reproducibility, save outputs within the hour before they are deleted, and use deployments to keep latency-sensitive models warm and to control hardware and scaling. Reach for a dedicated, OpenAI-compatible LLM host instead when your workload is purely interactive text generation and cold-start latency is unacceptable. Replicate's strength is breadth and ease, not the lowest LLM latency.

Honest limits
  • Runs are asynchronous predictions. Long jobs, up to 30 minutes, must be polled or handled via webhook, not awaited as a fast synchronous call.
  • API output files are deleted after one hour, so save any images, audio or video you need to keep, and allow-list replicate.delivery for assets.
  • Cold boots add latency to the first call on an idle model. Pin a deployment with minimum instances of 1 or more for production latency, paying for idle capacity.
  • Pin model versions, as owner/model:version, for reproducibility, since model authors publish new versions that can change behavior.
Auth
Bearer REPLICATE_API_TOKEN
Core call
replicate.run('owner/model', input)
Clients
Python, JavaScript, HTTP
Long jobs
Predictions + webhooks (30-min cap)
Runs
Any model + your own
View sources

Build with the Replicate API

Your first Replicate API request

replicate.run() / POST /v1/predictionspython
# Python client (recommended): run any model in a few lines
import replicate
output = replicate.run(
    "black-forest-labs/flux-schnell",
    input={"prompt": "an astronaut riding a horse"},
)

# or raw HTTP:
curl -s https://api.replicate.com/v1/predictions \
  -H "Authorization: Bearer ${REPLICATE_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"version":"<model-version>","input":{"prompt":"an astronaut riding a horse"}}'

How to authenticate with the Replicate API

AspectDetailNotes
AuthBearer REPLICATE_API_TOKENSet as an environment variable
Core callreplicate.run('owner/model', input={...})Run any public or custom model
ClientsPython, JavaScript (+ other languages)Wrap the HTTP API
HTTP APIREST, usable from any languagePOST /v1/predictions; poll for status
OpenAI compatOpenAI-compatible API for served LLMsReuse OpenAI SDK integrations
Model referenceowner/model[:version]Pin a version for reproducibility
MCP serverReplicate MCP serverUse Replicate from agent tooling

Replicate core endpoints and features

CapabilityHowPurpose
Create predictionPOST /v1/predictionsRun a model version with inputs
run() helperreplicate.run(model, input)One-call sync wrapper over predictions
Poll statusstarting/processing/succeeded/failed/canceledTrack long-running predictions
Streaming outputStreaming outputStream tokens/results as generated
File outputsFileOutput (replicate.delivery)Images/audio/video returned as files
WebhooksRegister a webhook URLGet results for long jobs without holding a connection
DeploymentsCreate a deploymentCustom hardware + min/max instances (keep warm)
Push / fine-tunePush your own model; fine-tuneBuild and host custom models

Limits, lifecycle and data rules

AspectDetailNotes
Prediction timeout30 minutesContact Replicate for longer jobs
Output retentionAPI output files deleted after 1 hourSave copies; web predictions kept
Rate limitsAPI request rate limits applySee HTTP API reference
Cold bootsCold model adds start latencyPin a deployment to avoid
File deliveryOutputs served via replicate.deliveryAllow-list replicate.delivery + *.replicate.delivery
VersionsPin owner/model:versionReproducible behavior over time
SafetySafety checker on image models; can disable via APISDXL and fine-tunes

Clients, ops and developer fit

AspectDetailNotes
ClientsPython (import replicate), JavaScript (Replicate)Plus other community clients
File handlingFileOutput: .read()/.blob(), .url()Save or stream generated media
Long jobsWebhooks + pollingNo need to hold a connection
Production controlDeployments: hardware + min/max instancesKeep warm, autoscale
TeamsOrganizations: shared models, tokens, billingPrivate team models
No infraRun/host models without managing GPUsCloud API abstracts the hardware
LLM pricing (tracked)$0.05-$0.08 / 1M (Granite)Independent cross-reference; most models billed per run-second

Replicate API FAQ

How do I authenticate and call the Replicate API?

Create an API token and set it as REPLICATE_API_TOKEN, then use the official client. In Python, import replicate and call replicate.run with an owner/model id and an input object. In JavaScript, create a new Replicate client with your auth token, then call replicate.run with the model and input. You can also drive the HTTP API directly, through POST /v1/predictions, from any language, and there is an OpenAI-compatible endpoint for the LLMs Replicate serves.

How do predictions and long-running jobs work?

Every model run is a prediction object with a status, from starting, which includes cold boot, to processing, succeeded, failed or canceled. Fast models return within milliseconds, while longer ones, especially generative image and video, you poll for status or receive via a webhook. Predictions time out after 30 minutes, though you can contact Replicate for longer, and the run helper wraps create-and-wait for you.

How does Replicate handle file outputs?

Models that generate images, audio or video return FileOutput objects. In Python you call .read or aread, or use the .url attribute. In JavaScript you use .blob or the url method, and both support streaming. Files are served from replicate.delivery, so allow-list replicate.delivery and *.replicate.delivery. API prediction outputs are deleted after one hour, so save copies of anything you need.

Can I run my own models and control hardware?

Yes. Beyond running any public model, you can push your own models, public or private, fine-tune image models, and pin versions for reproducibility. Deployments let you customize the GPU hardware and the scaling configuration, with min and max instances. Setting minimum instances to 1 or more keeps a model warm and removes cold boots for latency-sensitive workloads.

What are the Replicate API limits?

Predictions time out after 30 minutes, API output files are deleted after one hour, and the API enforces request rate limits, documented in the HTTP API reference. The main performance constraint is cold boots on idle models, which you mitigate with a warm deployment. Outputs are served through replicate.delivery, and image models include a safety checker you can disable through the API.

Sources & verification

Verified by ComparEdgeMethod: Vendor docs, official pages, and selected independent sources
SourceWhat was checkedLast checked
Replicate OfficialOfficial product pageJuly 10, 2026
Artificial AnalysisIndependent referenceJuly 10, 2026
Replicate Reference How Does Replicate WorkHow Does Replicate WorkJuly 10, 2026
Replicate Reference HttpHttpJuly 10, 2026

Every fact on this Replicate page is tied to a named source and a verification date. Freshness-sensitive figures trace to the sources above; verify against the vendor before relying on them.