Skip to main content

AWS Bedrock

Language

Examples use Python. Beakpoint works with any language that OpenTelemetry supports.

Required AWS Bedrock Attributes

The following cost calculation tags are required for traces originating from AWS Bedrock API calls.

Always Required Fields

These fields are always required for Beakpoint to calculate Bedrock costs:

Attribute NameExample ValueAllowed Values
gen_ai.systemaws.bedrockaws.bedrock (must be this exact value)
gen_ai.request.modelanthropic.claude-sonnet-4-20250514-v1:0Any valid Bedrock model ID
gen_ai.usage.input_tokens512Non-negative integer
gen_ai.usage.output_tokens128Non-negative integer

Optional Enrichment Attributes

These fields are optional but improve cost accuracy when provided:

Attribute NameExample ValueDescription
gen_ai.response.modelanthropic.claude-sonnet-4-20250514-v1:0The exact model version returned in the response. Used as a fallback if gen_ai.request.model is absent.
gen_ai.provider.nameaws.bedrockOTel semconv v1.37.0+ standardized attribute (replaces gen_ai.system). Use this for new instrumentation; Beakpoint accepts both, but prefers gen_ai.provider.name when present.
cloud.providerawsProvider identification.

Model ID Handling

Bedrock model IDs follow the format [region.]provider.model-name[-date]-v{version}[:{variant}]. Beakpoint automatically parses these to extract the underlying provider and model for pricing lookup. Pass the model ID exactly as Bedrock provides it — no normalization is needed on your part.

For details on how model IDs are parsed, see GenAI Cost Tracking — AWS Bedrock Model ID Parsing.

tip

Models from providers that Beakpoint already prices directly (Anthropic, OpenAI, Mistral, Meta, Cohere) use the same pricing whether called through Bedrock or through the provider's direct API. Bedrock does not add a per-token surcharge for these models.

Bedrock-Exclusive Models

The following models are available only through AWS Bedrock. Prices represent cost per 1 million input or output tokens, respectively.

ProviderModelDisplay NameInput ($/M)Output ($/M)
amazonnova-proAmazon Nova Pro$0.80$3.20
amazonnova-liteAmazon Nova Lite$0.06$0.24
amazonnova-microAmazon Nova Micro$0.035$0.14
metallama4-maverick-17b-128e-instructLlama 4 Maverick$0.20$0.60
metallama4-scout-17b-16e-instructLlama 4 Scout$0.15$0.30
mistralmistral-large-2411Mistral Large$2.00$6.00
mistralmistral-small-2501Mistral Small$0.10$0.30
coherecommand-r-plusCommand R+$2.50$10.00
coherecommand-rCommand R$0.15$0.60
note

Models from other providers (Anthropic Claude, OpenAI GPT) are also available on Bedrock and are priced using the same rates as the direct API. See the Anthropic Claude and OpenAI reference pages for those prices.

Python Example

The quickest way to emit the required attributes is with the opentelemetry-instrumentation-botocore package, which includes Bedrock extensions:

pip install opentelemetry-instrumentation-botocore
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor
import boto3

# Instrument before creating the client. For full TracerProvider setup including
# _GenAiSystemProcessor, see the Track LLM Costs guide (referenced at the end).
BotocoreInstrumentor().instrument()

client = boto3.client("bedrock-runtime")

response = client.invoke_model(
modelId="anthropic.claude-sonnet-4-20250514-v1:0",
contentType="application/json",
accept="application/json",
body='{"messages": [{"role": "user", "content": "Hello!"}], "max_tokens": 4096, "anthropic_version": "bedrock-2023-05-31"}',
)

The instrumentation automatically sets gen_ai.system, gen_ai.request.model, gen_ai.usage.input_tokens, and gen_ai.usage.output_tokens on each span.

For full setup instructions, including how to configure the OpenTelemetry exporter for Beakpoint, see the Track LLM Costs guide.