BudgetVec is now in public beta — deploy billion-scale vector search on Cloudflare for $0.015/GB. Get started →

Quickstart

Get up and running with BudgetVec in under 5 minutes.

1. Get an API Key

Contact us or use the admin API to create a tenant:

curl -X POST https://budgetvec.standupcode.workers.dev/admin/tenants \

-H "Content-Type: application/json" \

-H "X-Admin-Secret: your-admin-secret" \

-d '{

"tenant_id": "my-org",

"display_name": "My Organization",

"api_key": "bv_live_your_secret_key",

"plan": "Launch",

"vector_dim": 768

}'

2. Install the SDK

npm install @budgetvec/client

3. Initialize the Client

import { BudgetVecClient } from "@budgetvec/client";

const client = new BudgetVecClient({

baseUrl: "https://budgetvec.standupcode.workers.dev",

apiKey: process.env.BUDGETVEC_API_KEY!,

});

4. Upsert Vectors

const ns = client.namespace("my-documents");

await ns.upsert({

upsert_rows: [

{ id: 1, vector: [0.1, 0.2, 0.3, /* ... 768 dims */], title: "Introduction to AI" },

{ id: 2, vector: [0.4, 0.5, 0.6, /* ... 768 dims */], title: "Machine Learning Basics" },

],

});

5. Query

Vector Search (ANN)

const results = await ns.query({

rank_by: ["vector", "ANN", queryVector],

top_k: 10,

});

Full-Text Search (BM25)

const results = await ns.query({

rank_by: ["text", "BM25", "search query here"],

top_k: 10,

});

6. Check Namespace Metadata

const meta = await ns.metadata();

console.log(meta);

// { approx_row_count: 2, dimensions: 768, index: { status: "indexing" }, ... }

Next Steps