API mocks from
real traffic,
verified.
Wraith records your app's calls to third-party APIs, synthesizes a fast local mock, and checks the twin against the original recordings. Deterministic, stateful, and proven against the real thing. Build CI, demos, and agents against a dependable service, not hand-written stubs.
curl -fsSL https://wraith.cx/install.sh | sh
Local-first CLI. Checksum verified. Prebuilt binaries for Linux x86_64 and macOS Apple silicon.
Latest release: v0.9.0 — overlay support. Pin a version with WRAITH_VERSION.
Five commands. Traffic replay to twin.
A twin that proves it matches.
Every mock library ships a promise. Wraith ships a proof. Every exchange you recorded is replayed through the synthesized model and compared with a semantic diff.
Divergences are categorized, counted, and either suppressed intentionally or fail the build. The twin isn't a sketch of your API. It's an assertion.
- 01Anti-unificationFinds the shared shape across all responses. Constants stay constant. Variables get classified by how they're sourced.
- 02Hole classificationEchoed from request? Generated ID? Timestamp? Counter? Each variable field gets a resolver the state engine understands.
- 03Semantic diffType mismatches, missing fields, and value drift are categorized and scored. Suppress what's expected. Fail the rest.
Built for the messy shape of real services.
- /01
Stateful CRUD, free
The synth stage detects create/read/update/delete on entities. POST then GET returns what you POSTed. Generated IDs stay consistent across routes.
STATE · inferred - /02
3-layer scrubbing
Secrets are removed before anything hits disk. Header redaction, body pattern matching, and pluggable rules per twin. Your recording never contains tokens.
SCRUB · pre-write - /03
Deterministic playback
Same request, same response. Counters, pseudo-random generators, and time all seed from request context. Your flaky integration test isn't flaky anymore.
DETERMINISTIC · seeded - /04
Lua escape hatches
When inference isn't enough, write a handler. Sandboxed, hot-reloaded, with access to request/response/state. Ten lines to make the twin behave exactly right.
HOOKS · per-route - /05
Fail like production
Inject errors, delays, timeouts, and 429s. Rate-limit by route. All deterministic from a single seed, so the same run gets the same failures every time.
CHAOS · deterministic - /06
Machine-readable everything
Every command emits JSON on demand. Reports, diffs, symbols, state. Drop wraith into CI and let your pipeline reason about it.
OUTPUT · --format json
- RESTshippedJSON bodies, path params, query routing, RFC 7807 errors.
- GraphQLshippedOperation-aware capture, field selection replay, variables-as-holes.
- gRPCshippedUnary + server-streaming RPCs. Live frame forwarding, byte-preserving replay, HTTP/2 trailers.
- SSEshippedPer-event timing replay, hole rotation, suffix anchoring on terminal sentinels. WebSocket on the roadmap.
Why a twin, not a mock.
- FOR AGENTS
A service they can drive, not simulate.
Agents do better when the environment behaves. Twins give them a loop they can trust: every POST persists, every GET returns, and rate limits fire when they should.
- FOR TESTS
CI that doesn't flake.
Point tests at localhost. No rate limits, no auth dance, no shared sandbox stepping on your fixtures. Millisecond replies, every time, forever.
- FOR DEMOS
An offline copy that still feels alive.
Ship a twin with the demo. It's small, deterministic, and behaves like the real thing. Conference wifi has never been a problem again.
Built for local twins, not every mock job.
- Use Wraith when the real API behavior matters. Record traffic from Stripe-style, GitHub-style, GraphQL, gRPC, or SSE services, then run the verified API mock locally in CI, demos, or agent loops.
- Do not use Wraith for a hand-authored mock UI. If you only need a static example response, a simpler API mocking tool or Postman collection may be the better fit.
- Do not treat it as hosted production traffic replay. Wraith is local-first service virtualization for development and tests, not a managed observability or production replay platform.
- Check protocol boundaries before a rollout. REST, GraphQL, gRPC unary/server-streaming, and SSE are shipped. WebSocket and pure bidirectional streaming remain outside the current fit.
Give your code a service
it can actually trust.
Five commands between you and a recorded-traffic mock that's been proven correct against the API it shadows.