Description
When routing AWS Bedrock requests through the AI Gateway, token usage and cost aren't tracked in the dashboard. Requests log correctly (status, model, latency), but usage shows "– in / – out" and cost shows "$ –".
Cause
The Bedrock Converse API returns usage in camelCase, but the gateway only appears to parse snake_case fields:
Bedrock response:
{
"usage": {
"inputTokens": 13,
"outputTokens": 12,
"totalTokens": 25
}
}
OpenAI response (tracked correctly):
{
"usage": {
"input_tokens": 761,
"output_tokens": 3441,
"total_tokens": 4202
}
}
Steps to Reproduce
- Route Bedrock requests through AI Gateway using the documented URL rewriting approach
- Make a request to any Bedrock model (e.g. Claude Sonnet 4.6)
- Check the AI Gateway logs — tokens and cost are missing
Related
Description
When routing AWS Bedrock requests through the AI Gateway, token usage and cost aren't tracked in the dashboard. Requests log correctly (status, model, latency), but usage shows "– in / – out" and cost shows "$ –".
Cause
The Bedrock Converse API returns usage in camelCase, but the gateway only appears to parse snake_case fields:
Bedrock response:
{ "usage": { "inputTokens": 13, "outputTokens": 12, "totalTokens": 25 } }OpenAI response (tracked correctly):
{ "usage": { "input_tokens": 761, "output_tokens": 3441, "total_tokens": 4202 } }Steps to Reproduce
Related