Google documents HTTP 403 as a permission failure for the requested resource. Investigate the key's project, API restrictions, and resource access. Do not assume that rotating a key or retrying more slowly can grant the missing permission.
Keep authentication and permission checks distinct
The Interactions reference uses permission_denied for HTTP 403 and separately documents authentication for a missing, invalid, or expired key. GenerateContent uses an uppercase PERMISSION_DENIED status in its legacy error envelope. This distinction identifies the documented error category; it does not prove that every other resource, endpoint, or credential check has succeeded.
Do not generalize a successful model listing into proof that the requested inference operation, external file, or feature is authorized. Capture which operation failed and whether the error arrived before processing, during a stream, or while retrieving an asynchronous result.
Trace the deployed credential to its project
| Check | Evidence to collect |
|---|---|
| Secret source | A non-secret reference or deployment version identifying which configured credential the running service loads. |
| Owning project | The project associated with that key, compared with the project whose access you configured. |
| Restrictions | The intended API and applicable application or network restrictions, checked against the actual runtime. |
| Resource | The exact model, file, tool, or other resource and its access requirements for this interface. |
A notebook and deployed worker can use different secrets and outbound networks even when the source code matches. Inspect the live configuration, not only the local environment file. Keep key values, key fragments, authorization headers, and full environment dumps out of logs.
Make the smallest authorized change
If the key belongs to the wrong project, correct the secret reference. If a restriction does not match the intended deployment, have the owner review that restriction. If the feature is unavailable to the project or model, use the documented access path or a supported alternative. Do not remove every restriction as a universal troubleshooting step.
Google's key documentation and current troubleshooting guide describe blocked leaked keys. Replacement is appropriate when a key is exposed or revoked; it is not evidence that a project-level permission problem has disappeared. Keep separate credentials and ownership labels for environments where that improves isolation.
The current key guide distinguishes standard keys from authorization keys bound to a service account. It says newly created AI Studio keys have used authorization keys by default since May 28, 2026, and unrestricted standard keys are rejected while explicitly restricted standard keys continue to work. Check the actual key type and its service-account or project access; removing restrictions can make this situation worse.
Retest the operation that failed
After an authorized change, verify a bounded version of the same operation through the deployed account and network path. Record the outcome without exposing request content. If it changes to a missing-resource error, inspect that resource rather than undoing the permission fix. If a prerequisite remains, resolve it separately.
No account permissions, console changes, or authenticated API calls were tested for this guide. Google documents the error category and access checks; the exact permission path depends on the project and operation. A repeated 403 should stop automatic retry and surface a useful configuration error.