OpenAI Assistants - Working with OpenAI's API

I’m building a web app on v0.dev that integrates with OpenAI Assistants v2.
My app successfully creates threads and runs using OpenAI’s /v2/threads and /v2/runs endpoints.

However, when attempting to upload files to OpenAI’s /v1/files endpoint (which is still used for file uploads even in v2 Assistants), the server consistently returns a 500 Connection error.

  1. Configure OpenAI SDK (openai npm package) with proper server-side fetch (using undici.fetch).
  2. Successfully create threads and runs with OpenAI Assistants v2 endpoints.
  3. Attempt to upload a small file (~86 KB PDF) using openai.files.create({ file, purpose: "assistants" }).
  4. Observe immediate server-side error:

vbnet

CopyEdit

Error during RFP processing: Status 500: Connection error.
  1. Debug logs confirm:
  • File buffer is valid (86241 bytes).
  • File type is application/pdf.
  • Error occurs only during file upload step.

No custom fetch, no manual API call — pure OpenAI Node SDK usage.

  • Framework: Custom Node + React (v0 default)
  • Hosting environment: v0.dev hosted environment
  • Project settings: Using server actions and API routes for all OpenAI calls.

Additional Information:

  • OpenAI Assistants v2 flow is fully working (thread creation, run starting).
  • Only file uploads (to /v1/files) are failing.
  • Same code works fine in other server environments (Vercel, AWS) without modification.

Request:

Could you please confirm whether outbound connections from v0 servers to https://api.openai.com/v1/files are currently restricted, blocked, or proxied?

If so, is there an expected timeline or workaround to allow full OpenAI API support, including file uploads?

Thank you!

Hi @gibbyspice, welcome to the Vercel Community!

Thanks for writing such a detailed post. Based on the description, I assume you have some development experience. Can you confirm that the file upload code is correct by matching it with OpenAI API docs? Maybe also compare the SDK version used in your project is matching the API used. Because v0 may generate a code that looks good but isn’t as accurate.

Hi Anshuman! Thank you for your quick reply. I have little-to-no development experience outside of writing some basic python scripts about a decade ago. So, this has all been a great learning curve and I’m very impressed with v0 always getting about 80% of the way on app ideas. I did check all of this information to the best of my ability. It seems good. What I’m trying to avoid right now is using some sort of PDF parser (that introduces bad characters) that is fed to an API (Claude, OpenAI, Gemini, whatever) where I have to keep dealing with how bad the parsing is :slight_smile: – I’ve learned this the hard way by trying a few different approaches. OpenAI has a nice approach when you upload your documents to them; and, in their Playground, I’m getting the results I want by uploading the pdf documents (as attachments with a message that says ‘Analyze this’ that uses specific system instructions). It’s just that I cannot seem to get over the hump when it comes to submitting a document via their API. Here is my app: https://v0-og-x-consulting-rfp-evaluator.vercel.app ; I am trying to test it with a 1 page pdf. Nothing works. Would love to get your opinion on it. If there’s a way to share the code, I am happy to do that.

(Attachment 506449sol.pdf is missing)

I cannot attach pdfs, but this a jpg of the pdf I am trying to test with the app