Every failure from a public StellarFirm API route is JSON with the same shape. Branch on error.code: it is stable. The message and hint are for people and may be reworded.
json
{ "error": { "code": "not_found", "message": "There is no API route at /api/nothing-here.", "hint": "Read the route list at /openapi.json, or start at /docs/api.", "docs": "https://stellarfirm.ai/docs/api/errors" }}
Field
Meaning
code
A stable, machine-readable code.
message
What went wrong, in one plain sentence.
hint
What to do next.
docs
This page.
Failures are never cached. A 405 also carries an Allow header that lists the methods the route accepts.