AI Gateway - Standardize provider credential error responses in AI Gateway
- Announced
- Tags
- AI-Gateway
- Severity
- info, set by
reef/rss-rule-v1 - Source
- https://developers.cloudflare.com/changelog/post/2026-10-05-provider-credential-errors/
<p>AI Gateway's REST API now returns consistent responses when an AI provider rejects credentials. The change applies to <a href="https://api.cloudflare.com/client/v4/accounts/%7BACCOUNT_ID%7D/ai/run" target="_blank" rel="noopener"><code>POST /ai/run</code><span class="external-link"> ↗︎</span></a>.</p> <div class="table-scroll" tabindex="0" role="region" aria-label="Table"><table> <thead> <tr> <th>Scenario</th> <th>Previous AI Gateway response</th> <th>New AI Gateway response</th> </tr> </thead> <tbody> <tr> <td>ElevenLabs</td> <td>Provider-specific <code>UserCredentialsError</code> with HTTP <code>403</code></td> <td>HTTP <code>401</code> with error code <code>2009</code></td> </tr> <tr> <td>Google Vertex</td> <td>HTTP <code>500</code> for rejected credentials, with upstream retries</td> <td>HTTP <code>401</code> with error code <code>2009</code>; the request fails without retrying the provider</td> </tr> <tr> <td>All other providers</td> <td>HTTP <code>402</code> or another provider-specific status for rejected credentials</td> <td>HTTP <code>401</code> with error code <code>2009</code></td> </tr> <tr> <td>When using <a href="https://developers.cloudflare.com/ai-gateway/features/unified-billing/">Unified Billing</a>, the provider rejects the credentials</td> <td>Provider-specific authentication error</td> <td>HTTP <code>503</code></td> </tr> </tbody> </table></div> <p>Update applications that handle AI Gateway REST API errors to treat HTTP <code>401</code> as an invalid or rejected provider credential.</p> <p>For details about providing provider credentials, refer to <a href="https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/">Bring your own provider keys</a>.</p>
The text above is the source's. reef added the severity, the dates it could read from the text, and the endpoints and scopes named in code.