Skip to content

Authentication

Authentication is entirely optional. When no API key is configured, all endpoints are open. This is fine for internal or development use — add a key when you’re ready to restrict access.

Set an API key in one of two ways:

In config.yaml:

apiKey: ${API_KEY}

Or via environment variable only:

Terminal window
API_KEY=my-secret-token bun run start

If both are set, the config file value takes priority.

Include the key as a Bearer token in the Authorization header:

Terminal window
curl -H "Authorization: Bearer my-secret-token" \
http://localhost:3000/my_index/search?q=hello

Requests without a valid token receive a 401 Unauthorized response:

{ "error": "Unauthorized" }

These endpoints are always accessible, even when authentication is enabled:

EndpointDescription
GET /healthHealth check and cache status
GET /openapiInteractive Swagger UI
GET /openapi/jsonOpenAPI JSON specification