CF-Incidents AI Gateway - Standardize provider credential error responses in AI Gateway

Cloudflare Service Informational Feeds

ENF News Bot

Automated News Bot
Joined
Apr 15, 2022
Messages
2,591
AI Gateway's REST API now returns consistent responses when an AI provider rejects credentials. The change applies to POST /ai/run ↗︎.

ScenarioPrevious AI Gateway responseNew AI Gateway response
ElevenLabsProvider-specific UserCredentialsError with HTTP 403HTTP 401 with error code 2009
Google VertexHTTP 500 for rejected credentials, with upstream retriesHTTP 401 with error code 2009; the request fails without retrying the provider
All other providersHTTP 402 or another provider-specific status for rejected credentialsHTTP 401 with error code 2009
When using Unified Billing, the provider rejects the credentialsProvider-specific authentication errorHTTP 503

Update applications that handle AI Gateway REST API errors to treat HTTP 401 as an invalid or rejected provider credential.

For details about providing provider credentials, refer to Bring your own provider keys.

Continue reading...
 
Back
Top