Vector
Add an index that finds similar embeddings.
npx extraorbital add vector --dimensions 1536Match the dimensions to your embedding model before creating the index.
- 01 / Run the commandGet the service
- 02 / Read your .envUse its credentials
- 03 / Connect your appCall the SDK or API
Limits
| Limit | Free · Prototype | Paid |
|---|---|---|
| Indexes | 5 | No plan count cap |
| Storage | 1 GB | Usage billed |
| Requests | 10K queries + 10K updates / day | Usage billed |
| Backups | None | Charged as storage |
| Inactive resource | 30 days after last use | Persistent |
Free allowances are shared across the account. Provider limits still apply on paid plans.
Use it
import { Index } from "@upstash/vector";
const index = Index.fromEnv(); // reads UPSTASH_VECTOR_REST_URL and _TOKEN
await index.upsert({
id: "doc-42",
vector: embedding, // number[1536]
metadata: { title: "Q3 report" },
});
const hits = await index.query({ vector: queryEmbedding, topK: 5, includeMetadata: true });Environment variables
The CLI writes these to .env or an existing .env.local.
| Variable | Purpose |
|---|---|
UPSTASH_VECTOR_REST_URL | Index HTTP endpoint |
UPSTASH_VECTOR_REST_TOKEN | Private index token |
Specifics
Options
npx extraorbital add vector [--slug <name>] [--dimensions <n>] \
[--similarity-function <fn>] [--embedding-model <model>] [--region <region>]| Flag | Default | Description |
|---|---|---|
--slug | default | A second, fully separate index in the same project |
--dimensions | 1536 | Vector dimensions, 1–4096. Match your embedding model |
--similarity-function | COSINE | One of COSINE, EUCLIDEAN, DOT_PRODUCT |
--embedding-model | — | Let the index embed raw text for you |
--region | us-east-1 | One of us-east-1, eu-central-1, ap-southeast-1 |
To change dimensions or similarity method, create a new index and upload the embeddings again:
npx extraorbital add vector --slug small --dimensions 384Embeddings
Generate numeric embeddings with a model and store them in this index. Set --embedding-model if you want the index to embed raw text. Dimensions must match and cannot be changed after creation.
Pricing
| Usage | Paid rate |
|---|---|
| Storage | $0.25 / GB-mo |
| Requests | $0.40 / 100K |
See pricing for team subscription fees, allowances, and billing terms. Plans and billing ↗