How to hit the Amazon Bedrock API

Amazon Bedrock serves models from many providers on AWS. Normally that needs AWS request signing, which curl can't do by hand — but Bedrock API keys work as a plain Bearer token. The Converse API gives every model the same request shape.

Authentication

Create a Bedrock API key in the AWS console under Amazon Bedrock → API keys, and send it as Authorization: Bearer <key>. In the examples it's written {{AWS_BEARER_TOKEN_BEDROCK}}. The region in the URL must be one where you have model access.

Full reference: https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys-use.html

Converse with a model

Model id from AWS's own example.

curl -X POST "https://bedrock-runtime.us-east-1.amazonaws.com/model/us.anthropic.claude-sonnet-4-6/converse" \
  -H "Authorization: Bearer {{AWS_BEARER_TOKEN_BEDROCK}}" \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": [{"text": "Hello"}]}]}'
Run in PostTaco