VECTOR-STORES

Create a Vector Store

Create a vector store for storing and searching over file embeddings.

POST/v1/vector-stores

Authorization

Authorizationstringheaderrequired

Bearer token — your API key. Example: Bearer sk-...

Request body

application/json
namestringrequired

Name for the vector store (1-255 characters).

descriptionstring

Optional description for the vector store.

embeddingModelstringrequired

The embedding model to use (e.g. "e5-mistral-7b-instruct").

dimensionsintegerrequired

Number of dimensions for the embedding vectors.

distance"Cosine" | "Euclid" | "Dot"default: "Cosine"

Distance metric for similarity search. Defaults to "Cosine".

CosineEuclidDot

Response

idstringrequired

Unique identifier for the vector store.

namestringrequired

Name of the vector store.

descriptionstringrequired

Optional description.

embeddingModelstringrequired

The embedding model used for this store.

dimensionsintegerrequired

Embedding vector dimensions.

distance"Cosine" | "Euclid" | "Dot"required

Distance metric used for similarity search.

CosineEuclidDot
status"pending" | "ready" | "error"required

Current status of the vector store.

pendingreadyerror
pointCountintegerrequired

Number of stored vectors.

totalBytesintegerrequired

Total size of stored files in bytes.

createdAtstringrequired

ISO 8601 timestamp of creation.

updatedAtstringrequired

ISO 8601 timestamp of last update.

organizationIdstringrequired

Organization that owns this store.

createdBystringrequired

User 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);

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"
}