{"slug": "what-does-one-amazon-bedrock-prompt-cost-find-out-from-the-cli-hands-on", "title": "💸 What Does One Amazon Bedrock Prompt Cost? Find Out From the CLI (Hands-on)", "summary": "A hands-on walkthrough shows how to calculate the cost of a single Amazon Bedrock prompt directly from the AWS CLI by sending a request to Amazon Nova Micro via the Converse API and reading the returned usage block, which reports inputTokens, outputTokens, and totalTokens. Multiplying those token counts by the model's per-1,000-token input and output prices yields a per-prompt cost, and capping output with maxTokens reduces it. The technique is presented as the practical core of Chapter 5 of a free AWS AI Practitioner (AIF-C01) course.", "body_md": "\"Your team wants to add an Amazon Bedrock chatbot. How would you work out what one prompt costs?\"\n\nIt shows up in AIF-C01 prep and in real interviews. The strong answer: **Bedrock charges per token, and every response tells you how many tokens it used.** Let's prove that from the AWS CLI in 5 minutes. 👇\n\n👉 Flow: **Send one prompt → Read `usage` → Multiply by the price → Compare two prompts**\n\n✅ AWS CLI v2, signed in (`aws sts get-caller-identity` works)\n\n✅ Region `us-east-1`\n\n✅ Model access for **Amazon Nova Micro** (Bedrock console → *Model access*)\n\n```\naws bedrock-runtime converse \\\n  --region us-east-1 \\\n  --model-id us.amazon.nova-micro-v1:0 \\\n  --messages '[{\"role\":\"user\",\"content\":[{\"text\":\"Explain overfitting in one sentence.\"}]}]' \\\n  --query '{answer: output.message.content[0].text, usage: usage}'\n```\n\n✅ Expected (your numbers will differ):\n\n```\n{\n  \"answer\": \"Overfitting is when a model learns the training data so closely ...\",\n  \"usage\": { \"inputTokens\": 8, \"outputTokens\": 24, \"totalTokens\": 32 }\n}\n```\n\n👀 That `usage` block is your bill, in tokens.\n\nOpen [Amazon Bedrock pricing](https://aws.amazon.com/bedrock/pricing/), find **Nova Micro**, and copy its price per **1,000 input tokens** and per **1,000 output tokens**.\n\n```\nIN=8; OUT=24                      # from usage\nP_IN=<price per 1K input tokens>  # from the pricing page\nP_OUT=<price per 1K output tokens>\nawk -v i=$IN -v o=$OUT -v pi=$P_IN -v po=$P_OUT \\\n  'BEGIN { printf \"USD %.8f per prompt\\n\", i/1000*pi + o/1000*po }'\n```\n\n💡 Multiply by prompts per day to get a daily cost. That's the number your manager wants.\n\nAsk for a **long** answer instead:\n\n```\n--messages '[{\"role\":\"user\",\"content\":[{\"text\":\"Explain overfitting in 500 words.\"}]}]'\n```\n\n📈 `outputTokens` jumps, and output tokens cost more than input tokens. Then add `--inference-config '{\"maxTokens\":50}'` and watch the cost come back down.\n\n✅ \"Bedrock on-demand pricing is per input and output token\"\n\n✅ \"Every Converse response returns `inputTokens` and `outputTokens`\"\n\n✅ \"Output tokens usually cost more, so I cap them with `maxTokens`\"\n\n✅ \"Cost per prompt × prompts per day = the daily bill\"\n\nThis is the hands-on cut of **Chapter 5** of our free *AWS AI Practitioner (AIF-C01)* course: the full chapter explains tokens, why they drive cost, and how the exam asks about them.", "url": "https://wpnews.pro/news/what-does-one-amazon-bedrock-prompt-cost-find-out-from-the-cli-hands-on", "canonical_source": "https://dev.to/confident_prep/what-does-one-amazon-bedrock-prompt-cost-find-out-from-the-cli-hands-on-2m9p", "published_at": "2026-10-11 04:32:34+00:00", "updated_at": "2026-10-11 04:49:57.720635+00:00", "lang": "en", "topics": ["ai-infrastructure", "large-language-models", "ai-tools", "mlops"], "entities": ["Amazon Bedrock", "AWS CLI", "Amazon Nova Micro", "AWS", "AIF-C01"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/what-does-one-amazon-bedrock-prompt-cost-find-out-from-the-cli-hands-on", "markdown": "https://wpnews.pro/news/what-does-one-amazon-bedrock-prompt-cost-find-out-from-the-cli-hands-on.md", "text": "https://wpnews.pro/news/what-does-one-amazon-bedrock-prompt-cost-find-out-from-the-cli-hands-on.txt", "jsonld": "https://wpnews.pro/news/what-does-one-amazon-bedrock-prompt-cost-find-out-from-the-cli-hands-on.jsonld"}}