The API worked. The payload didnโ€™t.
DEV Community

The API worked. The payload didnโ€™t.

The Problem

I kept shipping APIs I hadn't really looked at. I'd ask whatever assistant was open - Cursor, Claude, Antigravity, Trae - for a users endpoint. It generated the route, the DTO, the response. The page rendered. I moved on. Then I opened DevTools โ†’ Network.

  • Full objects on a list view
  • Nulls everywhere
  • Verbose keys
  • Extra timestamps
  • Fields the UI never used

Gzip made the response look small, so I ignored it. That was the mistake. Working is not the same as small.

The Real Cost

This is not only a backend problem. Frontend apps consume these payloads too. If the client receives something like 500KB and only needs 50KB, both sides pay for it, whether the contract was written by you, your team, or an agent. Compression hides sloppy JSON. It doesn't delete fields you shouldn't have sent.

A Normal-Looking User List

I ran through this on a user list that looked like:

  • 3.01 KB raw
  • Score: 52/100
  • About 54% of the bytes looked optional
  • Pretty-print whitespace alone: 904 B
  • The same preferences object repeated on every row: 528 B

Then Gzip crushed it to a few hundred bytes. That's how this survives code review. The wire looks fine. The shape is still fat.

What I Wanted Instead

I didn't want another dashboard. I didn't want a place where I paste a giant JSON blob and stare at charts. I wanted the same agent that wrote the endpoint to look at it and say: we don't need all this.

So I built BandwidthGuard.

Two Ways In

1. You Have the Response

Go to /analyze. Paste JSON, drop a HAR, or paste cURL. It stays in the browser. Nothing gets uploaded. You get:

  • A score
  • A field-level breakdown
  • Gzip / Brotli / Zstd / MessagePack / CBOR on that payload
  • Fixes split into:
    • Safe
    • Review with the team
    • This changes the contract

That last split matters more than the codec table. Minifying JSON is easy. Pulling email off a list endpoint is not the same kind of change.

2. You Don't Want to Paste JSON First

This is the path I actually use when I just generated the endpoint. On the homepage, open Feed Payload Insights into Your AI Coding Agent:

  • Pick Cursor, Claude, ChatGPT, Gemini, DeepSeek, Grok, or Antigravity
  • Type GET /v1/users or just User list
  • Copy the prompt
  • Drop it into the same chat that wrote the endpoint

The prompt already tells the agent to find bloat, clean the serializer, compare compression, show before/after, and check work in the analyzer. It also points to /llms.txt so the model isn't inventing a process.

Generate โ†’ inspect one payload, or skip straight to prompt โ†’ slim the serializer โ†’ paste the new response back if you want proof.

What This Is Not

  • It is not an APM.
  • It is not your cloud invoice.
  • It will not cut a bill by some fixed percentage just because Gzip exists.

If compression is already on, the useful win is structural: stop sending unused fields.

If You Try It

Use a list endpoint you didn't hand-write. Detail endpoints are usually less embarrassing. Then look at two things only:

  • Which fields are marked unused
  • Whether the suggested fix is safe or a contract change

Free. No account. Runs in the tab.

https://bandwidthguard.chidkoli.com/

I built this because I got tired of shipping apps that worked and still moved more data than they needed.

Cover image: the 5:2 two-card graphic (agent-cards-5x2-wide.jpg).

Top comments (0)

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.