Replicate: run a model via the API

domain: replicate.com/docs · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install the replicate Python client and set the REPLICATE_API_TOKEN environment variable to your API token.
  2. Browse replicate.com to find the model and note its owner/name:version string, or use the latest version tag if the model exposes one.
  3. Run the model synchronously: output = replicate.run('OWNER/MODEL_NAME:VERSION', input={'prompt': 'your input', ...}) where the input dict keys match the model's documented input schema.
  4. For long-running models, create a prediction asynchronously: prediction = replicate.predictions.create(version=VERSION_ID, input={...}) then poll prediction.reload() until prediction.status is 'succeeded'.
  5. Access the output from output (sync) or prediction.output (async); outputs are typically URLs to generated files or plain text strings depending on the model.
  6. Handle the 'failed' status by checking prediction.error for the error message.

Known gotchas

Related routes

Deploy a custom model on Replicate and expose it as a production API deployment with auto-scaling
replicate.com/docs · 6 steps · unrated
Run a model prediction asynchronously on Replicate and stream output tokens
replicate.com/docs · 6 steps · unrated
Replicate a full MLS dataset incrementally using RESO Replication
reso-webapi · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans