Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

docs: simplify HTTP API example in README

LearningCircuit86b5256cd1f6
diff --git a/README.md b/README.md
index ac01dc4271..f0bd012d7d 100644
--- a/README.md
+++ b/README.md
@@ -242,38 +242,32 @@ print(result["summary"])
```
### HTTP API
+
```python
import requests
from bs4 import BeautifulSoup
# Create session and authenticate
session = requests.Session()
-
-# Get login page and CSRF token
login_page = session.get("http://localhost:5000/auth/login")
soup = BeautifulSoup(login_page.text, "html.parser")
-csrf_input = soup.find("input", {"name": "csrf_token"})
-login_csrf = csrf_input.get("value")
+login_csrf = soup.find("input", {"name": "csrf_token"}).get("value")
-# Login with form data (not JSON) including CSRF token
+# Login and get API CSRF token
session.post("http://localhost:5000/auth/login",
data={"username": "user", "password": "pass", "csrf_token": login_csrf})
-
-# Get CSRF token for API requests
csrf = session.get("http://localhost:5000/auth/csrf-token").json()["csrf_token"]
-# Make API request with correct endpoint and CSRF header
-response = session.post(
- "http://localhost:5000/api/start_research", # Updated endpoint
- json={"query": "Explain CRISPR gene editing"},
- headers={"X-CSRF-Token": csrf}
-)
+# Make API request
+response = session.post("http://localhost:5000/api/start_research",
+ json={"query": "Your research question"},
+ headers={"X-CSRF-Token": csrf})
```
-🚀 **[Working HTTP API Examples → examples/api_usage/http/](examples/api_usage/http/)**
-- ✅ **Out-of-the-box examples** with automatic user creation
-- ✅ **Correct endpoints** and proper authentication
-- ✅ **Retry logic** for fetching results automatically
+🚀 **[Ready-to-use HTTP API Examples → examples/api_usage/http/](examples/api_usage/http/)**
+- ✅ **Automatic user creation** - works out of the box
+- ✅ **Complete authentication** with CSRF handling
+- ✅ **Result retry logic** - waits until research completes
- ✅ **Progress monitoring** and error handling
### Command Line Tools