aws-samples / bedrock-access-gateway

OpenAI-Compatible RESTful APIs for Amazon Bedrock
MIT No Attribution
124 stars 24 forks source link

502 Bad Gateway on Lambda #27

Open oemd001 opened 5 days ago

oemd001 commented 5 days ago

I'm getting a 502 bad gateway when I followed the guide. This is my request:

curl $OPENAI_BASE_URL/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "anthropic.claude-3-sonnet-20240229-v1:0",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'

This is my response:

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>

I also created this on US-WEST-2 (Oregon). I'm not sure what could be the cause of this issue?

I was able to verify that my API key is correct, and the URL is correct. I'm not sure what part of this am I doing incorrectly.

daixba commented 5 days ago

Sorry, I can't reproduce this issue, can you please check if you have enable the access to Sonnet model in Bedrock console.

Also, you can try with below request and see if get a successful response. curl -s $OPENAI_BASE_URL/models -H "Authorization: Bearer $OPENAI_API_KEY"