API Families
Bedrock organizes its APIs into families based on how you want to interact with models. Here’s the breakdown:
Invoke Family
- InvokeModel — synchronous, single-response calls. The basic one.
- InvokeModelWithResponseStream — returns responses as a real-time stream.
- InvokeModelWithBidirectionalStream — full-duplex streaming for interactive applications.
- AsyncInvoke — submits long-running requests asynchronously, stores output to S3.
Converse Family
- Converse — unified, model-agnostic interface for synchronous multi-turn conversations. This is the one you want for most chat use cases.
- ConverseStream — same as above but with streaming output.
OpenAI-Compatible Family
- ChatCompletions — implements the OpenAI Chat Completions interface. Existing OpenAI-based integrations can run on Bedrock with minimal changes.
- Responses API — implements the OpenAI Responses interface, supports stateful, agentic interactions with built-in tool use and conversation history management.
Messages Family
- Messages — implements the Anthropic Messages interface on the bedrock-mantle endpoint. Existing Anthropic SDK-based integrations can run on Bedrock with minimal changes.
OpenAI Compatibility
This is a big deal — you can bring your existing OpenAI SDK code to Bedrock by just changing the base URL and API key. Same goes for Anthropic SDK code via the Messages API. No rewrite needed.
Endpoint Types
Three routing options depending on your data residency and performance needs:
| Type | Routing | Throughput | Pricing | When to Use |
|---|---|---|---|---|
| In-Region | Stays in your specified AWS Region | Limited to single-Region capacity; subject to per-Region quotas | Standard on-demand pricing | Regulations require strict single-Region data processing |
| Geographic (Geo) | Routes within a geography (US, EU, Japan, Australia) | Higher than In-Region; absorbs regional traffic spikes | Source Region rates; no surcharge for cross-Region routing | Data residency tied to a geography, not a single Region |
| Global | Routes across all commercial Regions worldwide | Highest; uses global capacity | Source Region rates; no surcharge | No data residency constraints, want best performance and price |
When to Use bedrock-mantle vs bedrock-runtime
Use bedrock-mantle when you want to:
- Use the Responses API, Chat Completions API, or Messages API with stateful, multi-turn conversations
- Bring existing OpenAI SDK code by changing only the base URL and API key
- Run asynchronous or long-running inference workloads
- Build agentic workflows with server-side tool use or pre-configured tools
- Use Projects (OpenAI-compatible) or Workspaces (Anthropic-compatible) to isolate workloads and track cost/usage at the application level
Use bedrock-runtime when you want to:
- Continue using the Bedrock-native InvokeModel or Converse APIs
- Use a model that isn’t yet available on bedrock-mantle
Inference Parameters
Temperature
Affects the probability distribution for predicted output.
- Lower value → model selects higher-probability outputs → more deterministic
- Higher value → model selects lower-probability outputs → more random/creative
In technical terms — temperature modulates the probability mass function for the next token. Lower steepens the function, higher flattens it.
Top K
The number of most-likely candidates the model considers for the next token.
- Lower value → smaller pool → more likely outputs only
- Higher value → larger pool → considers less likely outputs
Example: Top K = 50 means the model picks from 50 most probable next tokens.
Top P
The percentage of most-likely candidates considered.
- Lower value → smaller pool → more constrained
- Higher value → larger pool → more diverse
Adaptive Thinking (Claude Opus 4.6)
The recommended way to use Extended thinking with Claude. Instead of manually setting a thinking token budget, adaptive thinking lets Claude dynamically decide when and how much to think based on complexity.
"thinking": {"type": "adaptive"},
"output_config": {"effort": "high"}Guardrails
Guardrails protect your input/output. Few key things to know:
Required Headers
X-Amzn-Bedrock-GuardrailIdentifier(required) — The ID of the guardrailX-Amzn-Bedrock-GuardrailVersion(required) — The version of the guardrailX-Amzn-Bedrock-Trace(optional) — Enable guardrail trace
Modes
- Synchronous mode (default) — buffers and applies policies before sending response back. Adds latency but ensures compliance.
- Asynchronous mode — sends response chunks immediately while applying policies in the background. No latency impact, but content may be flagged after delivery.
Special Features
- Mask — anonymize content and replace with identifier tags ({NAME}, {EMAIL}). Available only with sensitive information filters.
- Automated Reasoning checks — operate in detect mode only. They return findings and feedback rather than blocking content.
Caching and Logging
- When
storeis true (the default), Bedrock retains the response (input + output) for 30 days in the source region. - Invocation logging — collects full request data, response data, and metadata for all supported calls in your account/Region.
- Cache checkpoints — have minimum and maximum token limits depending on the model. Your prompt prefix must meet the minimum to create a checkpoint.
Service Comparison : What to Use When
| Requirement | Best Service | Why |
|---|---|---|
| Lowest latency vector search | OpenSearch | Optimized ANN search |
| Cheapest vector storage | S3 Vectors | Low storage cost |
| Enterprise search with connectors | Kendra | Built-in connectors and ACLs |
| RAG without managing infrastructure | Knowledge Bases | Fully managed ingestion and retrieval |
| AI workflow (prompt-centric) | Bedrock Flows | Prompt-centric orchestration |
| Business workflow / decision making | Step Functions | AWS service orchestration, branching logic |
| AI chooses actions | Agents | Dynamic planning and tool use |
| Block harmful prompts | Guardrails | Input/output protection |
| Compare LLMs | Model Evaluation | Built for FM evaluation |
| Speech to text | Transcribe | ASR service |
| OCR / Document extraction | Textract | Structured data from documents |
| Image analysis | Rekognition | Computer vision |
| PII finding and redaction | Comprehend | NLP-based PII detection and redaction |
| Traditional ML | SageMaker | End-to-end ML lifecycle |
| Foundation models | Bedrock | Managed access to FMs |
| Serverless compute / glue code | Lambda | Event-driven execution, integrations |
Vector Store Comparison
| Factor | OpenSearch | S3 Vectors | Kendra | Bedrock Knowledge Bases |
|---|---|---|---|---|
| Purpose | High-performance vector search | Low-cost vector storage | Enterprise search | Managed RAG |
| Latency | Lowest | Medium | Fast | Fast |
| Scale | Millions to billions of vectors | Extremely large datasets | Enterprise documents | Depends on backend |
| Cost | Higher | Lowest | High | Medium |
| Semantic Search | Yes | Yes | Yes | Yes |
| Keyword Search | Yes, Excellent | No | Yes, Excellent | Via backend |
| Hybrid Search | Yes | No | Yes | Backend dependent |
| Metadata Filtering | Excellent | Basic | Excellent | Managed |
| Operational Effort | Medium | Low | Low | Very Low |
| Best For | Production RAG with low latency | Cheap vector lake | Enterprise document search | GenAI applications |
PII Finding vs Redaction : Decision Matrix
Different services handle PII at different levels — storage, processing, inference. Here’s how to decide what goes where:
| Service | Level | PII Finding | PII Redaction | When to Use |
|---|---|---|---|---|
| Amazon Comprehend | Data processing | Yes — detects PII entities in text | Yes — redacts PII in text output | Batch or real-time NLP processing of documents/text before storage or inference |
| Amazon Macie | Storage (S3) | Yes — scans S3 buckets for PII | No — detection and alerting only | Discovering PII in existing S3 data lakes, compliance audits |
| AWS Glue | ETL / Data pipeline | Yes — detect PII columns via Sensitive Data Detection transform | Yes — mask/redact during ETL jobs | Cleaning PII during data pipeline processing before it reaches downstream systems |
| Amazon S3 | Storage | No (needs Macie or Comprehend) | No (needs processing layer) | Store data; pair with Macie for discovery or Glue for pipeline redaction |
| Amazon Textract | Document extraction | Yes — identifies PII in extracted text via queries | No — extraction only, pair with Comprehend for redaction | Extracting structured data from scanned documents, then passing to Comprehend for PII handling |
| Bedrock Guardrails | Inference (real-time) | Yes — sensitive info filters detect PII in prompts/responses | Yes — masks PII with tags like {NAME}, {EMAIL} | Protecting LLM inputs/outputs at inference time, blocking or masking PII in real-time |
How They Work Together
- At rest (S3) — Macie scans and alerts on PII sitting in buckets. Detection only, no modification.
- In pipeline (Glue) — Redact PII during ETL before data lands in analytics or training datasets.
- In documents (Textract + Comprehend) — Textract extracts text from PDFs/images, Comprehend finds and redacts PII in that extracted text.
- At inference (Guardrails) — Last line of defense. Masks PII in prompts going to the model and in responses coming back.
- In text processing (Comprehend standalone) — Use for batch PII detection/redaction on any text corpus.
Quick Decision Guide
| Question | Answer |
|---|---|
| Need to find PII in S3 buckets? | Macie |
| Need to redact PII in data pipelines? | Glue (Sensitive Data Detection) |
| Need to redact PII in text/documents? | Comprehend |
| Need to extract text from scanned docs first? | Textract → Comprehend |
| Need to block/mask PII at LLM inference? | Bedrock Guardrails |
| Need end-to-end PII protection? | Macie (discovery) + Glue (pipeline) + Guardrails (inference) |