Replicate
Run models on Replicate through its predictions API, package your own with Cog, keep the bill bounded and delete what you stop using. Replicate joined Cloudflare in November 2025 and remains its own brand with an unchanged API.
Scope:
- In: API token, creating and polling predictions, webhooks, official and community models, deployments, Cog push, data retention, billing semantics, deletion, LiteLLM routing.
- Out: picking a provider (
cloud-llms, choosing-llm-hosting), gateway config (llm-gateway), image and video model choice and local serving (self-hosted-genmedia), serving LLMs on your own GPUs (self-hosted-llms), evals (llm-evals).
Replicate documents no OpenAI-compatible chat endpoint. Do not claim one. Use LiteLLM's replicate/ provider for chat models.
Work through the steps in order. Load a reference only when a step names it.
Discover first
Read-only. Print variable names only.
env | cut -d= -f1 | grep -iE '^REPLICATE' || echo "no REPLICATE_* vars"
command -v cog && cog --version
command -v replicate && replicate --version
pip show replicate 2>/dev/null | head -2
curl -sS https://api.replicate.com/v1/account -H "Authorization: Bearer $REPLICATE_API_TOKEN" | jq 'keys'
curl -sS https://api.replicate.com/v1/deployments -H "Authorization: Bearer $REPLICATE_API_TOKEN" | jq '.results | length'
Existing deployments with a minimum instance count above zero are billing around the clock. Report them first.
Decision flow
- A public model, bursty use: call the model by
owner/name. Public models bill active time only, and a cold boot may take minutes.
- Latency matters or you need your own capacity: create a deployment with
min_instances >= 1. It bills setup, idle and active time.
- Your own weights or code: package with Cog, push to
r8.im, then deploy it.
- Long jobs or many jobs: use webhooks with a verified signature, not a polling loop.
- Chat through a gateway:
references/litellm-and-clients.md.
Rules
- Ask before creating billable resources. Deployments, private models, minimum instances above zero and credit top-ups need approval with the hardware and bounds shown.
- Secrets never print. The token starts with
r8_. Keep it in a 0600 file or REPLICATE_API_TOKEN. Replicate auto-disables tokens leaked to GitHub.
- Pin versions. Community models need
owner/name:<version-id>. Pin the Cog and client versions.
- Spend controls before traffic. Use prepaid credit with a low balance, cap
max_instances, and send Cancel-After on requests (references/billing-and-teardown.md).
- Mind data retention. API inputs, outputs and files are deleted after an hour by default. Save outputs you need.
- Always tear down. Delete deployments, private models and versions you created, then verify.
- Look prices up on the model page or the pricing page. Do not store rates.
Workflows
1. Account and auth
2. Call a model
3. Deploy
4. Connect to LiteLLM
5. Scale
6. Monitor cost
7. Update
8. Tear down
9. Troubleshoot
Reference index
references/setup-and-auth.md: token, clients, CLI, MCP.
references/predictions-api.md: endpoints, headers, files, streaming, webhooks, retention.
references/deployments-and-cog.md: deployments API, hardware, Cog push.
references/billing-and-teardown.md: billing rules, rate limits, spend controls, deletion.
references/litellm-and-clients.md: LiteLLM, Cloudflare AI Gateway, SDK use.
references/troubleshooting.md: error codes and cold starts.
Companion skills
cloud-llms: compare Replicate with other cloud options. Install: npx skills add ScaleDockHQ/llm-skills --skill cloud-llms.
llm-gateway: LiteLLM routing and budgets. Install: npx skills add ScaleDockHQ/llm-skills --skill llm-gateway.
self-hosted-genmedia: run image, video and audio models on your own GPUs. Install: npx skills add ScaleDockHQ/llm-skills --skill self-hosted-genmedia.
choosing-llm-hosting: laptop, owned GPUs or cloud. Install: npx skills add ScaleDockHQ/llm-skills --skill choosing-llm-hosting.
llm-observability: traces and cost. Install: npx skills add ScaleDockHQ/llm-skills --skill llm-observability.
1---2name: replicate3description: Replicate predictions API, Cog and deployments - run hosted models over HTTP or the replicate Python/Node clients, push your own with Cog, run always-on deployments, control spend and delete. Use for "Replicate", "replicate.run", "r8_" tokens, REPLICATE_API_TOKEN, "cog push", r8.im, prediction webhooks, cold boot, E6716 or E1001 errors. Now part of Cloudflare, brand and API unchanged. No OpenAI endpoint - use llm-gateway. Cloud comparisons - cloud-llms.4license: MIT5compatibility: macOS or Linux shell with curl and jq. Cog needs Docker and, for GPU builds, an NVIDIA-capable build path. Needs a Replicate account and an API token in a 0600 file or REPLICATE_API_TOKEN. Deployments, always-on instances and prepaid top-ups cost money and need the user's approval.6metadata:7 source: https://skillmd.com/skills/scaledockhq/replicate8 author: ScaleDockHQ9 version: "0.1.0"10---1112# Replicate1314Run models on Replicate through its predictions API, package your own with Cog, keep the bill bounded and delete what you stop using. Replicate joined Cloudflare in November 2025 and remains its own brand with an unchanged API.1516**Scope:**1718- In: API token, creating and polling predictions, webhooks, official and community models, deployments, Cog push, data retention, billing semantics, deletion, LiteLLM routing.19- Out: picking a provider (`cloud-llms`, `choosing-llm-hosting`), gateway config (`llm-gateway`), image and video model choice and local serving (`self-hosted-genmedia`), serving LLMs on your own GPUs (`self-hosted-llms`), evals (`llm-evals`).2021Replicate documents no OpenAI-compatible chat endpoint. Do not claim one. Use LiteLLM's `replicate/` provider for chat models.2223Work through the steps in order. Load a reference only when a step names it.2425## Discover first2627Read-only. Print variable names only.2829```bash30env | cut -d= -f1 | grep -iE '^REPLICATE' || echo "no REPLICATE_* vars"31command -v cog && cog --version32command -v replicate && replicate --version33pip show replicate 2>/dev/null | head -234curl -sS https://api.replicate.com/v1/account -H "Authorization: Bearer $REPLICATE_API_TOKEN" | jq 'keys'35curl -sS https://api.replicate.com/v1/deployments -H "Authorization: Bearer $REPLICATE_API_TOKEN" | jq '.results | length'36```3738Existing deployments with a minimum instance count above zero are billing around the clock. Report them first.3940## Decision flow41421. A public model, bursty use: call the model by `owner/name`. Public models bill active time only, and a cold boot may take minutes.432. Latency matters or you need your own capacity: create a deployment with `min_instances >= 1`. It bills setup, idle and active time.443. Your own weights or code: package with Cog, push to `r8.im`, then deploy it.454. Long jobs or many jobs: use webhooks with a verified signature, not a polling loop.465. Chat through a gateway: `references/litellm-and-clients.md`.4748## Rules4950- **Ask before creating billable resources.** Deployments, private models, minimum instances above zero and credit top-ups need approval with the hardware and bounds shown.51- **Secrets never print.** The token starts with `r8_`. Keep it in a `0600` file or `REPLICATE_API_TOKEN`. Replicate auto-disables tokens leaked to GitHub.52- **Pin versions.** Community models need `owner/name:<version-id>`. Pin the Cog and client versions.53- **Spend controls before traffic.** Use prepaid credit with a low balance, cap `max_instances`, and send `Cancel-After` on requests (`references/billing-and-teardown.md`).54- **Mind data retention.** API inputs, outputs and files are deleted after an hour by default. Save outputs you need.55- **Always tear down.** Delete deployments, private models and versions you created, then verify.56- **Look prices up** on the model page or the pricing page. Do not store rates.5758## Workflows5960### 1. Account and auth6162- [ ] Create a token at https://replicate.com/account/api-tokens. See `references/setup-and-auth.md`.6364### 2. Call a model6566- [ ] Choose the endpoint form for official, community or deployed models. See `references/predictions-api.md`.6768### 3. Deploy6970- [ ] Create or push a model, then a deployment with hardware and bounds, after approval. See `references/deployments-and-cog.md`.7172### 4. Connect to LiteLLM7374- [ ] Add a `replicate/` model entry. See `references/litellm-and-clients.md`.7576### 5. Scale7778- [ ] Patch `min_instances` and `max_instances`. See `references/deployments-and-cog.md`.7980### 6. Monitor cost8182- [ ] Use the billing page and account endpoints. See `references/billing-and-teardown.md`.8384### 7. Update8586- [ ] Push a new version, patch the deployment's version, verify, delete the old version.8788### 8. Tear down8990- [ ] Delete deployments (offline first), then versions, then models. See `references/billing-and-teardown.md`.9192### 9. Troubleshoot9394- [ ] Map the error in `references/troubleshooting.md`.9596## Reference index9798- `references/setup-and-auth.md`: token, clients, CLI, MCP.99- `references/predictions-api.md`: endpoints, headers, files, streaming, webhooks, retention.100- `references/deployments-and-cog.md`: deployments API, hardware, Cog push.101- `references/billing-and-teardown.md`: billing rules, rate limits, spend controls, deletion.102- `references/litellm-and-clients.md`: LiteLLM, Cloudflare AI Gateway, SDK use.103- `references/troubleshooting.md`: error codes and cold starts.104105## Companion skills106107- `cloud-llms`: compare Replicate with other cloud options. Install: `npx skills add ScaleDockHQ/llm-skills --skill cloud-llms`.108- `llm-gateway`: LiteLLM routing and budgets. Install: `npx skills add ScaleDockHQ/llm-skills --skill llm-gateway`.109- `self-hosted-genmedia`: run image, video and audio models on your own GPUs. Install: `npx skills add ScaleDockHQ/llm-skills --skill self-hosted-genmedia`.110- `choosing-llm-hosting`: laptop, owned GPUs or cloud. Install: `npx skills add ScaleDockHQ/llm-skills --skill choosing-llm-hosting`.111- `llm-observability`: traces and cost. Install: `npx skills add ScaleDockHQ/llm-skills --skill llm-observability`.