AnyLearn
All lessons
AIintermediate

Bedrock: One Door to Many Models

Amazon Bedrock's pitch is that model choice becomes a configuration value instead of a rewrite. This lesson takes that claim apart: the four API dialects Bedrock exposes over the same models, what the unified Converse API actually normalises, what it cannot normalise, and the inference and governance machinery that decides cost and blast radius.

Updated · AI-authored, review-gated · how lessons are made

Not signed in: your progress and quiz score won't be saved.
Progress1 / 7

The problem Bedrock is answering

Calling a hosted model directly is easy. Calling six of them, from an enterprise, is not, and the difficulty is rarely the HTTP request.

It is that each provider brings its own account, its own billing relationship, its own SDK and request envelope, its own key material to store and rotate, and its own answer to where your data goes and whether it trains anything. Multiply that by a procurement and security review per vendor, and "try the new model" becomes a quarter-long project rather than an afternoon.

Amazon Bedrock is AWS's answer: a managed service offering access to foundation models from many providers behind one AWS account, one set of IAM permissions, one billing line, and one network boundary. AWS states Bedrock supports over 100 foundation models from providers including Amazon, Anthropic, DeepSeek, Moonshot AI, MiniMax and OpenAI.

Key idea: Bedrock's product is not the models, which you could reach elsewhere. It is the removal of per-vendor overhead: identity, billing, data governance and network path become AWS's existing machinery, which a regulated enterprise has already approved once.

Full lesson text

All 7 steps on one page, for reading, reference, and search.

Show

1. The problem Bedrock is answering

Calling a hosted model directly is easy. Calling six of them, from an enterprise, is not, and the difficulty is rarely the HTTP request.

It is that each provider brings its own account, its own billing relationship, its own SDK and request envelope, its own key material to store and rotate, and its own answer to where your data goes and whether it trains anything. Multiply that by a procurement and security review per vendor, and "try the new model" becomes a quarter-long project rather than an afternoon.

Amazon Bedrock is AWS's answer: a managed service offering access to foundation models from many providers behind one AWS account, one set of IAM permissions, one billing line, and one network boundary. AWS states Bedrock supports over 100 foundation models from providers including Amazon, Anthropic, DeepSeek, Moonshot AI, MiniMax and OpenAI.

Key idea: Bedrock's product is not the models, which you could reach elsewhere. It is the removal of per-vendor overhead: identity, billing, data governance and network path become AWS's existing machinery, which a regulated enterprise has already approved once.

2. Four dialects over the same models

The part that surprises people reading the documentation for the first time: Bedrock does not expose one API. It exposes several, deliberately, and choosing between them is the first real decision.

APIShapeWhy it exists
ConverseAWS-native, one schema for every modelPortability: swap modelId, keep the code
InvokeRaw provider-native JSON bodyFull access to provider-specific fields
MessagesAnthropic's own SDK shapeExisting Anthropic code runs unchanged
Responses / Chat CompletionsOpenAI's SDK shapesExisting OpenAI code runs unchanged

The compatibility dialects are a migration strategy rather than a design: code written against another provider's SDK can be pointed at Bedrock by changing the client configuration, which removes the rewrite that would otherwise block adoption.

Converse is the one to reach for on new work, because it is the only surface where the request and response shapes stay constant across providers:

import boto3
client = boto3.client("bedrock-runtime", region_name="us-east-1")
resp = client.converse(
    modelId="anthropic.claude-opus-4-7",
    messages=[{"role": "user", "content": [{"text": "Summarise this ticket."}]}],
)

3. What portability actually buys, and what it does not

The Converse promise is narrow and worth stating exactly, because teams routinely over-read it.

Predict first

You change one line, modelId, from a Claude model to Amazon Nova. Your code compiles and runs. What have you actually verified about the swap?

Gotcha: the same trap appears one level up. Because the API is uniform, a model swap looks like a config change in code review, so it can bypass the scrutiny a behavioural change would get. Teams that run models through an evaluation gate treat modelId as versioned configuration, pinned per environment and promoted deliberately.

4. How you pay for capacity

Inference is bought in more than one way, and the choice is an availability decision as much as a cost one.

  • On-demand. Pay per token with no commitment. Simple, and subject to shared capacity: under regional load you can meet throttling, which your application must treat as a normal condition rather than an incident.
  • Provisioned throughput. Reserve dedicated capacity in model units for a committed term. Predictable performance and price, paid whether or not you use it, and the usual home for latency-sensitive production traffic.
  • Batch. Submit a large job and collect results later, at lower cost, for work with no interactive deadline: backfills, bulk classification, evaluation runs.
  • Cross-region inference. Route requests across regions to absorb spikes, which raises effective throughput and makes the question "where was this processed" a compliance matter you should answer before enabling it.

In practice: the failure mode nobody plans for is throttling under on-demand during a launch. Build retry with backoff and a fallback model path from the first day, because the difference between a degraded feature and an outage is usually whether that path existed before it was needed.

5. Where a request actually goes

Tracing one call end to end explains both the governance story and the latency budget.

Your application calls the Bedrock runtime endpoint with AWS credentials. IAM authorises the specific action against the specific model, which is where per-model access control lives: a role can be permitted to call one model family and denied another. If a guardrail is configured, the input is screened before it reaches the model, and the output is screened before it reaches you. The model itself runs inside AWS.

Two consequences follow from the shape. Access control is IAM, not an API key in a config file, so the mechanism for "who may call the expensive model" is the same mechanism you already use for S3 buckets. And screening is a service-side interception rather than something your code does, which means it applies even to callers who forgot to implement it.

