Use InvokeModel for classic request/response patterns and streaming variants (InvokeModelWithResponseStream) for low-latency UI updates. Each model provider defines its own native request/response body schema for InvokeModel โ Amazon Nova, Anthropic Claude, and Meta Llama all differ, so check the model's API reference before hardcoding a payload shape.
Prefer strict request schemas per model family, or use the Converse API (next lesson) to avoid per-provider payload drift.
Capture usage tokens (inputTokens/outputTokens) in telemetry for cost governance.
Pin exact model IDs in production configs โ Amazon Nova (Micro, Lite, Pro, Premier) is AWS's current first-party model family.
โจ HANDS-ON LABRun Your First Runtime Invocation
โญ +150 XP
Send a minimal inference request through the model-agnostic Converse API and observe token/cost-oriented response metadata.
1List callable models to confirm a valid model ID.
2Invoke the model through the Converse API.
3Inspect token usage in the response.
lab-sandbox โ simulated environment
INFINITY LAB SANDBOX v2.6 โ simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 3 โ type "hint" if stuck
๐งช Knowledge Check
Press 1-4 to select1 of 2
When is streaming inference most useful?
Batch ETL jobs only
Interactive UX where partial output improves perceived latency
IAM role creation
CloudWatch metric export
InvokeModel and Streaming Basics Tutorial | Inference APIs โ AWS Bedrock Academy