Is this error from ACE or from the provider?
Read the x-ace-error response header: present on every error ACE originated, absent on a vendor error relayed from upstream.
Symptom
A call through ACE returns a 401, 429 or 5xx and it is not clear whether the gateway refused it or the provider did — and so whether to fix the ACE key, the provider key, or back off.
Cause
ACE relays a vendor's error verbatim, in the vendor's envelope. Its own refusals carry the response header x-ace-error: <type> on every surface, whatever envelope the body wears; a relayed vendor error — a real provider 429, a provider 401 for a bad pass-through key — never does.
Fix
Branch on the header first. No x-ace-error: the provider said this, and its own type and code mean what they say. x-ace-error present: look its value up in the error taxonomy — re-mint an ACE key on invalid_developer_key, surface budget_exhausted to a person, back off on rate_limited or overloaded.