Infer OpenAPI specs
from live traffic.
REST Lens Capture is a reverse proxy sidecar that watches your API traffic, infers request/response schemas, and generates OpenAPI 3.1 specs. Privacy-first — no raw data stored, only types and shapes.
How it works
One binary between your traffic and your API. Zero config, zero code changes.
Client Request
│
▼
┌──────────────────────────┐
│ REST Lens Capture │ ← captures metadata
│ (reverse proxy :9000) │ ← infers JSON schemas
│ │ ← stores in SQLite
└──────────┬───────────────┘
│
▼
┌──────────────────────────┐
│ Your API (:3000) │ ← unchanged, unaware
└──────────────────────────┘Built for production
Designed to never impact your application. If capture fails, your traffic still flows.
Privacy First
Never stores raw request/response values. Only infers structural JSON Schema — types and shapes, no PII or secrets.
Circuit Breaker
If capture fails repeatedly, the proxy degrades to a transparent passthrough. Your traffic always flows, capture pauses.
Non-Blocking
Captures are written to a buffered channel. If the channel is full, exchanges are dropped silently — never blocking requests.
Smart Filtering
Only endpoints with at least one 2xx response are tracked. Scanner spam hitting nonexistent paths is automatically ignored.
K8s Sidecar Ready
Single static binary in a distroless image. Add as a sidecar container, route your Service through it, done.
OpenAPI 3.1 Export
Generates valid OpenAPI specs from captured traffic. Path patterns, request/response schemas, and status codes — all inferred.
Get started
Three commands. No config files, no dependencies.
Start the proxy
Point it at your API. All traffic flows through, metadata gets captured.
restlens-capture proxy --target http://localhost:3000 --port 9000Use your API normally
Send requests to port 9000 instead of 3000. Everything works identically.
curl http://localhost:9000/api/usersView the report
See discovered endpoints, hit counts, latency stats, and status code distribution.
restlens-capture report
# Or export as OpenAPI 3.1
restlens-capture export --openapi -o api.yamlWhat gets captured
Your API returns data. REST Lens Capture stores the shape, never the values.
{
"users": [
{
"id": 1,
"name": "Alice",
"email": "[email protected]"
}
],
"total": 1
}{
"type": "object",
"properties": {
"users": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"email": { "type": "string" }
}
}
},
"total": { "type": "integer" }
}
}No PII. No secrets. No raw values. Just types and structure.
Kubernetes sidecar
Add two lines to your pod spec. Route your Service through it.
containers:
- name: app
image: my-app:latest
ports:
- containerPort: 3000
- name: restlens-capture
image: ghcr.io/edthing/restlens-capture:latest
args: ["proxy", "--target=http://localhost:3000", "--port=9000"]
ports:
- containerPort: 9000
livenessProbe:
httpGet:
path: /healthz
port: 9000
---
# Route traffic through the sidecar
apiVersion: v1
kind: Service
spec:
ports:
- port: 80
targetPort: 9000Start capturing your API traffic
Open source, MIT licensed. One binary, zero dependencies.