HTTP API for Claude CLI Headless Mode
/bot/prompt - Send a one-shot prompt/bot/prompt/stream - Stream prompt response/bot/conversation - Conversation with session/bot/sessions/{session_id} - Delete a session/bot/channel/line/webhook - LINE webhook/bot/channel/line/trigger - Trigger message by tag/bot/channel/eko/webhook - Eko webhook
# Simple prompt
curl -X POST http://localhost:8788/bot/prompt \
-H "Content-Type: application/json" \
-d '{"prompt": "What is 2+2?"}'
# With model selection
curl -X POST http://localhost:8788/bot/prompt \
-H "Content-Type: application/json" \
-d '{"prompt": "Explain quantum computing", "model": "opus"}'
# With system prompt
curl -X POST http://localhost:8788/bot/prompt \
-H "Content-Type: application/json" \
-d '{
"prompt": "Hello!",
"system_prompt": "You are a helpful coding assistant."
}'
# Trigger message to tagged channels
curl -X POST http://localhost:8788/bot/channel/line/trigger \
-H "Content-Type: application/json" \
-d '{
"prompt": "Summarize today's tech news",
"tag": "morning-news",
"model": "opus"
}'