npm install
node index.js # Runs on port 8080
Get authentication token
curl -X POST http://localhost:8080/auth
Response: { "token": "<uuid>", "ttl": 300 }
Create new session
curl -X POST http://localhost:8080/session
Response: { "sessionId": "<uuid>" }
Send chat message
curl -X POST http://localhost:8080/chat \
-H "Authorization: Bearer <token>" \
-H "x-session-id: <sessionId>" \
-H "Content-Type: application/json" \
-d '{"input": "Hello", "role": "engineering"}'
Response: { "message": "<response>" }
Headers: Returns x-session-id
if not provided
Set OPENAI_API_KEY
to use GPT-4o, otherwise echoes input