Files
litellm/docs
Cesar GarciaandGitHub 6ddc7875ea Fix: add OpenAI-compatible API for Anthropic with modify_params=True (#17106)
* docs: add OpenAI-compatible API limitations for Anthropic thinking

Document the fundamental incompatibility between Anthropic extended
thinking and OpenAI-compatible API clients. Explains:

- Why thinking_blocks must be resent (stateless vs stateful APIs)
- OpenAI vs Anthropic architecture differences
- Solutions for client developers

* Update docs

* fix: auto-drop thinking param when thinking_blocks missing

When modify_params=True, LiteLLM now automatically drops the 'thinking'
param if the last assistant message with tool_calls is missing
thinking_blocks. This prevents the Anthropic error:
"Expected thinking or redacted_thinking, but found tool_use"

This workaround addresses the OpenAI-Anthropic API incompatibility where
OpenAI-compatible clients don't preserve thinking_blocks.
2025-12-15 13:35:46 +05:30
..