Skip to content
AWS Certified AI Practitioner (AIF-C01) Exam Prep

Lesson 12 of 34 · 6 min

x
12/34

Token Pricing and Context Engineering

Video lesson: AIF-C01 12/34: Token Pricing and Context Engineering

Token-based pricing (verified, Amazon Bedrock pricing page)

  • On-demand FM use is billed per input token and per output token (prices quoted per million tokens). Output tokens usually cost more than input tokens.
  • Batch inference: about 50% lower than on-demand for supported models.
  • Service tiers: Standard (baseline), Flex (50% discount, for work that can wait), Priority (75% premium, for latency-critical work), and Reserved / Provisioned Throughput (hourly, by model units).
  • Prompt caching reduces latency and input token cost for long, repeated context (Bedrock prompt caching docs).

Effect on cost and performance (design guidance)

LeverCostPerformance
Longer prompts (more context, examples)UpOften better answers, slower
Longer outputsUp (output tokens)Slower
Smaller modelDownFaster; may be less capable
Prompt caching for repeated contextDownFaster
Batch for non-urgent workDown ~50%Not interactive

Context engineering (objective 2.1.5)

Context engineering means deciding what goes into the model's context window for each call: instructions, retrieved documents, conversation history, tool results and examples. The model only knows what is in its context (plus its training).

Good practice (design guidance): - Include only relevant information; retrieval (RAG) beats pasting everything. - Summarise or trim long histories. - Put stable content (instructions, reference docs) first so it can be cached. - Give agents memory (e.g. AgentCore Memory) instead of replaying every past turn.

Exam traps

  • Ignoring output tokens when estimating cost.
  • Stuffing the whole document set into every prompt instead of retrieving the relevant chunks.
  • Using Priority tier for overnight reports. Batch or Flex are cheaper.

References

  1. Amazon Bedrock pricing — checked Oct 19, 2026
  2. Bedrock prompt caching — checked Oct 19, 2026

Check your understanding

  • Two ways to cut token cost without changing the model?Show answer

    Answer

    Prompt caching; trimming context or retrieving only relevant chunks (also batch for non-urgent work).
  • What is context engineering?Show answer

    Answer

    Choosing and arranging what information goes into each model call.
  • Which Bedrock tier suits work that can wait, at half price?Show answer

    Answer

    Flex (or batch inference).
Previous

Progress is saved in this browser.

Next Lesson