Skip to content

Encountering a "Permission denied" error while using an API #356

Open
@stan1233

Description

@stan1233

Description of the bug:

When encountering a "Permission denied" error while using an API, does it imply that there's an issue with my account? Could you please advise on how to resolve this problem?

curl \
  -H 'Content-Type: application/json' \
  -d '{"contents":[{"parts":[{"text":"Write a story about a magic backpack"}]}]}' \
  -X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=AIzaSyAhTarnL1PaQn_yu_uVf0gia9wUyJx8RSI'
{
  "error": {
    "code": 403,
    "message": "Permission denied: Consumer 'api_key:AIzaSyAhTarnL1PaQn_yu_uVf0gia9wUyJx8RSI' has been suspended.",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "CONSUMER_SUSPENDED",
        "domain": "googleapis.com",
        "metadata": {
          "service": "generativelanguage.googleapis.com",
          "consumer": "projects/578829824020"
        }
      }
    ]
  }
}

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:supportHow to do xyz?status:triagedIssue/PR triaged to the corresponding sub-teamtype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions