Record Real API Traffic, Auto-Generate Tests: Keploy Hits 19.8K Stars

Recently, while browsing GitHub, I came across a project called keploy and found it interesting, so I'm sharing it.
It's an open-source API testing tool with a different approach than usual. Instead of writing test cases first, you run the business, record real traffic, and test cases and mock data are generated automatically. Backend developers and testers can both use it; it eliminates the two most time-consuming tasks: hand-writing test cases and setting up environments.

Here are the key facts to remember:
- Project:
keploy, official site https://keploy.io - Open-sourced in early 2022, 19.8K stars, Apache-2.0 license, written in Go, very actively updated; v3.7.3 was released just two days ago
- Listed in the CNCF Landscape and on the Trendshift trending list
- The README's slogan claims to help developers reach 90% test coverage; such metrics are unverifiable, so take it with a grain of salt
What it does is simple, in one sentence: records real API traffic, automatically generates replayable API tests and dependency mocks, so replaying doesn't require a real environment or database.

Writing API tests itself isn't hard
Writing API tests isn't hard; the real challenge is often setting up the environment.
When adding API tests to an existing service, writing assertions actually takes little time. Most of the cost goes into preparing the dependency environment. APIs typically connect to databases, caches, third-party payment systems, message queues, and other components. To run tests locally, you need to mock each external dependency one by one. When business services grow, maintaining mocks can even exceed the cost of business code itself.
Keploy merges traffic recording and test case generation into one step. During recording, it uses real external dependencies while the business system runs normally; during replay, it automatically substitutes recorded traffic snapshots. The application thinks it's still talking to real databases and third-party services, but the actual interaction data comes entirely from the last recording. This removes the need to manually set up the full dependency environment or construct test data.
Traffic recording and replay isn't a new concept; there are many similar tools on the market. Keploy's differentiation mainly lies in where it captures packets and its ability to work without any application changes.
How traffic becomes test cases
First, recording. Start the app with keploy, for example a Python service:
keploy record -c "python main.py"
The app starts normally; you click around on the page or send requests with Postman. Every incoming and outgoing request, response, and real database query is logged, saved to the project's keploy directory as test case files and mock files. Not a single line of code needs changing, and no SDK needs installing.
The official README explains that it captures packets at the network layer using eBPF, grabbing traffic as it flows through the kernel.

There's a full process animation on the official site showing capture, test/mock generation, and replay results.

Now replay:
keploy test -c "python main.py" --delay 10
Keploy sends the recorded requests back to the app. The app's actual responses are compared to the recorded ones; if they match, it passes; if not, it reports a diff. The --delay 10 gives the app time to start up.
Because dependencies are replaced with mocks, this step runs offline, and the recorded test cases and mocks can go straight into CI pipelines like GitHub Actions or Jenkins.
By the way, Keploy itself is tested by Keploy; the README shows its own coverage (75%), which counts as a positive signal.

Databases and message queues are also recorded as mocks
Most mock tools only handle HTTP APIs, leaving databases and queues in dependencies to be handled separately.
Keploy records at a deeper granularity: queries against Postgres, MySQL, MongoDB, Redis; messages from Kafka and RabbitMQ; and gRPC and GraphQL calls are all recorded along with requests. During replay, these dependencies don't need to be started; queries the app sends hit the recorded mock data.
The official term for this is infra virtualization (infrastructure virtualization). The intent is straightforward: replace every dependency in the test environment with recorded data.

For backend developers, this means no longer needing to install an entire stack of databases and middleware locally. For testers, regression testing is no longer blocked by environments: record once, then replay anytime.
Developers look at line coverage; testers look at API coverage
From the same recordings, the two groups care about different coverage metrics. Developers look at statement and branch coverage, which Keploy computes from recorded traffic. Testers look at API structure coverage and business scenario coverage, which it also computes. The official README explicitly separates these two perspectives, a level of detail most tools don't bother with.

If the test cases aren't enough, there's a way to add more. The CLI has a test-gen subcommand, driven by an AI agent, which examines existing recordings and Swagger/OpenAPI docs for issues: boundary values, missing fields, extra fields, type errors, reversed call order. It finds them and adds new test cases. This adds a layer of machine-generated edge-case tests on top of real traffic.
One command to install, two commands to run
Regarding environments, the docs state that Linux, macOS (Apple Silicon), and Windows (x86-64) are all natively supported. Linux requires kernel 5.10 or higher, and it also runs in Docker and Podman.
Installation is one command:
source /dev/stdin <<<"$(curl -fsSL https://keploy.io/install.sh)"
After installation, the terminal shows Keploy's rabbit logo and version. You don't need to memorize all subcommands; two are enough to start: record for recording, test for replay. The rest can be looked up as needed: test-gen lets the AI agent add cases, sanitize anonymizes sensitive data in test cases, templatize and normalize handle fields that change every time like timestamps and random numbers, and export exports test cases as Postman collections for testers to use directly.
The shortest path is: install Keploy, use record on any local service, click around the page a couple times, then run test. Your first API test without any hand-written cases is done.
I verified the commands and parameters against the official docs, but I haven't run it on a full production project yet. For first-time adoption, I recommend practicing with a small local service first, then bringing it into CI once it's smooth.
Points to watch
Recorded cases come from real traffic and may contain sensitive information like accounts or phone numbers. Run sanitize before committing to Git; don't push test data to production.
Replay is snapshot comparison. Fields that change every time, such as timestamps, random IDs, or auto-increment primary keys, will fail the comparison directly. Use templatize and normalize to parameterize them. If your first test run fails across the board, check these fields first; they're usually not real regressions.
The core CLI is Apache-2.0 open source, but features like the Mock Registry, time freezing, and the Console are tied to the official cloud service. Teams that need those parts have to look at the official paid plans.
Is this tool worth installing?
My view: teams with many backend services and tangled dependencies should seriously give it a try. It shifts the cost of API testing from writing test cases to running the business, and running the business is something that happens every day anyway. It's also suitable for testers doing regression: record once, then replay offline before every release.
The tool itself is optional, but the idea can be adopted. Traffic is the test case; dependencies can be replaced with recorded data. This approach holds even without Keploy. Looking at your own project's testing strategy through the lens of recording and replay will likely reveal several places of repetitive work that can be cut.
GitHub repository:
https://github.com/keploy/keploy