VECTOR-STORES
Create a Vector Store
Create a vector store for storing and searching over file embeddings.
Authorization
AuthorizationstringheaderrequiredBearer token — your API key. Example: Bearer sk-...
Request body
application/jsonnamestringrequiredName for the vector store (1-255 characters).
descriptionstringOptional description for the vector store.
embeddingModelstringrequiredThe embedding model to use (e.g. "e5-mistral-7b-instruct").
dimensionsintegerrequiredNumber of dimensions for the embedding vectors.
distance"Cosine" | "Euclid" | "Dot"default: "Cosine"Distance metric for similarity search. Defaults to "Cosine".
CosineEuclidDotResponse
idstringrequiredUnique identifier for the vector store.
namestringrequiredName of the vector store.
descriptionstringrequiredOptional description.
embeddingModelstringrequiredThe embedding model used for this store.
dimensionsintegerrequiredEmbedding vector dimensions.
distance"Cosine" | "Euclid" | "Dot"requiredDistance metric used for similarity search.
CosineEuclidDotstatus"pending" | "ready" | "error"requiredCurrent status of the vector store.
pendingreadyerrorpointCountintegerrequiredNumber of stored vectors.
totalBytesintegerrequiredTotal size of stored files in bytes.
createdAtstringrequiredISO 8601 timestamp of creation.
updatedAtstringrequiredISO 8601 timestamp of last update.
organizationIdstringrequiredOrganization that owns this store.
createdBystringrequiredUser ID of the creator.
Request
const response = await fetch("https://api.scx.ai/v1/vector-stores", {
method: "POST",
headers: {
"Authorization": "Bearer your-scx-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "my-vector-store",
embeddingModel: "e5-mistral-7b-instruct",
dimensions: 4096,
distance: "Cosine",
}),
});
const vectorStore = await response.json();
console.log(vectorStore);const response = await fetch("https://api.scx.ai/v1/vector-stores", {
method: "POST",
headers: {
"Authorization": "Bearer your-scx-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "my-vector-store",
embeddingModel: "e5-mistral-7b-instruct",
dimensions: 4096,
distance: "Cosine",
}),
});
const vectorStore = await response.json();
console.log(vectorStore);Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "my-vector-store",
"description": null,
"embeddingModel": "e5-mistral-7b-instruct",
"dimensions": 4096,
"distance": "Cosine",
"status": "pending",
"pointCount": 0,
"totalBytes": 0,
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z",
"organizationId": "org_abc123",
"createdBy": "user_xyz789"
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "my-vector-store",
"description": null,
"embeddingModel": "e5-mistral-7b-instruct",
"dimensions": 4096,
"distance": "Cosine",
"status": "pending",
"pointCount": 0,
"totalBytes": 0,
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z",
"organizationId": "org_abc123",
"createdBy": "user_xyz789"
}