Check for existing issues
What happened?
Bug: reasoning_content in input assistant messages causes 422 Unprocessable Entity
Summary
When an assistant message in the request payload includes a reasoning_content
field, the upstream Mistral backend rejects the whole request with a
422 Unprocessable Entity (extra_forbidden). The field is a model output
and is not permitted as input, but it is currently being forwarded as-is.
Environment
- Model:
mistral-medium-3-5
- Backend: LiteLLM proxy → Mistral
- Endpoint:
POST /api/chat/completions
Root cause (suspected)
Assistant messages are stored and replayed verbatim, including the
reasoning_content field returned by a previous completion. Mistral's input
schema forbids extra fields, so the replayed field triggers extra_forbidden.
Steps to Reproduce
Send a chat completion request where one of the assistant messages carries a
reasoning_content key:
curl -v -X POST "https://<host>/api/chat/completions" \
-H "Content-Type: application/json; charset=utf-8" \
-H "Authorization: Bearer <token>" \
--data-binary @payload.json
payload.json:
{
"model": "mistral-medium-3-5",
"messages": [
{ "role": "user", "content": "Question?" },
{ "role": "assistant", "content": "Analysis in progress..." },
{
"role": "assistant",
"content": "Follow-up",
"reasoning_content": "Some internal reasoning text."
}
],
"temperature": 1.0
}
Actual result
{
"error": {
"message": "litellm.BadRequestError: MistralException - {\"detail\":[{\"type\":\"extra_forbidden\",\"loc\":[\"body\",\"messages\",2,\"assistant\",\"reasoning_content\"],\"msg\":\"Extra inputs are not permitted\",\"input\":\"...\"}]}",
"type": null,
"param": null,
"code": "422"
}
}
Relevant log output
What part of LiteLLM is this about?
Proxy
What LiteLLM version are you on ?
v1.87.3
Twitter / LinkedIn details
No response
Check for existing issues
What happened?
Bug:
reasoning_contentin inputassistantmessages causes 422 Unprocessable EntitySummary
When an
assistantmessage in the request payload includes areasoning_contentfield, the upstream Mistral backend rejects the whole request with a
422 Unprocessable Entity(extra_forbidden). The field is a model outputand is not permitted as input, but it is currently being forwarded as-is.
Environment
mistral-medium-3-5POST /api/chat/completionsRoot cause (suspected)
Assistant messages are stored and replayed verbatim, including the
reasoning_contentfield returned by a previous completion. Mistral's inputschema forbids extra fields, so the replayed field triggers
extra_forbidden.Steps to Reproduce
Send a chat completion request where one of the
assistantmessages carries areasoning_contentkey:payload.json:{ "model": "mistral-medium-3-5", "messages": [ { "role": "user", "content": "Question?" }, { "role": "assistant", "content": "Analysis in progress..." }, { "role": "assistant", "content": "Follow-up", "reasoning_content": "Some internal reasoning text." } ], "temperature": 1.0 }Actual result
{ "error": { "message": "litellm.BadRequestError: MistralException - {\"detail\":[{\"type\":\"extra_forbidden\",\"loc\":[\"body\",\"messages\",2,\"assistant\",\"reasoning_content\"],\"msg\":\"Extra inputs are not permitted\",\"input\":\"...\"}]}", "type": null, "param": null, "code": "422" } }Relevant log output
What part of LiteLLM is this about?
Proxy
What LiteLLM version are you on ?
v1.87.3
Twitter / LinkedIn details
No response