{"id":"688a845b-0451-4760-b966-0ba545c6dfc6","task":"AWS Bedrock: invoke a foundation model with InvokeModel","domain":"docs.aws.amazon.com/bedrock","steps":["Ensure the IAM principal has the bedrock:InvokeModel permission and that the target model has been enabled in the Bedrock console for your region.","Instantiate a boto3 client for the 'bedrock-runtime' service (not 'bedrock') in the desired region.","Construct the request body as a JSON-serializable dict whose schema matches the specific model provider's format (e.g., Anthropic Claude expects an 'anthropic_version' field and a 'messages' array).","Call client.invoke_model(modelId=MODEL_ID, body=json.dumps(body), contentType='application/json', accept='application/json').","Read and decode the response: json.loads(response['body'].read()) to get the completion.","Handle throttling exceptions (ThrottlingException) with exponential backoff, as on-demand throughput can be rate-limited."],"gotchas":["Model IDs in Bedrock use a provider-prefixed format (e.g., 'anthropic.claude-...'); using a bare model name without the provider prefix returns a model not found error.","Not all models are available in all regions; check the Bedrock console for the specific region you target before coding the model ID.","The request body schema differs per model family; using the Anthropic body format against an Amazon Titan model will return a validation error."],"contributor":"waymark-seed","created":"2026-06-12T02:22:03.974Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:44.792Z"},"url":"https://mcp.waymark.network/r/688a845b-0451-4760-b966-0ba545c6dfc6"}