# Keploy

> Record real API traffic, replay it as tests and mocks — no SDK, no code changes

- Category: AI Coding / AI SDLC Automation
- Language: Go
- Licence: Apache-2.0
- Repository: https://github.com/keploy/keploy
- Website: https://keploy.io
- Canonical page: https://ai-tldr.dev/tools/keploy/

## In short

Keploy turns traffic your application already serves into a regression suite. It sits in the AI SDLC Automation category of the AI Coding tools and is open-source, written in Go and licensed Apache-2.0. To get started: install the Keploy agent.

## Overview

Keploy turns traffic your application already serves into a regression suite. You start the app under `keploy record`, exercise it normally, and Keploy captures the API calls along with every dependency they touched — database queries, queue messages, outbound HTTP — writing them out as test cases plus the data mocks needed to replay them. Because it captures at the network layer with eBPF, there is no SDK to import and no code to change, and the approach is language-agnostic.

The replay side is what makes it more than a traffic recorder. Keploy virtualises the whole dependency surface rather than only HTTP endpoints: Postgres, MySQL and MongoDB, Kafka and RabbitMQ, external APIs. Tests run deterministically against those recordings, so a suite that would normally need a provisioned environment runs offline in CI. It also reports coverage from both angles — statement and branch coverage for developers, API schema and use-case coverage for QA — and can use existing recordings plus an OpenAPI/Swagger schema to generate additional cases around boundary values, missing or extra fields, wrong types and out-of-order sequences.

Keploy is written in Go, released under Apache 2.0, and listed in the CNCF landscape. It slots into the part of the delivery pipeline where integration tests usually rot: instead of hand-writing mocks that drift from production behaviour, the mocks come from the behaviour itself.

## What it does

- Records API calls, database queries and streaming events as test cases with matching data mocks
- eBPF capture at the network layer — no SDK, no code changes, language-agnostic
- Infrastructure virtualisation beyond HTTP: Postgres, MySQL, MongoDB, Kafka, RabbitMQ, external APIs
- Deterministic replay, so integration suites run without re-provisioning infrastructure
- Combined coverage reporting: statement and branch for developers, API schema and use-case for QA
- Generates extra cases from recordings and OpenAPI/Swagger schemas — boundary values, missing fields, wrong types, retries and timeouts

## Getting started

The whole loop is two commands around the command you already use to start your application. All commands below come from the project README.

1. Install the Keploy agent

   The install script fetches the binary and sets it up for your platform.

```bash
curl --silent -O -L https://keploy.io/install.sh && source install.sh
```

2. Record test cases

   Start your app through Keploy and use it as normal — real API calls become tests and mocks.

```bash
keploy record -c "CMD_TO_RUN_APP"
```

3. A concrete example

   Whatever starts your service goes inside the quotes.

```bash
keploy record -c "python main.py"
```

4. Replay them as a test run

   Tests run offline against the recorded dependencies; `--delay` gives the app time to boot before traffic is replayed.

```bash
keploy test -c "CMD_TO_RUN_APP" --delay 10
```

## When to use it

- Reach for it when a service has real traffic but no integration tests, and writing them by hand has stalled
- Reach for it when test mocks keep drifting from what the dependencies actually return
- Reach for it to run integration and end-to-end suites in CI without provisioning databases or brokers
- Reach for it when you need API schema and use-case coverage numbers, not just line coverage
