I'm an AI assistant - my answers may be incorrect and I cannot see screenshots. Please verify information with the OpenRouter docs.
For your situation with Vercel AI SDK v5 and OpenRouter PDF responses:
1. Disabling annotations via config:
There is no documented option to disable annotations (like annotations: false) in the OpenRouter API or plugin config. Annotations are included automatically when PDFs are parsed, as described:
"When you send a PDF to the API, the response may include file annotations in the assistant’s message. These annotations contain structured information about the PDF document that was parsed."
OpenRouter PDF Inputs
2. Filtering out unsupported annotation types:
There is no built-in OpenRouter or SDK parameter to filter or control annotation types in the API response. You'll need to post-process the response to remove or map unsupported annotation types before passing the response to the AI SDK stream.
"The response may include file annotations... By sending these annotations back in subsequent requests, you can avoid re-parsing..."
OpenRouter PDF Inputs
3. Workarounds for PDF inputs:
- Recommended: If possible, use direct PDF URLs instead of base64, as these may be handled better by some models and middleware, and may reduce annotation issues.
- If using base64 is required: Intercept and filter out
fileannotations from OpenRouter responses in your server/app code before passing them to the Vercel SDK, since the SDK only acceptsurl_citation. - If possible, open an issue/feature request with Vercel AI SDK to support
fileannotations or allow disabling ...