Can not delete assistant files since today

Error code: 404 - {‘error’: {‘message’: “vector store with id ‘asst_**’ not found.”, ‘type’: ‘invalid_request_error’,

curl /v1/ assistants /asst_abc123 /files/file-abc123
-H “Authorization: Bearer $OPENAI_API_KEY”
-H “Content-Type: application/json”
-H “OpenAI-Beta: assistants=v1”
-X DELETE

This file utility employing the openai library that I made still works fine. I just tested all options.

Its reliable enough, I don’t even bother with try/except.

Thanks for your reply, But I use matlab http requests to access openai api.

I’ve tried python code to delete the files attached to assistant, it replied as I said.

I’ll try your beautiful code.

I manage my files by assistant id. It seems that you delete file from storage. if I delete file in storage, the file attached to assistant is still there.

If you want to change the files attached to an assistant, you have to use the endpoint “modify assistant”, with a new list of files that omits ones to be detached.

https://platform.openai.com/docs/api-reference/assistants/modifyAssistant

Thanks for your advice. API Reference - OpenAI API

But I still want to follow this endpoint.

1 Like

I’ve solved it. the file_id changes when you delete the file in storage. so it’s openai’s problem.

Just delete all your files and reupload them.

1 Like