masjidofgod/certainty-video/prod-gateway-ops
Claude Code and agent skill by masjidofgod/certainty-video
- community
Checking that the SKILL.md file is still in the repository.
Select, integrate, and operate multi-model video-generation gateways , hosted inference aggregators such as fal.ai, Replicate, and WaveSpeed that expose many third-party video (and video-adjacent audio) models behind one account, one API surface, and one bill. Use when deciding whether to route video generation through a gateway versus a direct model-provider API; when comparing gateways on catalog, async/queue job design, webhooks, pricing, schema discovery, and version pinning; and when opera…
Install
npx vskill@latest install masjidofgod/certainty-video/prod-gateway-opsSKILL.md
The same SKILL.md was published earlier as masjidofgod/certainty-video/prod-gateway-ops.
Video-generation gateways
A video-generation gateway is a hosted inference aggregator that resells many third-party video models (Veo, Kling, Seedance, Hailuo/MiniMax, Luma, Wan, LTX-Video, Pika, and others) behind a single account, a single API convention, and a single bill. You send a prompt and parameters to a gateway-owned endpoint; the gateway runs the underlying model on its own infrastructure and returns a hosted result URL. This skill covers fal.ai, Replicate, and WaveSpeed as the representative gateways, and the production decisions common to the category.
This skill is about routing and operating, not about art direction. Prompt craft, shot design, and motion direction for a specific model belong to model- or craft-specific skills. Here the questions are: which gateway, going through a gateway at all, how the async job contract works, how to discover a model's schema, how to pin a version, how to cap spend, how to fail over, and whose license governs the output.
When a gateway is the right route (and when it is not)
Use a gateway when (production heuristics):
- You need several video models behind one integration, e.g. Veo for
premium shots, a Kling/Seedance tier for volume, and an audio or upscale model in the same pipeline, without signing and maintaining a separate contract, key, billing relationship, and SDK per vendor.
- You want one async job contract (submit → poll/webhook → fetch) instead
of learning each vendor's bespoke long-running-job protocol.
- You are model-shopping or A/B testing and want to swap model IDs without
re-plumbing auth, storage, and result handling.
- You want the gateway to host input uploads and output media on a CDN so
you are not building that yourself.
- Your volume does not yet justify a direct enterprise contract, or the model
has no first-party public API and is only reachable through resellers.
Go direct (or reconsider) when:
- You need a first-party capability the gateway does not expose, a
parameter, resolution, region, private-model hosting, or SLA the reseller has not surfaced. Gateways expose a curated subset of each model's surface.
- You need **contractual data-processing terms, HIPAA/regional residency, or a
signed DPA** that the gateway cannot pass through from the underlying vendor.
- You are at very high, steady volume where a direct committed-use contract
beats per-call reseller margin.
- You need the provider's own moderation posture rather than the gateway's
added moderation layer (see Content safety below).
- Latency is dominated by gateway queueing/cold-start overhead you cannot
tune, and the direct API offers provisioned throughput.
Out of scope for this skill: direct model-provider APIs (Google Vertex/Gemini Veo, Kling's own API, Runway, etc.), local/self-hosted inference, training or fine-tuning, and image-only gateway use.
The three reference gateways at a glance
Volatile facts below verified 2026-07-10; re-verify model IDs, prices, and limits before shipping, the catalogs and rate cards move frequently.
| Dimension | fal.ai | Replicate | WaveSpeed | |
|---|---|---|---|---|
| Positioning | Generative-media-first (image/video/audio/3D), latency-focused | General model marketplace (community + "official" curated models), broadest catalog | Speed/latency-optimized inference for media | |
| Catalog size (self-reported) | 1,000+ models | 100+ official models plus a large community catalog | 700–1,000+ models | |
| Submit endpoint | https://queue.fal.run/{model-id} | https://api.replicate.com/v1/predictions (community) or .../v1/models/{owner}/{name}/predictions (official) | https://api.wavespeed.ai/api/v3/{model-id} | |
| Async job states | IN_QUEUE → IN_PROGRESS → COMPLETED | starting → processing → succeeded/failed/canceled | created → processing → completed/failed | |
| Sync option | Queue is the primary path; short models also have a run endpoint | Prefer: wait header (default 60s) for sync | Poll or webhook; result endpoint | |
| Billing basis | Per-output (per-second or per-video for video); GPU-per-second fallback | Per-output for official models; per-second GPU time for community models | Per-model per-run, scales with resolution/duration/count | |
| Balance model | Prepaid credits | Prepaid credit (hard cap at $0 for new accounts) | Prepaid credits (non-expiring) | |
| Charged on failure? | No, pay only for successful output | Community models bill for GPU time even on model errors; official models bill per output | Pay per use; check per-model behavior | |
| Schema discovery | Model-endpoints API with expand=openapi-3.0 | openapi_schema on the model version object | Per-model playground / API examples |
Sources: fal queue and pricing docs; Replicate HTTP API and pricing docs; WaveSpeed predictions and pricing docs (see Sources).
Reading the table: the three overlap heavily on what you can call, the same headline models (Veo, Kling, Seedance) appear on all three, so differentiation is mostly in the operational contract: billing granularity, whether failures cost money, how you discover a schema, and how versions are pinned. Treat the catalog as necessary but not sufficient; the operational contract is where integrations succeed or fail.
The async job contract (the core of every gateway)
Video generation is slow (seconds to minutes), so every gateway is fundamentally an asynchronous job queue. Do not build on a synchronous request that blocks until the video is done, you will hit timeouts and lose work. The universal shape:
- Submit a job → receive a job/request ID immediately.
- Await completion by webhook (preferred) or polling (fallback).
- Fetch the result (a hosted media URL) and download/persist it before
it expires.
fal.ai queue
- Submit:
POST https://queue.fal.run/{model-id}with header
Authorization: Key $FAL_KEY. Returns request_id, response_url, status_url, cancel_url, queue_position.
- Status:
GET https://queue.fal.run/{model-id}/requests/{request_id}/status
(append ?logs=1 for runner logs). States: IN_QUEUE, IN_PROGRESS, COMPLETED.
- Result:
GET https://queue.fal.run/{model-id}/requests/{request_id}. - Cancel:
PUT .../requests/{request_id}/cancel, removes queued jobs
immediately; in-progress jobs get a best-effort cancel signal.
- Documented guarantee: "requests in the queue are never dropped."
- Verified 2026-07-10 from fal queue docs.
Replicate predictions
- Submit (community):
POST https://api.replicate.com/v1/predictions
with a version field. Submit (official): POST https://api.replicate.com/v1/models/{owner}/{name}/predictions (no version needed).
- Sync shortcut: add
Prefer: wait(orPrefer: wait=5) to hold the HTTP
connection up to 60s and return output inline for fast models, not suitable for multi-minute video.
- Deadline:
Cancel-Afterheader (5s–24h) auto-cancels the prediction
itself (distinct from Prefer: wait, which only bounds the HTTP wait).
- Status/result: poll the URL in
urls.getuntilsucceededorfailed;
output is null until done. Web debug view at urls.web.
- Verified 2026-07-10 from Replicate HTTP/create-prediction docs.
WaveSpeed predictions
- Submit:
POST https://api.wavespeed.ai/api/v3/{model-id}→ returns a
task/prediction ID.
- Result:
GET https://api.wavespeed.ai/api/v3/predictions/{id}/result.
States: created, processing, completed, failed. outputs holds result URLs; timings.inference gives duration in ms.
- Data retention: predictions available for 7 days (verified 2026-07-10);
persist outputs promptly.
- Verified 2026-07-10 from WaveSpeed get-result docs.
Webhooks vs polling (production heuristic)
Prefer webhooks for video: a minutes-long poll loop wastes requests and risks rate limits, and holding a connection open is fragile. Fall back to polling only when you cannot expose a public HTTPS endpoint (local dev, locked-down networks). If you poll, back off, image tasks ~2s, video tasks ~5s, then widen the interval (WaveSpeed's documented guidance, and a sound default everywhere). Never poll a single job multiple times per second.
Design every webhook handler to be idempotent: gateways retry deliveries and may deliver more than once for the same job ID.
Webhook security and reliability
Webhook payloads arrive from the public internet, verify them.
fal.ai signs webhooks with ED25519. To verify (verified 2026-07-10):
- Read headers
X-Fal-Webhook-Request-Id,X-Fal-Webhook-User-Id,
X-Fal-Webhook-Timestamp, X-Fal-Webhook-Signature (hex).
- Fetch the JWKS from
https://rest.fal.ai/.well-known/jwks.jsonand cache it
up to 24h.
- Reject if the timestamp is outside ±300s (5 min) of now.
- Reconstruct the signed message (request ID + user ID + timestamp +
SHA-256 of the raw body, newline-joined) and verify the signature against the JWKS ED25519 public keys.
- Optionally IP-allowlist using
webhook_ip_rangesfrom
https://api.fal.ai/v1/meta.
fal delivery/retry (verified 2026-07-10): initial delivery timeout 15s; on failure it retries 10 times over 2 hours. The success payload carries status: "OK", results, and a seed; a request error carries status: "ERROR"; a serialization failure sets payload: null with a payload_error. The request_id is stable across retries; gateway_request_id reflects the latest attempt.
Replicate lets you filter which events fire via webhook_events_filter (e.g. ["completed"]); start and completed are always sent. Replicate supports webhook signature verification via a signing secret, verify before trusting a payload. (Verify current mechanism in Replicate's webhook docs before shipping; verified conceptually 2026-07-10.)
WaveSpeed delivers a POST with id, model, input, outputs (on completed), urls.get, status, and error (on failure). Confirm current signing details in WaveSpeed's webhook docs before relying on them.
Schema discovery per model
Each model exposes a different input surface (resolution enums, duration caps, image/video reference slots, audio toggles, seed, negative prompt). Never hardcode assumptions, discover the schema so your integration validates inputs and adapts when a model updates.
- fal.ai: the model-endpoints API accepts
expand=openapi-3.0and returns
the full OpenAPI 3.0 schema for an endpoint in the openapi field. Query by endpoint_id (e.g. fal-ai/veo3) to get JSON Schema for every input parameter. Use list/search modes to enumerate the catalog. (Verified 2026-07-10.)
- Replicate: fetch the model version object at
/v1/models/{owner}/{name}/versions/{version_id} and read openapi_schema.components.schemas for the Input and Output schemas. (Verified 2026-07-10.)
- WaveSpeed: each model's page/playground exposes the parameter set and
auto-generates Python/JS/cURL examples; there is no single documented cross-catalog OpenAPI export as of 2026-07-10, treat per-model docs as the source of truth.
Heuristic: cache the discovered schema per (model-id, version) and re-fetch on a version change or on the first 422/validation error. Building a small schema-validation layer in front of the gateway catches parameter-shape breakage before you spend money on a failed job.
Version pinning and deprecation
Reproducibility is the reason to care about versions: the same prompt on a silently-updated model can produce different motion, framing, or quality.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/prod-gateway-ops/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/masjidofgod/certainty-video/prod-gateway-ops)