Skip to content

Commit a3216ef

Browse files
Clarify DISTILL_API_KEYS usage for self-hosted auth
- Explain it's for protecting self-hosted instances - Add example for generating random API key - Show how to include key in requests
1 parent 3fcb7d2 commit a3216ef

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,32 @@ distill query # Test a query from command line
198198
OPENAI_API_KEY # For text → embedding conversion (see note below)
199199
PINECONE_API_KEY # For Pinecone backend
200200
QDRANT_URL # For Qdrant backend (default: localhost:6334)
201-
DISTILL_API_KEYS # Comma-separated API keys for auth (optional)
201+
DISTILL_API_KEYS # Optional: protect your self-hosted instance (see below)
202202
```
203203

204+
### Protecting Your Self-Hosted Instance
205+
206+
If you're exposing Distill publicly, set `DISTILL_API_KEYS` to require authentication:
207+
208+
```bash
209+
# Generate a random API key
210+
export DISTILL_API_KEYS="sk-$(openssl rand -hex 32)"
211+
212+
# Or multiple keys (comma-separated)
213+
export DISTILL_API_KEYS="sk-key1,sk-key2,sk-key3"
214+
```
215+
216+
Then include the key in requests:
217+
218+
```bash
219+
curl -X POST http://your-server:8080/v1/dedupe \
220+
-H "Authorization: Bearer sk-your-key" \
221+
-H "Content-Type: application/json" \
222+
-d '{"chunks": [...]}'
223+
```
224+
225+
If `DISTILL_API_KEYS` is not set, the API is open (suitable for local/internal use).
226+
204227
### About OpenAI API Key
205228

206229
**When you need it:**

0 commit comments

Comments
 (0)