Create Embeddings in Vector Store

Hi, based on

curl -X POST vector_stores/your_vector_store_id/vectors
-H “Content-Type: application/json”
-H “Authorization: Bearer YOUR_OPENAI_API_KEY”
-d ‘{
“id”: “vector_1”,
“embedding”: [0.0218, -0.0063, 0.0345, …],
“metadata”: {
“text”: “Hello World”,
“created_at”: “2024-09-06T12:00:00Z”
}
}’
The response is:
{
“error”: {
“message”: “Invalid URL (POST /v1/vector_stores/your_vector_store_id/vectors)”,
“type”: “invalid_request_error”,
“param”: null,
“code”: null
}
}
It doesn’t work. why and how to fix it?
Thanks.

You seem to have a misunderstanding of OpenAI’s vector stores, and have some imaginary API call that I could only assume an AI fabricated.

OpenAI is not a database provider.

Vector stores are for API “assistants” exclusively.

Vector stores accept file IDs of document files that you have uploaded to file storage.

The only way you can utilize the chunked documents is by adding a vector store to an assistant’s file search feature, and then asking the AI something and inspiring it to run a search for which it has a function it can send query terms.

No aspect of the document extraction, chunking, embeddings values, or searching is directly accessible or modifiable by you.

2 Likes