+
+ ```bash
+ curl -X POST \
+ -H "Content-Type: application/json" \
+ -d '{
+ "messages": [
+ {"role": "user", "content": "Give me a TL;DR of the latest news"}
+ ]}' \
+ http://localhost:3000/api/chat
+ ```
+ The endpoint returns a **Server-Sent Event** (SSE) stream. Read it chunk-by-chunk for real-time updates.
+ ```
+ data: {"id":"chatcmpl…","choices":[{"delta":{"content":"Sure!"}}]}
+ ```
+
+
+ ```ts
+ const res = await fetch('/api/chat', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ messages }),
+ });
+ // Create a reader for the ReadableStream and process chunks
+ const reader = res.body?.getReader();
+ // …
+ ```
+
+
+
+---
+
+### 2. Article search
+
+```bash
+curl "http://localhost:3000/api/articles/search?query=typescript%203.5"
+```
+
+Response (truncated):
+
+```json
+[
+ {
+ "id": "getting-started-with-ts",
+ "score": 0.92,
+ "title": "Getting started with TypeScript 3.5"
+ }
+]
+```
+
+---
+
+## Versioning
+
+The API is **currently experimental** – expect breaking changes while the project is