LLM Pharmacy API

Local LLM inference powered by Ollama and gemma3:4b

Quick Start

Send a prompt and get a response (non-streaming):

curl -X POST https://llm.rxweb.ca/api/generate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"prompt": "What is aspirin?", "stream": false}'

For streaming (Server-Sent Events):

curl -X POST https://llm.rxweb.ca/api/generate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"prompt": "What is aspirin?", "stream": true}'

Endpoints

GET /api/health
Check API and model status (no auth required)
POST /api/generate
Generate a response. Body: { prompt, stream?, system?, temperature?, max_tokens? }

Authentication

All requests to /api/generate require an X-API-Key header. Contact an admin to get a key.