aws-samples / amazon-bedrock-client-for-mac

The Amazon Bedrock Client for Mac is a Bedrock macOS client built with SwiftUI.
MIT No Attribution
102 stars 16 forks source link

Unable to access API -- AWSBedrockRuntime.AccessDeniedException #1

Closed npow closed 6 months ago

npow commented 6 months ago

Hi, I can access the Bedrock chat in the AWS console, but cannot access Bedrock via this app. Is there something else that needs to be configured in order to get API access?

Error invoking the model: AccessDeniedException(properties: AWSBedrockRuntime.AccessDeniedException.Properties(message: Optional("Your account is not authorized to invoke this API operation.")), httpResponse: Status Code: http_status_403 x-amzn-ErrorType: AccessDeniedException:http://internal.amazon.com/coral/com.amazon.bedrock/, Content-Type: application/json, Content-Length: 74, x-amzn-RequestId: c9507833-2d9a-4f0f-b4c0-08ac3dd223f8, Date: Thu, 26 Oct 2023 20:39:03 GMT, Connection: keep-alive, message: Optional("Your account is not authorized to invoke this API operation."), requestID: nil)

didhd commented 6 months ago

Hi, @npow , is your credential aligned with AWS console user? Please refer this section: https://github.com/aws-samples/amazon-bedrock-client-for-mac#2-issues-with-aws-tokens

client uses ~/.aws/credentials

KoStard commented 6 months ago

I had similar issue, it turned out it's because the region where I activated the Bedrock access was not matching the one used in the client. You can check the region in the settings of the client.

npow commented 6 months ago

@KoStard Thanks, that was the problem!