Documentation Index
Fetch the complete documentation index at: https://docs.writerzroom.com/llms.txt
Use this file to discover all available pages before exploring further.
Use the WriterzRoom API directly from any HTTP client or Python environment. A formal SDK package is on the roadmap. Until then, the patterns below cover all core workflows.
Installation
No SDK package is required. Use httpx or requests for Python integrations.
Authentication
All requests require a Bearer token. Retrieve your session token from GET /api/auth/session.
HEADERS = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
BASE_URL = "https://api.writerzroom.com"
Core Patterns
Submit a Generation Request
import httpx
response = httpx.post(
f"{BASE_URL}/api/generate",
headers=HEADERS,
json={
"template": "blog_article_generator",
"style_profile": "general_blog",
"generation_mode": "standard",
"dynamic_parameters": {
"topic": "AI in enterprise content workflows",
"target_audience": "content directors",
"word_count": 1200,
},
},
)
data = response.json()
request_id = data["request_id"]
Poll for Completion
import time
def wait_for_completion(request_id: str, timeout: int = 600, interval: int = 5) -> dict:
deadline = time.time() + timeout
while time.time() < deadline:
res = httpx.get(
f"{BASE_URL}/api/generate/status/{request_id}",
headers=HEADERS,
)
data = res.json()["data"]
status = data["status"]
if status == "completed":
return data
if status == "failed":
raise RuntimeError(f"Generation failed: {data.get('error')}")
time.sleep(interval)
raise TimeoutError(f"Generation did not complete within {timeout}s")
Full End-to-End Example
import httpx, time
BASE_URL = "https://api.writerzroom.com"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}
def generate(template: str, style: str, params: dict, mode: str = "standard") -> str:
res = httpx.post(f"{BASE_URL}/api/generate", headers=HEADERS, json={
"template": template,
"style_profile": style,
"generation_mode": mode,
"dynamic_parameters": params,
})
res.raise_for_status()
request_id = res.json()["request_id"]
deadline = time.time() + 600
while time.time() < deadline:
status_res = httpx.get(f"{BASE_URL}/api/generate/status/{request_id}", headers=HEADERS)
data = status_res.json()["data"]
if data["status"] == "completed":
return data["content"]
if data["status"] == "failed":
raise RuntimeError(data.get("error"))
time.sleep(5)
raise TimeoutError("Generation timed out")
content = generate(
template="blog_article_generator",
style="general_blog",
params={"topic": "AI in enterprise content", "target_audience": "content directors"},
)
print(content[:500])
List Templates
res = httpx.get(f"{BASE_URL}/api/templates", headers=HEADERS)
templates = res.json()["data"]["items"]
for t in templates:
print(t["id"], "-", t["name"])
List Style Profiles
res = httpx.get(f"{BASE_URL}/api/style-profiles", headers=HEADERS)
profiles = res.json()["data"]["items"]
for p in profiles:
print(p["id"], "-", p["name"], f"({p['tone']})")
List Verticals
res = httpx.get(f"{BASE_URL}/api/verticals", headers=HEADERS)
verticals = res.json()["verticals"]
for v in verticals:
print(v["id"], "-", v["name"])
Error Handling
| Status | Meaning |
|---|
402 | Insufficient credits or inactive subscription |
403 | Generation mode not available on current plan |
404 | Template or style profile not found |
429 | Rate limit exceeded (10 generation requests per minute) |
503 | Configuration Manager unavailable |
res = httpx.post(f"{BASE_URL}/api/generate", headers=HEADERS, json={...})
if res.status_code == 402:
raise RuntimeError("Insufficient credits — purchase a pack at writerzroom.com/dashboard")
res.raise_for_status()
Rate Limits
| Endpoint | Limit |
|---|
POST /api/generate | 10 per minute |
GET /api/generate/status/{id} | 60 per minute |
| All other endpoints | 200 per hour |
A formal writerzroom Python package is on the roadmap. It will wrap these patterns with async support, automatic polling, and retry logic.