The cost of that shape is a hop: every call is an AWS API call, with AWS's authentication, quotas and regional endpoints in the path.

flowchart LR
A["Application"] --> B["Bedrock runtime endpoint"]
B --> C["IAM: is this role allowed this model?"]
C --> D["Guardrail screens the input"]
D --> E["Foundation model runs inside AWS"]
E --> F["Guardrail screens the output"]
F --> G["Response, plus token usage for billing"]

6. Guardrails and Knowledge Bases

Two managed pieces sit beside the model layer and are worth understanding as boundaries rather than features.

Guardrails apply configurable policies to inputs and outputs: denied topics, content filters, word filters, sensitive-information detection with masking or blocking, and checks intended to reduce ungrounded responses. Because they attach to the call rather than the code, one policy covers every application that uses the model, and the policy is auditable independently of the applications.

Knowledge Bases provide managed retrieval-augmented generation: point it at a data source, it handles chunking, embedding, vector storage and retrieval, and returns answers with citations. It is the standard trade of a managed RAG pipeline, fast to stand up, less controllable than building the pieces yourself, and the retrieval mechanics it hides are exactly what the catalogue's RAG courses cover in depth.

Definition: a guardrail is a policy enforced outside the application, so its guarantee does not depend on every caller implementing it correctly. That property, not the filter list, is what makes it worth using.

Together these are the model layer. Everything so far assumes one request and one response. An agent is a loop of many, and that is where AgentCore begins.

7. Reading the lock-in question honestly

Any managed platform raises the question, and it deserves a real answer rather than either sales copy or reflex.

What is genuinely portable: the models themselves, since the same families are offered by their vendors and other clouds; and the Converse-shaped request, which is close enough to every other chat API that a translation layer is a small piece of code.

What is not: the surrounding services. Guardrail configurations, Knowledge Base ingestion, IAM policy structure, and the AgentCore services in the rest of this course are AWS-specific, and re-implementing them elsewhere is real work.

The honest framing is that the lock-in is proportional to how much of the platform you adopt, and so is the benefit, which makes it a deliberate trade rather than a trap. A team using Bedrock purely as a model endpoint keeps its options and gets little beyond consolidated billing and IAM. A team using Guardrails, Knowledge Bases, Gateway and Memory has bought a great deal of leverage and has correspondingly more to rebuild.

Key idea: the useful question is not "is this lock-in" but "which layer am I buying, and would I rebuild it if I had to". Answer it per service, before adoption, and the trade stays visible instead of accumulating silently.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. What does Amazon Bedrock primarily remove for an enterprise?
    • The need to write prompts for each model
    • Per-vendor overhead: separate accounts, billing, SDKs, key management and data-governance reviews collapse into existing AWS machinery
    • The cost of inference relative to calling providers directly
    • The need to evaluate models before switching between them
  2. Why does Bedrock expose Messages, Responses and Chat Completions APIs alongside its own Converse API?
    • Each supports a different subset of models
    • They offer lower latency than Converse
    • They let code written against another provider's SDK run against Bedrock without a rewrite
    • Converse is deprecated in favour of them
  3. You change only the modelId in a Converse call and the code still runs. What has been verified?
    • That the new model produces equivalent output quality
    • That prompts tuned for the previous model still apply
    • That token costs are unchanged
    • Only that the request and response shapes matched, since Converse normalises the envelope and not behaviour, cost, context window or tool-call reliability
  4. Which inference option suits latency-sensitive production traffic that must not be throttled?
    • Provisioned throughput, which reserves dedicated capacity for a committed term
    • On-demand, which scales automatically with no commitment
    • Batch, which processes large jobs at lower cost
    • Cross-region inference, which spreads load geographically
  5. What property makes a Bedrock Guardrail meaningfully different from filtering inside your application?
    • It runs faster than in-process filtering
    • It is enforced outside the application, so the guarantee does not depend on every caller implementing it correctly
    • It can filter content that the model has not generated yet
    • It replaces the need for IAM permissions on the model

Related lessons

Programming
beginner

The Shape of AWS: Regions, Accounts, and Who Secures What

AWS offers hundreds of services, which makes it look like a catalogue to memorise. It is not. This lesson gives the four structures everything else hangs from: the physical geography of regions and availability zones, the account as a blast-radius boundary, IAM as the one gatekeeper every call passes, and the responsibility line between you and the provider.

7 steps·~11 min
Programming
beginner

Networking and the Bill: Where the Surprises Live

Two things reliably surprise teams new to AWS: the network they must build before anything can talk, and an invoice driven by charges nobody chose deliberately. The two are connected, because moving data is where much of the cost hides. This lesson covers the virtual network primitives, the traffic charges that follow from them, and how to read a bill.

7 steps·~11 min
Programming
beginner

Storage and Data: Three Shapes, and Choosing a Database

Cloud storage looks like a long product list and is really three physical shapes, object, block and file, each with an access pattern it is built for and one it is bad at. This lesson covers those three, the difference between durability and availability that people conflate, what eleven nines actually means at scale, and how to choose a database by access pattern.

7 steps·~11 min
Programming
beginner

The Compute Spectrum: Machines, Containers, Functions

AWS offers several ways to run code, and they are not competitors so much as points on one spectrum trading control for operational relief. This lesson walks that spectrum from virtual machines to serverless functions, what you hand over at each step, the cold-start and state constraints that decide fit, and the honest cases where serverless is the wrong answer.

7 steps·~11 min