AI agents write API integrations fast, and I love them for it. But they also ship a very particular kind of bug that's a pain to catch in review. The code reads fine. The types line up. And then the call blows up at runtime, because the model learned the wrong shape somewhere along the way. After looking at a couple hundred projects, the same handful of patterns kept showing up. Here they are.
Wrong method signatures
The model picked up client.emails.send(to, from, subject, html) from older examples. The current SDK wants client.emails.send({ to, from, subject, html }). It compiles. TypeScript waves it through if your types are loose. Then it fails at runtime with an error that looks, misleadingly, like a network hiccup.
Deprecated endpoints
Models learn from code that predates the deprecations. If a provider retired an endpoint six months ago, the model will still cheerfully generate calls to it. Maybe it still works. Maybe it returns a 410. Either way, you're living on borrowed time and you don't know it yet.
Missing required fields
Some API calls have required fields that the type system never enforces. The model leaves them out, either because they weren't always required or because they didn't show up much in its training examples. You get back a 400 and an error message you basically have to read the docs to decode.
Incorrect authentication patterns
Auth is where hallucinations really thrive, because the patterns swing wildly from provider to provider and keep changing over time. So the model produces auth code that looks completely reasonable and fails anyway, usually because it quietly blended two different providers' conventions together.
How to catch them before production
Here's the good news: every one of these patterns can be written down as a static rule. api-doctor ships rules for exactly these failure modes, pulled from current provider documentation. Run it before you commit and none of it reaches production.
npx @api-doctor/cli .