Docs
1. Find models
- Search:
GET /v1/search?query=... returns models, collections, and docs.
- Collections:
GET /v1/collections for curated groups. The official collection is always warm with stable APIs.
- Read schema:
GET /v1/models/{owner}/{name} → model.latest_version.openapi_schema.components.schemas.Input.properties. Always fetch before running — schemas change.
Prefer official models (warm, stable, predictable pricing). Prefer latest versions. Run count can be misleading — recency matters more.
2. Compare models
Build a shortlist, then compare on four axes:
| Axis |
How to check |
| Speed |
metrics.predict_time on completed predictions |
| Cost |
Official = per-run. Community = GPU-seconds. Run a few and check metrics |
| Quality |
Same prompt through each model. Match to your use case, not a leaderboard |
| Capabilities |
Input schema: reference images, masks, aspect ratios, streaming, multi-image |
Tradeoffs: smaller = cheaper/slower; schnell/turbo = faster/pricier; pro/max = best/slowest; ControlNet = most control/most setup.
3. Run models
Workflow: choose → get schema → create prediction → poll → return output.
# Create
POST /v1/predictions
# Poll
GET /v1/predictions/{id}
Output methods:
- Poll: store
id, loop until status == succeeded
- Sync:
Prefer: wait header — blocking, max 60s, only for very fast models
- Webhook: set
webhook URL + webhook_events_filter (start, output, logs, completed). Validate with Webhook-ID, Webhook-Timestamp, Webhook-Signature
Guidelines:
- Use
POST /v1/predictions for official and community models
- Validate inputs against schema constraints (
minimum, maximum, enum)
- Don't set optional inputs without reason
- Use HTTPS URLs for file inputs
- Fire predictions concurrently
- Output URLs expire after 1 hour — back up immediately
- Set
lifetime to auto-cancel (30s, 5m, 1h)
Model identifiers:
- Official:
owner/name (routes to latest)
- Community:
owner/name:version_id (must pin; can cold-boot)
4. Multi-model workflows
Chain models by passing output URLs as inputs to the next. Start independent predictions in parallel. Output URLs are valid for 1 hour.
5. Prompting guidance
1---2name: replicate-models3description: Docs4---5## Docs67- Reference: <https://replicate.com/docs/llms.txt>8- OpenAPI schema: <https://api.replicate.com/openapi.json>9- MCP server: <https://mcp.replicate.com>10- Per-model docs: `https://replicate.com/{owner}/{model}/llms.txt`11- Set `Accept: text/markdown` when requesting docs pages.1213## 1. Find models1415- **Search**: `GET /v1/search?query=...` returns models, collections, and docs.16- **Collections**: `GET /v1/collections` for curated groups. The `official` collection is always warm with stable APIs.17- **Read schema**: `GET /v1/models/{owner}/{name}` → `model.latest_version.openapi_schema.components.schemas.Input.properties`. Always fetch before running — schemas change.1819Prefer official models (warm, stable, predictable pricing). Prefer latest versions. Run count can be misleading — recency matters more.2021## 2. Compare models2223Build a shortlist, then compare on four axes:2425| Axis | How to check |26|------|-------------|27| **Speed** | `metrics.predict_time` on completed predictions |28| **Cost** | Official = per-run. Community = GPU-seconds. Run a few and check `metrics` |29| **Quality** | Same prompt through each model. Match to your use case, not a leaderboard |30| **Capabilities** | Input schema: reference images, masks, aspect ratios, streaming, multi-image |3132**Tradeoffs**: smaller = cheaper/slower; schnell/turbo = faster/pricier; pro/max = best/slowest; ControlNet = most control/most setup.3334## 3. Run models3536**Workflow**: choose → get schema → create prediction → poll → return output.3738```bash39# Create40POST /v1/predictions4142# Poll43GET /v1/predictions/{id}44```4546**Output methods**:471. Poll: store `id`, loop until `status == succeeded`482. Sync: `Prefer: wait` header — blocking, max 60s, only for very fast models493. Webhook: set `webhook` URL + `webhook_events_filter` (`start`, `output`, `logs`, `completed`). Validate with `Webhook-ID`, `Webhook-Timestamp`, `Webhook-Signature`5051**Guidelines**:52- Use `POST /v1/predictions` for official and community models53- Validate inputs against schema constraints (`minimum`, `maximum`, `enum`)54- Don't set optional inputs without reason55- Use HTTPS URLs for file inputs56- Fire predictions concurrently57- Output URLs expire after 1 hour — back up immediately58- Set `lifetime` to auto-cancel (`30s`, `5m`, `1h`)5960**Model identifiers**:61- Official: `owner/name` (routes to latest)62- Community: `owner/name:version_id` (must pin; can cold-boot)6364## 4. Multi-model workflows6566Chain models by passing output URLs as inputs to the next. Start independent predictions in parallel. Output URLs are valid for 1 hour.6768## 5. Prompting guidance6970- **Image**: see [replicate-prompting](../replicate-prompting/SKILL.md) §Image71- **Video**: see [replicate-prompting](../replicate-prompting/SKILL.md) §Video