1 Answer
- Newest
- Most votes
- Most comments
2
Hi.
For Bedrock models, those fields are http headers, not in the response body itself. Look at this example of mine that I just run:
{
"ResponseMetadata": {
"RequestId": "b930f59e-9fb1-46b9-93ac-b8a1ed57277c",
"HTTPStatusCode": 200,
"HTTPHeaders": {
"date": "Mon, 03 Jun 2024 12:44:39 GMT",
"content-type": "application/json",
"content-length": "1204",
"connection": "keep-alive",
"x-amzn-requestid": "b930f59e-9fb1-46b9-93ac-b8a1ed57277c",
"x-amzn-bedrock-invocation-latency": "3029",
"x-amzn-bedrock-output-token-count": "225",
"x-amzn-bedrock-input-token-count": "18"
},
"RetryAttempts": 0
},
"contentType": "application/json",
"body": "<botocore.response.StreamingBody object at 0x1038ae020>"
}
Best,
Didier
Relevant content
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 9 months ago

Thanks, this is exactly what I was looking for.
Lutti, you're welcome! Thanks for accepting my answer.