Skip to main content

Authentication

Creating API Keys

API key management requires an admin-role key.

curl -X POST http://localhost:8000/v1/admin/keys \
-H "x-api-key: your-admin-key" \
-H "Content-Type: application/json" \
-d '{"name": "production-app", "role": "readwrite"}'

Response:

{
"status": "success",
"data": {
"id": 2,
"name": "production-app",
"key": "sk-rw-abc123...",
"role": "readwrite",
"created_at": "2024-01-15T10:00:00Z"
}
}
warning

The API key value is only shown once at creation time. Store it securely.

Listing API Keys

curl http://localhost:8000/v1/admin/keys \
-H "x-api-key: your-admin-key"

Revoking an API Key

curl -X DELETE http://localhost:8000/v1/admin/keys/2 \
-H "x-api-key: your-admin-key"

Key Roles

RoleDescription
adminFull access, including key management
readwriteCreate/delete collections, upsert/delete vectors, search
readonlySearch, list, and get operations only

Using API Keys

Pass the key in the x-api-key header on every request:

curl http://localhost:8000/v1/collections \
-H "x-api-key: sk-rw-abc123..."

Or set it once in your SDK client:

from vectordb_client import VectorDBClient

client = VectorDBClient(
base_url="http://localhost:8000",
api_key="sk-rw-abc123...",
)