博文

目前显示的是 九月, 2026的博文

A 200 That Means No: The API Failure Mode Nobody Files a Bug For

Every API has a failure mode its authors never see, because from the inside it doesn't look like a failure at all. It returns 200 OK . The body parses. The schema validates. And somewhere downstream a developer spends forty minutes debugging a request that was refused before it ever ran. I shipped one of these. Then I integrated against it and it caught me — my own API, my own error handling, forty minutes gone. That's what convinced me it's worth writing down as a pattern rather than a bug report. The shape Here's a real refusal, from an image generation endpoint that meters anonymous usage: {"code": 0, "message": "ok", "data": { "wall": true, "reason": "anon_credits", "cost": 5, "remaining": 0 }} Status code: 200 . Application code: 0 . Message: "ok" . The only thing indicating that nothing happened is data.wall , four levels into the payload. Now here...