client.vectorStores.create failed with 401

We’re getting 401 when calling client.vectorStores.create() from code. The same flow worked until about three hours ago. Upload via the team dashboard UI still works with the same account. Other API calls with the same api key work (e.g. client.models.list(), client.vectorStores.list()).

The error we got: {“success”: false, “message”: “401 status code (no body)”, “status”: 401, “requestID”: “req_730cc9264921b62ce1112b4fbf4d09da”}

Does anyone know why this is happening?

5 Likes

Seeing the same issue here. We’re calling client.vectorStores.files.createAndPoll() to attach files to an existing vector store — was working fine until today, now getting 401 status code (no body).

Additionally, the OpenAI dashboard itself is broken for our vector stores — the “Files attached” and “Used by” sections both show “An unexpected error occurred: Load failed”. One of our vector stores that previously existed now returns “No valid vector store found with id ‘vs_…’” even though nothing was changed on our end.

Details:

  • openai.files.create() still works (file upload succeeds)
  • The 401 happens on the subsequent vectorStores.files.createAndPoll() call
  • vectorStores.list() also still works — can see our stores
  • Existing vector stores show “Load failed” in the dashboard UI
  • API key is valid, other endpoints (chat completions, embeddings) work fine
  • No config changes on our side — same code was working yesterday

Seems like something is broken specifically in the vector store file attachment / file_search infrastructure, not auth itself. The 401 with no body is not informative.

Is there an ETA on a fix?

Same issues we are also getting same error.

Just chiming in to say we’re also having this same issue.

Same error over here - clients are furious.

My UI for vector stores looks exactly as expected:

It looks like the platform site is using the file_batches endpoint, when uploads and attachments via the platform dashboard succeed; using this API URL is one approach you can try when you rewrite with more fault tolerance:

/v1/vector_stores/vs_69.../file_batches

One already cannot trust the .createAndPoll() method - it failed before by being too optimistic.

My own cl.vector_stores.files.create() use and then speculative error-tolerant cl.vector_stores.files.retrieve() poller is succeeding currently against my blank canvas of vector storage (after the expected failures of reading the newly-created file path):

-- Uploading file: vs_metadata_demo.py
   upload ok: file_id=file-5rSJwsPRTrpMg9p1cj27w1
-- Attaching file to vector store: vs_id=vs_699cd3c59cc48191adc18fff6b76fc49 file_id=file-5rSJwsPRTrpMg9p1cj27w1
   attach ok: vs_file_id=file-5rSJwsPRTrpMg9p1cj27w1
-- Listing check (immediate after attach (file1)): expecting file_id=file-5rSJwsPRTrpMg9p1cj27w1
   listing mismatch: file is NOT present (count=1)
-- Listing check (after 2s delay (file1)): expecting file_id=file-5rSJwsPRTrpMg9p1cj27w1
   listing mismatch: file is NOT present (count=1)
-- Polling vector store file status: vs_id=vs_699cd3c59cc48191adc18fff6b76fc49 file_id=file-5rSJwsPRTrpMg9p1cj27w1
   polling attempt 1/30: status=completed
   poll ok: terminal status=completed
-- File1 ready: file_id=file-5rSJwsPRTrpMg9p1cj27w1

Lesson: the code you write is the only code you can trust.

Click through the “reinforcement learning” about vector store service quality of this post to see code: creating your own polling method using the OpenAI SDK, although I’d encourage you to take control of the RESTful API request with your own code, also.


PS: polling until 404 to ensure removal also:

-- Cleanup starting
-- Deleting file: file-5rSJwsPRTrpMg9p1cj27w1
   delete ok: file-5rSJwsPRTrpMg9p1cj27w1
-- Deleting file: file-Fh37pLPEn6BqZnqaFXNYDa
   delete ok: file-Fh37pLPEn6BqZnqaFXNYDa
-- Deleting file: file-Fh37pLPEn6BqZnqaFXNYDa
NotFoundError: Error code: 404 - {'error': {'message': 'No such File object: file-Fh37pLPEn6BqZnqaFXNYDa', 'type': 'invalid_request_error', 'param': 'id', 'code': None}}
-- Deleting file: file-5rSJwsPRTrpMg9p1cj27w1
NotFoundError: Error code: 404 - {'error': {'message': 'No such File object: file-5rSJwsPRTrpMg9p1cj27w1', 'type': 'invalid_request_error', 'param': 'id', 'code': None}}
-- Deleting file: file-UN5xKa8AinnqYBJyaMYBWq
   delete ok: file-UN5xKa8AinnqYBJyaMYBWq
-- Deleting vector store: vs_699cd3c59cc48191adc18fff6b76fc49
   delete ok: vs_699cd3c59cc48191adc18fff6b76fc49
-- Cleanup done

Thanks for reporting the issue. We have forwarded it to the team at OpenAI.

I’ve persisted a bit more, made sure I capture non-200 status. I don’t see 401 with vector store creation independent from file attachments.

It costs you nothing to pre-create vector store IDs for the future, so this is not a latency cost. Then you can attach in parallel instead of using any “parallel” batch method that might instead decide to serialize files on you out of your control.


While my vector store file attachment caller is resilient, the API is ingesting far slower than expected: 30 seconds for a 2kB Python file.

   upload ok: file_id=file-HhvyReAvsPzm922T331q2d
-- Attaching file to vector store: vs_id=vs_699ce6cf5bdc8191a2b3cdb10899e234 file_id=file-HhvyReAvsPzm922T331q2d
   attach ok: vs_file_id=file-HhvyReAvsPzm922T331q2d
-- Listing check (immediate after attach (file1)): expecting file_id=file-HhvyReAvsPzm922T331q2d
   listing mismatch: file is NOT present (count=0)
-- Listing check (after 2s delay (file1)): expecting file_id=file-HhvyReAvsPzm922T331q2d
   listing mismatch: file is NOT present (count=0)
-- Polling vector store file status: vs_id=vs_699ce6cf5bdc8191a2b3cdb10899e234 file_id=file-HhvyReAvsPzm922T331q2d
   polling attempt 1/30: status=in_progress
   polling attempt 2/30: status=in_progress
   polling attempt 3/30: status=in_progress
   polling attempt 4/30: status=in_progress
   polling attempt 5/30: status=in_progress
   polling attempt 6/30: status=in_progress
   polling attempt 7/30: status=in_progress
   polling attempt 8/30: status=in_progress
   polling attempt 9/30: status=in_progress
   polling attempt 10/30: status=in_progress
   polling attempt 11/30: status=in_progress
   polling attempt 12/30: status=in_progress
   polling attempt 13/30: status=completed
   poll ok: terminal status=completed
-- File1 ready: file_id=file-HhvyReAvsPzm922T331q2d
1 Like

It looks like the issue was corrected.