A REST API wrapper for the Claude CLI.
Prerequisites: Node.js 18+ and Claude CLI authenticated (claude login)
npx clauditoriumOr install globally:
npm install -g clauditorium
clauditoriumTest it:
curl -X POST http://localhost:5051/ask \
-H "Content-Type: application/json" \
-d '{"prompt": "Hello!"}'That's it. Server runs on http://localhost:5051.
- Simple REST API for Claude
- Multi-turn chat with message history
- Configurable via environment variables
- Request tracking with unique IDs
- Minimal dependencies (Express + cors)
# Run directly with npx (no install needed)
npx clauditorium
# Or install globally
npm install -g clauditorium
# Or install locally in a project
npm install clauditorium| Endpoint | Method | Description |
|---|---|---|
/ask |
POST | Send a prompt, get a response |
/chat |
POST | Chat with message history |
/health |
GET | Health check |
/version |
GET | Version info |
curl -X POST http://localhost:5051/ask \
-H "Content-Type: application/json" \
-d '{"prompt": "What is the capital of France?"}'curl -X POST http://localhost:5051/chat \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "Hello!"},
{"role": "assistant", "content": "Hi! How can I help?"},
{"role": "user", "content": "What is 2+2?"}
],
"system": "You are a helpful assistant."
}'Set these environment variables to customize behavior:
| Variable | Default | Description |
|---|---|---|
CLAUDE_API_HOST |
127.0.0.1 |
Server host |
CLAUDE_API_PORT |
5051 |
Server port |
CLAUDE_API_TIMEOUT |
120 |
Request timeout (seconds) |
CLAUDE_API_CORS |
false |
Enable CORS |
CLAUDE_API_LOG_LEVEL |
INFO |
Log level |
Example:
CLAUDE_API_PORT=8080 clauditorium"Claude CLI not found"
# Verify Claude CLI is installed
which claude
claude --version"Authentication required"
claude loginRequest timeouts
CLAUDE_API_TIMEOUT=300 clauditoriumCORS errors in browser
CLAUDE_API_CORS=true clauditoriumMIT - see LICENSE