Use Cases

What teams build with Gostly

Patterns we see most often — record real traffic once, replay it forever, and stop paying upstream services to run your test suite.

Case 01

Test against expensive APIs without burning credits

Stripe, OpenAI, Twilio, and other usage-priced services turn every CI run into a line item on next month's bill. Recording one good response and replaying it forever changes the math: per-run cost goes to zero and your test suite stops being throttled by third-party rate limits.

Gostly captures real responses once, scrubs sensitive data, and serves them locally on subsequent runs. Your code calls the same URLs — the proxy answers instead of the upstream.

How it works

  • 1Run your tests once in LEARN mode against the real API
  • 2Scrub PII automatically (JWTs, emails, card numbers, SSNs by default) and review the recorded library
  • 3Switch to MOCK mode — every CI run after this is free and offline

Case 02

Reproduce production bugs locally

The hardest bugs are the ones that depend on a specific upstream response shape: a malformed timestamp, a 207 multi-status, an empty array where you expected null. By the time you're debugging, the upstream has moved on and the response is gone.

Gostly can capture upstream responses on production-shaped traffic, scrub them, and replay them deterministically against your local build. The bug becomes a single command instead of a guessing game.

How it works

  • 1Capture the failing request-response pair through the proxy
  • 2Commit the scrubbed mock alongside the failing test
  • 3Re-run locally — the bug reproduces every time, forever

Case 03

Shift-left integration testing

Real integration tests usually need real services, which means CI runs need credentials and network access to environments most engineers shouldn't touch. The compromise — mocking by hand — drifts from production behavior the moment the upstream changes.

Gostly closes the gap. Record realistic traffic from any non-prod environment once, commit the scrubbed library, and every PR runs the same integration paths against the same data with no production access required.

How it works

  • 1Record a realistic traffic snapshot from staging
  • 2Commit the mock library to your repo (mocks/ directory)
  • 3CI mounts the snapshot read-only and runs in MOCK mode — no creds needed

Case 04

Build against APIs that don't exist yet

When two teams design an API together, the front end needs something to call before the back end is finished. Hand-written mocks drift; OpenAPI stubs miss real-world quirks; coordination meetings stack up.

Use Gostly to seed mocks from the API spec or a single real response, then swap in real recordings the moment the implementation is up. The contract stays in code, not in a doc.

How it works

  • 1Author a few example responses by hand or seed from a spec
  • 2Front end develops against the proxy — same URLs as production
  • 3When the back end ships, record real traffic and replace the seeds

Case 05

Train developers on real systems safely

Onboarding a new engineer usually means either giving them production credentials (uncomfortable) or pointing them at a half-working dev environment (frustrating). Both options cost the team time and create risk.

A pre-recorded mock library gives new engineers a realistic system to learn against on day one — same shapes, same edge cases, same scale of data — without any production credentials, network access, or way to break a live system.

How it works

  • 1Record a representative traffic snapshot during a normal day
  • 2Auto-scrub PII in body payloads (JWTs, emails, card numbers, SSNs) plus 16 sensitive headers
  • 3Onboarding reads from the snapshot — no creds issued, no risk

Case 06

Test AI agents without burning API budget

Agent development chews through API quota in dev and CI. Each iteration on a prompt fires real OpenAI or Anthropic calls. Each test run renews the bill. And the responses aren't deterministic anyway, so the same input today yields a different observation tomorrow.

Record one agent run against the real upstream. Replay it forever in CI. The agent sees the same response to the same request every time — no tokens spent, no rate limits hit, no flake from upstream drift.

How it works

  • 1Run the agent once against the live upstream in LEARN mode
  • 2Switch to MOCK — the agent's HTTP calls now come from the recording
  • 3Run the same agent against the same recording in CI on every PR

Case 07

Stripe, Plaid, Twilio test isolation

Integration tests against payment, identity, and messaging sandboxes look reliable until they aren't. Sandbox APIs return slightly different shapes between Tuesday and Wednesday. Sandbox quotas exhaust mid-pipeline. POSTs sometimes leak mutations to production-adjacent state.

Record a real sandbox session once. Replay it byte-for-byte in CI. POSTs return the recorded response without making the real call — your test doesn't charge a card, doesn't send a text, doesn't open a verification session that someone has to clean up.

How it works

  • 1Capture one realistic sandbox session through the proxy in LEARN mode
  • 2Commit the recording to the repo alongside the integration tests
  • 3CI runs in MOCK — no sandbox credentials needed, no quota consumed

Case 08

Reproduce a production incident locally

Root-causing a third-party incident means reproducing the exact upstream sequence that triggered the failure — the same status codes, the same headers, the same body shapes, in the same order. By the time the postmortem starts, the upstream has moved on.

If the proxy was capturing traffic during the incident window, the sequence is in the recording log. Replay it locally. Step through your service against the same upstream behavior that caused the failure. The bug becomes reproducible.

How it works

  • 1Identify the incident window in the proxy's traffic log
  • 2Export the sequence to a local mock library
  • 3Replay the sequence against your service and walk through what broke

Case 09

Catch upstream API drift before your tests do

Hand-written mocks go stale. Contract tests miss drift unless someone re-pulls the spec. The diff between what the upstream returned last week and what it returns this week is a manual exercise — until a test breaks in production-shaped ways and nobody knows why.

Re-record nightly. Diff the new recording against last week's. Drift surfaces as a report — new fields, removed fields, status changes, header shifts — before your tests have to root-cause it.

How it works

  • 1Schedule a nightly LEARN run against the live upstream
  • 2Diff the fresh capture against the committed recording
  • 3Surface the diff as a report — review, regenerate fixtures, ship the update

Get started in 5 minutes

One Docker command, point your app at the proxy, and start recording. Switch to MOCK mode whenever you're ready.

Read the quickstart