Vector DB
Upsert & Embeddings
Generate embeddings with /v1/embeddings and upsert them into a collection.
Generate embeddings
OpenAdapter's /v1/embeddings endpoint is OpenAI-compatible. Use it directly from the OpenAI SDK or any HTTP client.
curl -X POST https://api.openadapter.in/v1/embeddings \
-H "Authorization: Bearer $OPENADAPTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-embedding-small",
"input": ["chunk 1 text", "chunk 2 text"]
}'Upsert points
curl -X POST https://api.openadapter.in/v1/vectors/collections/docs/points \
-H "Authorization: Bearer $OPENADAPTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"points": [
{
"id": 1,
"vector": [0.01, -0.02, ...],
"payload": { "text": "chunk 1 text", "source": "intro.md" }
},
{
"id": 2,
"vector": [0.03, 0.04, ...],
"payload": { "text": "chunk 2 text", "source": "intro.md" }
}
]
}'| Field | Notes |
|---|---|
id | Identifier for the point (the dashboard uses integers) |
vector | Float array; length must equal the collection's vector_size |
payload | Arbitrary JSON metadata. The dashboard's example stores chunk text under a text key. |
Python end-to-end
import requests
API_KEY = "sk-cv-..."
BASE = "https://api.openadapter.in"
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
chunks = ["chunk 1 text", "chunk 2 text"]
# 1. Embed
resp = requests.post(f"{BASE}/v1/embeddings", json={
"model": "qwen3-embedding-small", "input": chunks
}, headers=headers)
vectors = [d["embedding"] for d in resp.json()["data"]]
# 2. Upsert
requests.post(f"{BASE}/v1/vectors/collections/docs/points", json={
"points": [
{"id": i + 1, "vector": v, "payload": {"text": t}}
for i, (v, t) in enumerate(zip(vectors, chunks))
]
}, headers=headers)Notes
- Each vector API call (upsert, search, etc.) costs 0.05 of one request. Embedding calls count as one full request.
- Re-upserting an existing
idoverwrites the point.