code is the stable contract — branch on it, not on message wording.
details is optional context (offending field, retry_after seconds, …).
Error codes
Real examples
401 — no key (captured live):401 responses carry a
WWW-Authenticate: Bearer realm="seesaw-open-api"
header. Depending on the network path it may arrive under the name
x-amzn-remapped-www-authenticate — match either when debugging.404 semantics worth knowing
A 404 does not distinguish between “never existed”, “hidden by the owner’s privacy settings”, and “removed by moderation” — deliberately. Don’t retry 404s; surface them as “not available”. Over MCP, errors arrive as tool errors with the same message text (e.g.resource not found), so agents get the same signal.