Find Your Slowest API Endpoints

Scenario

Your app feels sluggish, but you don't know which API call is responsible. Browser devtools shows individual request timings, but there is no easy way to see which endpoints are consistently slow across a whole session of normal usage.

Steps

Start the proxy and use your app normally for a while so real traffic gets captured:

laurel-proxy start

Query for requests slower than a threshold, in milliseconds:

laurel-proxy requests --slow 500 --format table

The --slow <ms> flag filters to requests whose duration exceeds the threshold. Duration is stored and indexed for every captured request, so this works instantly even across thousands of requests.

Example output:

  METHOD  STATUS  HOST                          PATH                          TIME      SIZE
  ──────────────────────────────────────────────────────────────────────────────────────────────
  GET     200     api.example.com               /v1/reports/summary          1284ms    42.1KB
  POST    200     api.example.com               /v1/search                   891ms     8.3KB
  GET     200     api.example.com                /v1/users/12345/orders      612ms     15.7KB

  3 total (showing 3, offset 0)

Narrow it down further to find patterns, such as a single host or a specific method:

# Slow requests to a specific service
laurel-proxy requests --slow 500 --host api.example.com --format table

# Slow requests in JSON, for scripting or further analysis
laurel-proxy requests --slow 1000 --format json

Sort by eye across the table — the endpoints appearing most often are the ones worth profiling or caching first.

With Your AI Agent

With the AI Agent Plugin, ask directly for the slow paths:

You: "Which of my API endpoints are slow?"

Your agent queries: laurel-proxy requests --slow 500 --format agent
The agent reads the durations and URLs, groups repeat offenders, and
points you at the endpoints worth optimizing first.

Because --format agent includes the request and response bodies alongside timing, your agent can also flag things like large uncompressed payloads or N+1-shaped query patterns while it's in there.