Both tools turn real traffic into something your tests can replay, but they record different things and keep the data in different places. Keploy captures a running service’s incoming requests and its outgoing dependency calls, including databases and queues, at the socket level with no code change, and writes them as YAML test cases and mocks in your working directory [1][2]. Stubsmith records only the outbound HTTP calls your Python or Node code makes to other APIs, masks every body value inside your process before the capture is sent, and serves the stubs you approved from a hosted service.
If you want generated API tests for your own endpoints, or mocks for Postgres, MongoDB or Kafka, Keploy covers ground Stubsmith does not. Both can record the outgoing HTTP calls your code makes and replay them in tests. Where Stubsmith differs is that body values are masked in your process before a capture leaves it, and the team replays one reviewed set of stubs.
At a glance
| Keploy | Stubsmith | |
|---|---|---|
| What it records | Incoming API calls (become test cases) and outgoing dependency calls (become mocks) [2] | Outgoing HTTP calls your code makes |
| Protocols | HTTP, gRPC, Postgres, MySQL, MongoDB, Redis, Kafka, RabbitMQ, with coverage that varies by plan and operating system; unknown protocols as base64 [1][2][9] | HTTP |
| How it hooks in | eBPF on Linux, user-space hooks on macOS and Windows; no SDK [2][3] | An SDK call: stubsmith.install() |
| Languages | Any on Linux or Docker; natively on macOS and Windows: Go, Node.js, Python, Java [4] | Python (requests, httpx) and Node (http, https, fetch) |
| Where recordings live | YAML under keploy/ in your working directory [5]; Mock Registry (Enterprise, Self-Hosted and Dedicated plans) uploads mocks to the cloud by default; uploads can be turned off [6] |
Masked captures on Stubsmith’s servers in Amsterdam; a bundle file you commit for replay |
| Sensitive data | keploy sanitize replaces secrets in recorded test files after recording [7] |
Body values masked in your process before sending; a body value is sent only for a field you approved |
| License | Apache 2.0 [8] | SDKs MIT; the service is hosted |
| Price | Open source free and self-hosted; Playground free with usage limits; Pro $19 per user per month billed yearly, plus usage [9] | Free plan; Team €39 a month for 10 seats, VAT included |
How each one records
Keploy wraps your app’s start command and records while you exercise it [1]:
keploy record -c "python app.py"
# send traffic to the app, then
keploy test -c "python app.py"
In test mode Keploy starts the app, sends the recorded requests, answers outgoing calls from the recorded mocks and compares the responses [2].
Keploy also has a Universal Mocker mode, keploy mock record, which records only the outgoing calls your test suite makes and replays them; by default a call with no recording fails the run [5][12].
Stubsmith is a call in your app’s entry point, and replay is a context in your tests:
import stubsmith
stubsmith.install() # key read from STUBSMITH_API_KEY
stubsmith pull --out .stubsmith/bundle.json
def test_card_declined():
with stubsmith.replay():
with pytest.raises(CardDeclined):
charge(amount_cents=950_000)
Replay matches a request on its domain, method, path template, body structure, query parameter names and content type. A request with no recording raises StubNotFound and never reaches the network.
Sensitive data
Keploy writes what it records to YAML on disk [5]. Its keploy sanitize command runs on recorded test files, finds secrets with gitleaks rules, replaces them with placeholders and keeps the originals in a secret.yaml that Keploy adds to .gitignore [7][10]. Keploy’s docs, checked on the date below, do not describe masking during recording.
Stubsmith masks during capture. Every body value without a keep rule is replaced by a typed placeholder ("<masked>", 0, false) before the capture leaves your process, and by default no field has a keep rule. Two kinds of value are sent as written: a path segment the SDK does not recognise as an ID, and the values of six transport headers a stub needs to replay. Names are sent as they are: JSON keys, form field names, query-parameter names and header names. So are the method, domain, status and duration of each call. The Security page lists all of it.
Choose Keploy when
- You want test cases generated from your service’s own incoming traffic, not only stubs of the APIs it calls [2].
- Your tests depend on databases or queues you would rather not run in CI [1].
- You cannot or do not want to change application code [3].
- Your service is written in a language Stubsmith has no SDK for [4].
- You need time frozen during replay so tokens and timestamps still match (documented for Enterprise, self-hosted and dedicated plans) [11].
Choose Stubsmith when
- The dependencies you need to stub are third-party HTTP APIs called from Python or Node.
- Real body values from those calls must not leave your process, and you want to choose field by field which ones may.
- Your team wants one reviewed set of stubs: new request shapes wait for approval before anything is stored, and every CI run pulls the same bundle.
What Stubsmith does not do
- Record incoming requests to your service, or generate tests for your own endpoints.
- Record database, queue or gRPC traffic.
- Capture traffic from languages other than Python and Node, or from browsers.
- Let you write a stub for an API you have never called: stubs come from recorded traffic.
Sources
Facts about Keploy are from Keploy's own documentation, repository and pricing page, last checked 2026-11-19. Corrections are welcome at legal@stubsmith.dev.