Recipes
Working examples of common tasks — each one the whole thing in a single block, with links down to the guides for depth.
A recipe is a worked example of a common task — the whole thing in one block, runnable as a starting point and one way to get the job done, not the only way. Where a guide explains one feature, a recipe shows several working together — then links down to the guides when you want the detail.
Reach for a recipe when you know the task and want somewhere to start. Reach for a guide when you want to understand a feature on its own.
Start here
Send JSON and get a typed result back
POST a validated body and read a typed, runtime-validated result.
Loop a cursor API into one array
Follow nextCursor across every page and aggregate the items — no manual while-loop.
Make a flaky call succeed on its own
Add retry with backoff so transient 429s and 5xxs recover without your code noticing.
Stay resilient
Keep a failing dependency from taking you down
Compose timeout, retry, and a circuit breaker so a degraded upstream fails fast instead of hanging.
Retry a write without double-charging
Attach an idempotency key so a retried POST settles once, not twice.
Validate & observe
Catch a breaking API change before your users do
Wrap output with drift to flag dropped fields, type flips, and new keys against a committed snapshot.
Catch a silent selector rename in scraped HTML
Scrape HTML into a structured object with transform, then drift the structured shape so a markup rename becomes a loud error.
Watch retries and throttling as they happen
Iterate a stitch's event stream instead of awaiting it, and observe every retry, pause, and drift.
Run at scale
Mirror a paginated API to NDJSON
Pull every page of a cursor-paginated, OAuth2-protected endpoint — with retry and throttle on each page.
Share one rate limit across every worker
Point the throttle at a shared store so a whole fleet draws from a single rate budget.
Authenticate
Agents & surfaces
Let an agent call your API without handing it the key
Expose your stitches over MCP through one run_stitch tool — the agent never sees the credential.
Call one stitch as a function, a CLI command, and an agent tool
One definition, four front doors — in-process, shell, HTTP, and MCP.
These assume the runtime is installed and you can declare a stitch. New to it? Start at the Quickstart.
Migration notes
Three spec-correct behaviors — lowercase header names, %20 query spaces, and template-narrowed stitch types — that differ from a naive baseline and surprise migrators.
Send JSON and get a typed result back
POST a validated body and read a typed, runtime-validated result — input checked before the request, output checked after.