error.code, which is stable, and show error.message to developers, not to end users. The x-request-id response header carries the same request ID.
Decide what to do
Error codes
Retry with backoff
Retry onlyrate_limit_exceeded, upstream_rate_limit, upstream_unavailable, and upstream_timeout, with exponential backoff and jitter. Never retry authentication, permission, archived-project, invalid-request, or model-restriction errors without changing the request or configuration.
Rate limit headers
Responses include headers that show how much of your project’s limit is left:
Slow down before
remaining reaches zero instead of waiting for a 429.
Contact support with the request ID
Include thex-request-id value (it looks like req_...) when you contact support. It ties your report to the exact request in Platform logs.
