Synchronous and asynchronous FM APIs

Lesson 1 of 4 in FM APIs, Streaming, and Application Wiring.

Bedrock's runtime surface is four operations in two families. Converse and ConverseStream are the unified conversation API: one request shape — messages, system, inferenceConfig, plus toolConfig for function calling and guardrailConfig for policy — that works across every Bedrock model that supports messages, so you write code once and swap models freely (model-specific knobs still fit, via additionalModelRequestFields). InvokeModel and InvokeModelWithResponseStream are the base operations underneath: the request body is each provider's native JSON, which means per-model code — the price of needing a model-specific feature the unified shape doesn't carry. Permissions map by behavior, not operation name: non-streaming calls authorize against bedrock:InvokeModel, streaming calls against bedrock:InvokeModelWithResponseStream — Converse and ConverseStream included.

For custom API clients in front of all this, the AIP-C01 exam guide names API Gateway with request validation: malformed requests die at the front door against a schema, before any Lambda runs or any token is billed.

The Bedrock runtime operations
OperationRequest shapeReturnsReach for it when

Converse

Unified messages format, every messages-capable model

Complete response

The default: portable code, tool use, guardrails — one integration for many models

ConverseStream

Same unified format

Event stream of incremental chunks

Interactive UX where time-to-first-token matters

InvokeModel

Model-native JSON body per provider

Complete response

A model-specific capability the unified shape does not expose

InvokeModelWithResponseStream

Model-native JSON body

Event stream

Model-specific body + streaming delivery

All four are synchronous request/response at heart — the caller waits. The other half of the topic is what to do when waiting is wrong: language-specific AWS SDKs plus Amazon SQS for asynchronous processing. The app enqueues a job and immediately answers its user; a worker fleet drains the queue at a rate you control (which doubles as a throttle-friendly regulator against quota-limited models); results land in a store; the caller learns of completion by callback or by polling the job id. And when one completion must notify several consumers at once — the UI, an audit stream, a billing meter — Amazon SNS adds fan-out beside the queue: the worker publishes one job-done message to a topic and every subscriber receives its own copy. Watch the shape below — the answer still rides home, just not on the request's connection.

Key terms: Converse API, Exponential backoff

Interactive checkpoint quiz (2 questions) — open this page in a browser to take it.