Hello,
Welcome to Microsoft Q&A,
gpt-4.1-mini (or gpt-4.1-preview) has incomplete or unstable support for explicit tool routing when using the tool_choice setting, particularly when forcing file search.
This issue is not officially documented in OpenAI or Azure OpenAI but has been observed by other users and acknowledged internally by OpenAI.
https://community.openai.com/t/assistant-api-file-search-error-after-gpt-4-1-release/1231560
As you already noted, the models gpt-4o or gpt-4o-mini work. These models are faster, cheaper, more capable, and fully support file_search and tool_choice. Please use this in the meantime while the issue is fixed.
Please Upvote and accept the answer if it helps!!