Can I Call the Bedrock API with Curl Without Signing?

0
20
Asked By CuriousCactus84 On

I'm trying to figure out if there's a way to use the Bedrock API without signing the requests, specifically using raw curl. In Postman, I can just use my AWS access ID and secret key, which is super convenient. I've generated a Bedrock API key, but it seems I have to sign each request. Is there any way around this, maybe by computing the signature ahead of time or using something other than an SDK or CLI?

5 Answers

Answered By CurlExpert33 On

Curl actually supports AWS SigV4 signing right out of the box. If you're using temporary credentials, you'll need to manually include the session token in the headers, but it should work fine after that.

CuriousCactus84 -

I just tried it with my Bedrock API key but got an error about needing a signature. Do I need to use the AWS secret ID/key instead?

Answered By CurlWizard29 On

You can definitely sign requests with curl using AWS SigV4. Here's a link that explains how to do that: https://how.wtf/aws-sigv4-requests-with-curl.html

CuriousCactus84 -

Wow, it works! Thank you so much! Now I'm facing a new issue with the byte stream response. I'm trying to get it to plain text, maybe by decoding it?

Answered By InfoSeeker01 On

If you're looking for alternatives, check out this guide that shows how to integrate Bedrock with API Gateway and Lambda. It might give you some useful insight!

CuriousCactus84 -

Thanks for the link! I'll give it a look!

Answered By LambdaLover92 On

You might want to consider creating a simple HTTP API on your own that sits on top of an AWS Lambda function. You can call the Bedrock API from that Lambda and expose it as a standard HTTP API with your custom API key.

Answered By TechGuru77 On

Just a heads up, if you're unsure about signing requests, sticking with Postman, the CLI, or an SDK might be a better choice for simplicity.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.