# Why am I getting no valid vector store found error?

**URL:** <https://community.openai.com/t/why-am-i-getting-no-valid-vector-store-found-error/1361187>\
**Category:** Bugs\
**Tags:** api, vector-db, assistants-api, assistants-files, vector-store\
**Created:** [October 6, 2025, 1:00pm UTC](https://community.openai.com/t/why-am-i-getting-no-valid-vector-store-found-error/1361187 "2025-10-06T13:00:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulodm145](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paulodm145/32/686505_2.png) [@paulodm145](https://community.openai.com/u/paulodm145)\
**Post date:** [October 6, 2025, 1:00pm UTC](https://community.openai.com/t/why-am-i-getting-no-valid-vector-store-found-error/1361187/1 "2025-10-06T13:00:37Z")

</div>

I’m trying to upload files to my vector database through a python script but I’m getting the error message Error message: {‘error’: {‘message’: “No valid vector store found with id ‘vs\_XXXX’.”, ‘type’: ‘invalid\_request\_error’, ‘param’: ‘vector\_store\_id’, ‘code’: None}} even though the database ID is correct.

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [October 6, 2025, 3:00pm UTC](https://community.openai.com/t/why-am-i-getting-no-valid-vector-store-found-error/1361187/2 "2025-10-06T15:00:59Z")

</div>

I suspect that there may be an issue with scoping: using an API key from a different project than created the vector store.

Here’s a small Python script in this post that some amazeballs programmer wrote as a demo that is self contained to create a vector store, upload a file, and then attach to the vector store, twice. Then list the attachments with the metadata (filenames that can be used as query terms), and clean up, besides demonstrating the new expiration policy for files and seeing a success status before proceeding. You can check for success with your own local filename to see round-trip all from one API key.

> [@Vector\_stores.files.list() should also return the file name](https://community.openai.com/t/vector-stores-files-list-should-also-return-the-file-name/943687/3):
>
> Yes. Store the file name yourself as a metadata attribute of the vector store file. Demonstration that will run on your filename to upload: from openai import OpenAI; cl = OpenAI() filename = "vs\_metadata\_demo.py" vs\_id = cl.vector\_stores.create(name="vstest").id def upload\_attach\_poll(vs, file, suffix=""): file\_id = cl.files.create( file=open(file, "rb"), purpose="user\_data", expires\_after={"anchor": "created\_at", "seconds": 3600}, ).id vs\_file\_id = cl.vector\_sto…
