Vector Stores
GET /v1/vector_storesPOST /v1/vector_storesGET /v1/vector_stores/:vector_store_idPOST /v1/vector_stores/:vector_store_idDELETE /v1/vector_stores/:vector_store_id
GET /v1/vector_stores/:vector_store_id/filesPOST /v1/vector_stores/:vector_store_id/filesGET /v1/vector_stores/:vector_store_id/files/:file_idDELETE /v1/vector_stores/:vector_store_id/files/:file_idRequires Authorization: Bearer sk-bve-YOUR_KEY.
Vector stores hold chunked, embedded representations of files for use with the Assistants file search tool.
Create a vector store
Section titled “Create a vector store”curl -X POST https://api.bve.me/v1/vector_stores \ -H "Authorization: Bearer sk-bve-YOUR_KEY" \ -H "Content-Type: application/json" \ -H "OpenAI-Beta: assistants=v2" \ -d '{ "name": "My Knowledge Base" }'Response:
{ "id": "vs_abc123", "object": "vector_store", "created_at": 1716288000, "name": "My Knowledge Base", "status": "completed", "file_counts": { "in_progress": 0, "completed": 0, "failed": 0, "cancelled": 0, "total": 0 }}Add files to a vector store
Section titled “Add files to a vector store”# First, upload the filecurl https://api.bve.me/v1/files \ -H "Authorization: Bearer sk-bve-YOUR_KEY" \ -F purpose="assistants" \ -F file="@document.pdf"
# Then attach to the vector storecurl -X POST https://api.bve.me/v1/vector_stores/vs_abc123/files \ -H "Authorization: Bearer sk-bve-YOUR_KEY" \ -H "Content-Type: application/json" \ -H "OpenAI-Beta: assistants=v2" \ -d '{ "file_id": "file-abc123" }'OpenAI SDK
Section titled “OpenAI SDK”import OpenAI from 'openai';import fs from 'fs';
const client = new OpenAI({ apiKey: 'sk-bve-YOUR_KEY', baseURL: 'https://api.bve.me/v1',});
// Create vector storeconst vectorStore = await client.beta.vectorStores.create({ name: 'My Knowledge Base',});
// Upload and attach a fileconst file = await client.files.create({ file: fs.createReadStream('document.pdf'), purpose: 'assistants',});
await client.beta.vectorStores.files.create(vectorStore.id, { file_id: file.id,});
// Use with an assistantconst assistant = await client.beta.assistants.create({ name: 'Search Assistant', model: 'gpt-4o', tools: [{ type: 'file_search' }], tool_resources: { file_search: { vector_store_ids: [vectorStore.id], }, },});- All vector store operations proxy directly to Fuelix.
- Include
OpenAI-Beta: assistants=v2on requests. - Files must first be uploaded via Files API before attaching to a vector store.