'API operation not supported for token authentication' error when creating/using vector stores
When I run the following codes:
vector_store = client.beta.vector_stores.create(
name="Product_Documentation",
file_ids=[message_file.id]
)
or
client.beta.vector_stores.list()
I receive the following error:
BadRequestError: Error code: 400 - {'error': {'code': 'API operation not supported for token authentication', 'message': 'ApiId openai-api-2024-05-01-preview OperationId list_vector_stores not supported for CheckAccess.'}}
However, I can create vector stores by attaching the files into Thread as an attachment, I can create a vector store:
thread = client.beta.threads.create(
messages=[
{
"role": "user",
"content": "How many company shares were outstanding last quarter?",
# Attach the new file to the message.
"attachments": [
{ "file_id": message_file.id, "tools": [{"type": "file_search"}] }
],
}
]
)
But cannot retrieve that vector store again using the vector_stores:
client.beta.vector_stores.retrieve('vector_store_id')
BadRequestError: Error code: 400 - {'error': {'code': 'API operation not supported for token authentication', 'message': 'ApiId openai-api-2024-05-01-preview OperationId list_vector_stores not supported for CheckAccess.'}}
What could be the problem?