Bedrock “Malformed Input Request”: How to Read It and Fix the Request Body
“Malformed input request” means the JSON body you sent to a Bedrock model doesn’t match that model’s expected format.
The short version: read the path after the colon. #: extraneous key [functions] means a field the model doesn’t accept; #: required key [max_tokens] not found means a missing one; #/messages/0/content/1 points to a specific spot. The usual causes are a body written for a different model (Titan’s inputText sent to Cohere), wrong field names (Nova wants maxTokens, not max_new_tokens), a missing anthropic_version for Anthropic models, and broken JSON. The lasting fix is the Converse API, which uses one message format for every chat model.
The surprise: the error often names the wrong thing. A Nova request with snake_case settings can fail with “required key [toolUse] not found”, although the request had nothing to do with tools.
Jake’s developer tried three Bedrock models for the parts chatbot by changing only the model ID. The first worked. The other two failed with this error.
Jake: "Same code, different model ID. Why does that break it?"
Ethan: "Because with InvokeModel every model family speaks its own JSON. We changed the address but kept sending the first model’s letter."
How to read the error message
The full message looks like ValidationException: Malformed input request: #/messages/0/content/1: required key [toolUse] not found, please reformat your input and try again. The middle part is a path into your JSON:
| Path in the message | Where to look |
|---|---|
#: | The top level of the body: a missing required key or an extra one |
#/messages/0 | The first message in the messages list |
#/messages/0/content/1 | The second content block of the first message |
extraneous key [x] is not permitted | Field x isn’t part of this model’s format |
required key [x] not found | Field x is required and missing, or the block around it is malformed |
Treat the path as the reliable part. The key it names can mislead, as the Nova example below shows.
Cause 1: a body written for a different model
With InvokeModel, every model family has its own request format, listed on its inference parameters page. Change the model ID without changing the body and validation fails. The most-read forum question with this error sent Amazon Titan’s format to a Cohere model. Telltale fields:
| Model family | Body starts with | Settings field names |
|---|---|---|
| Anthropic | anthropic_version, max_tokens, messages | max_tokens, temperature, top_p |
| Amazon Nova | messages with {"text": …} blocks | inferenceConfig: maxTokens, topP, topK |
| Amazon Titan Text | inputText | textGenerationConfig: maxTokenCount |
| Meta Llama | prompt | max_gen_len, temperature, top_p |
If you see inputText in a body headed to anything other than Titan, that’s your bug.
Cause 2: right model, wrong field names (Amazon Nova)
Nova’s request schema uses camelCase settings inside inferenceConfig. Copying snake_case names from another model’s example fails, sometimes with a misleading key in the message:
import boto3, json
client = boto3.client("bedrock-runtime", region_name="us-east-1")
body = {
"messages": [{"role": "user", "content": [{"text": "Is part 4471 in stock?"}]}],
"inferenceConfig": {"maxTokens": 300, "temperature": 0.3, "topP": 0.9}, # not max_new_tokens / top_p
}
resp = client.invoke_model(modelId="us.amazon.nova-lite-v1:0", body=json.dumps(body))
print(json.loads(resp["body"].read())["output"]["message"]["content"][0]["text"])
Jake: "So the error said toolUse, but the real problem was max_new_tokens?"
Ethan: "Exactly. The path pointed at the right message; the key name was a red herring."
Cause 3: Anthropic bodies missing required fields
For Anthropic models on InvokeModel, two fields are required: anthropic_version, which must be bedrock-2023-05-31, and max_tokens. A working body (field list in the Anthropic Messages parameters):
body = {
"anthropic_version": "bedrock-2023-05-31",
"max_tokens": 512,
"system": "You answer questions about car parts.",
"messages": [{"role": "user", "content": [{"type": "text", "text": "Is part 4471 in stock?"}]}],
}
resp = client.invoke_model(modelId="us.anthropic.claude-fable-5-2", body=json.dumps(body))
Note the "type": "text" inside each content block: Anthropic bodies need it, Nova bodies don’t have it. Mixing the two styles is a common source of this error.
Cause 4: broken JSON
A body written as a string by hand breaks easily: one missing comma after "system" was enough in one widely read report. Bedrock can’t parse it, so the whole request is rejected. Build the body as a dict (Python) or object (JavaScript) and serialize it:
body = {...} # a real dict, never a hand-written JSON string
client.invoke_model(modelId=MODEL_ID, body=json.dumps(body)) # Python
// JavaScript: body: JSON.stringify(body)
Cause 5: framework fields the model doesn’t know
#: extraneous key [functions] is not permitted is the classic sign. A LangChain chain built for OpenAI added an OpenAI-only functions field, and the Bedrock model rejected it. Use LangChain’s ChatBedrockConverse from langchain-aws, which goes through the Converse API, and define tools in the Bedrock format rather than OpenAI’s.
The lasting fix: use the Converse API
The Converse API takes one message format for every model that supports it and builds each provider’s body for you. Swapping models becomes a one-line change:
resp = client.converse(
modelId="us.amazon.nova-lite-v1:0", # or any other chat model
system=[{"text": "You answer questions about car parts."}],
messages=[{"role": "user", "content": [{"text": "Is part 4471 in stock?"}]}],
inferenceConfig={"maxTokens": 300, "temperature": 0.3},
)
print(resp["output"]["message"]["content"][0]["text"])
Converse runs only on the bedrock-runtime endpoint. Our Converse API guide covers tools, images and streaming with ConverseStream; for streaming details see Bedrock streaming in Python.
Quick checklist
- Read the path after the colon; go to that spot in your body.
- Confirm the body format matches the model family (look for
inputText,anthropic_version,inferenceConfig). - Check field names and case: camelCase for Nova, snake_case for Anthropic.
- Serialize from a dict or object; never hand-write JSON strings.
- Remove fields added by another provider’s SDK or framework.
- For chat, switch to Converse and stop maintaining per-model bodies.
If the error changes to “could not resolve the foundation model”, the body is fine and the ID is the problem now: see the model ID fix.
Jake’s fix
- Read the path in each error: one pointed at
inferenceConfignames, the other at a missinganthropic_version. - Rewrote the call with
converse(), keeping one message format. - Moved the model ID into configuration.
- Tested all three models by changing only that value. All three answered.
Jake: "So we can try the next model in one line?"
For readers preparing for an AWS certification
We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.
Exams that test this topic: AI Practitioner (AIF-C01) • Machine Learning Engineer – Associate (MLA-C02) • Developer – Associate (DVA-C03 from December 1, 2026).
Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:
1. A developer switches InvokeModel from an Amazon Titan Text model to a Cohere model by changing only the model ID and now gets "Malformed input request". What is wrong?
The request body is still in Titan format (inputText). Each model family has its own InvokeModel body; send the target model format, or use the Converse API, which uses one format for all supported chat models.
2. Which approach lets an application try several Bedrock chat models without maintaining a separate request body for each?
The Converse API (Converse and ConverseStream) on bedrock-runtime, which takes one message format and builds each provider-specific body.
3. An InvokeModel call to an Anthropic model fails with "#: required key [max_tokens] not found". Which fields must the body include?
anthropic_version set to bedrock-2023-05-31, max_tokens, and messages. Both anthropic_version and max_tokens are required.
4. A Nova request with max_new_tokens and top_p fails validation. How should the settings be named?
Inside inferenceConfig as maxTokens, temperature, topP and topK (camelCase), as defined in the Nova request schema.
5. An error reads "Malformed input request: #: extraneous key [functions] is not permitted". What does it indicate?
The body contains a field the model does not accept, here an OpenAI-style functions field added by a framework. Remove it or use the Bedrock tool format, for example through the Converse API.
Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.
Ethan: "One line. The message format stays the same, whichever model answers."
Official references for this guide
- Converse API: one message format across models, bedrock-runtime only.
- Anthropic Messages API on Bedrock: required anthropic_version and max_tokens.
- Amazon Nova complete request schema: messages and inferenceConfig field names.
- Inference request parameters for foundation models: every model family’s body format.
Frequently asked questions
What does "Malformed input request" mean in Amazon Bedrock?
The JSON body you sent with InvokeModel doesn’t match the format the model expects. Bedrock checks it against the model’s schema and rejects it before the model runs. The text after the colon tells you which part is wrong.
How do I read "Malformed input request: #/messages/0/content/1"?
The part starting with # is a path into your JSON. #/messages/0/content/1 means the second content block of the first message. #: means the top level of the body.
What does "extraneous key [functions] is not permitted" mean?
You sent a field the model doesn’t accept, here functions, which is an OpenAI-style field. It often happens when a LangChain chain built for OpenAI runs against a Bedrock model. Remove the field or use the model’s own tool format.
Why do I get malformed input with Amazon Nova?
Usually snake_case parameter names such as max_new_tokens or top_p. Nova’s InvokeModel body uses inferenceConfig with maxTokens, temperature, topP and topK. The error can misleadingly mention a missing toolUse key.
What is the correct request body for Anthropic models on Bedrock?
With InvokeModel: anthropic_version set to bedrock-2023-05-31, max_tokens, and a messages list; system is optional. Both anthropic_version and max_tokens are required.
Can I send the same request body to different Bedrock models?
Not with InvokeModel: each provider has its own body format. The Converse API uses one format for every model that supports it, which is why it is the usual fix.
Should I use Converse or InvokeModel?
Use Converse for chat-style calls: one message format across models, tool use and streaming with ConverseStream. Keep InvokeModel for model-specific features or non-chat models such as embeddings and image generation.
Why does a missing comma cause malformed input?
Bedrock can’t parse invalid JSON, so the whole body is rejected. Build the body as a Python dict or JavaScript object and serialize it with json.dumps or JSON.stringify instead of writing JSON by hand.
Does "Malformed input request" mean my model ID is wrong?
No. A wrong model ID gives “could not resolve the foundation model” or “model identifier is invalid”. Malformed input means the ID was found but the body didn’t fit that model.
Why does Titan’s inputText fail with Cohere or Llama models?
inputText is part of Amazon Titan Text’s format only. Each model reads its own field names, so a Titan body sent to another model fails validation.
Do I need anthropic_version with the Converse API?
No. Converse builds the provider-specific body for you; you send messages, system and inferenceConfig in Converse’s own format.
Why does adding an image cause malformed input?
The image block has to match the model’s format: base64 data with a media type for Anthropic models on InvokeModel, or a bytes image block in Converse. Images in the wrong place or format fail validation.
How do I find the request format for a Bedrock model?
Each model has an inference parameters page in the Bedrock documentation with its request and response body, required fields and limits.
Can wrong parameter values cause malformed input?
Values out of range usually give a ValidationException with a clearer message, such as a limit on max_tokens. Malformed input is mostly about structure: missing, extra or misspelled keys and broken JSON.
Does LangChain cause malformed input requests on Bedrock?
It can, when a chain adds fields meant for another provider. Use ChatBedrockConverse from langchain-aws, which talks to the Converse API, and tools in the Bedrock format.
Is "Malformed input request" a permissions problem?
No. Permission problems give AccessDeniedException. This one is purely about the shape of the request body.
Revision note. Written November 30, 2026. “When in Rome, do as the Romans do”: each model reads its own format, unless Converse translates for you.