Problem
I am building a menu scanning app with PDF upload support using OPENAI_API_KEY directly (not AI Gateway). While image uploads work correctly, PDF processing fails in the Vercel serverless environment.
Errors Encountered
- OpenAI SDK Error:
Error: “Unsupported model version v1 for provider ‘openai.chat’”
Occurs when using the@ai-sdk/openaipackage.
- pdf-parse Library Error:
Error: “Cannot convert argument to a ByteString because the character at index 7 has a value of 8230”
Environment Details
- The
pdf-parselibrary appears to be incompatible with Vercel’s serverless environment. - Image uploads are functioning as expected.
Current Status
For now, the app works with photo uploads only. Users must take a photo of the menu instead of uploading a PDF.
To contact Vercel support directly, go to: vercel.com/help