Hi,
The important part of the error is:
File URLs can not be larger than 32 MB
So the request is likely being rejected by the file URL / attachment path before the model can process the PDF.
Since ~30 MB files work and larger files fail, I would treat 32 MB as the practical limit for this URL-based attachment flow unless the AI SDK/Azure provider team confirms otherwise.
For larger PDFs, I would avoid sending the entire file inline through useChat. A more reliable pattern is:
-
Upload the PDF separately.
-
Parse or extract the PDF text server-side.
-
Split the text into chunks.
-
Send only the relevant chunks to the model.
-
For larger documents, use a RAG/vector-search flow instead of attaching the whole PDF to each chat request.
It would also be useful if someone from the AI SDK/Vercel team could confirm whether the 32 MB limit comes from useChat, the AI SDK attachment handling, Azure OpenAI, or the file-fetching layer.