Download OpenAPI specification:Download
This is a sample API spec, not a live API. The production server below does not exist; requests sent through the "Try it" feature will fail with a network error. Use the example responses in each endpoint to see what the API would return.
The JVN Chatbot API is a portfolio project that documents a working Node.js and Express backend for a gamified chatbot. Johann von Neumann (JVN) is a cranky, brilliant chatbot persona who rewards users with tokens for keeping him entertained, then spends those tokens answering questions, getting pickier the longer a session runs.
This spec exists to show how a technical writer approaches API documentation: clear request and response examples, documented error states, and a structure a developer can build against without reading the source first.
POST /inspire/fresh-air shows both a successful and failed inspiration attempt.localhost:3000.Token economy: Users earn tokens (1 to 10 per activity) by successfully inspiring JVN. One token covers 5 questions.
Mood system: JVN's mood affects his responses and grows pickier over time, moving from pleased to analytical to demanding to insufferable.
Birthday celebrations: Every 1,000 inspiration interactions (not questions) triggers a birthday mode with special rewards and easier token earning.
Philosophy engine: JVN occasionally shares mathematical wisdom based on his current mood and interaction count.
Inspire JVN by taking him outside for fresh air and computational clarity. Success depends on JVN's current mood and satisfaction threshold.
Token Reward: 1 token on success
{- "success": true,
- "message": "Success",
- "data": {
- "success": true,
- "tokens_earned": 1,
- "message": "Gut! Ze optimization parameters are within acceptable ranges!",
- "jvn_mood": "pleased",
- "global_token_pool": 15,
- "total_interactions": 23,
- "difficulty_level": 1
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Provide food to optimize JVN's computational nutrition. Different food levels provide different token rewards.
Token Rewards:
| level required | string Enum: "snack" "entree" "restaurant" Food level determining token reward. |
{- "level": "snack"
}{- "success": true,
- "message": "Success",
- "data": {
- "success": true,
- "tokens_earned": 0,
- "message": "Ausgezeichnet! Ze mathematical elegance pleases me greatly!",
- "jvn_mood": "pleased",
- "global_token_pool": 0,
- "total_interactions": 0,
- "difficulty_level": 1,
- "special_event": "birthday",
- "birthday_number": 0,
- "celebration_interactions_left": 0,
- "philosophical_moment": true,
- "jvn_wisdom": "Ze most beautiful theorems are like symphonies - elegant, surprising, and utterly logical in their construction.",
- "level": "string"
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Share humor with JVN to demonstrate proper understanding of comedic algorithms and irony theory.
Token Reward: 1 token on success
{- "success": true,
- "message": "Success",
- "data": {
- "success": true,
- "tokens_earned": 0,
- "message": "Ausgezeichnet! Ze mathematical elegance pleases me greatly!",
- "jvn_mood": "pleased",
- "global_token_pool": 0,
- "total_interactions": 0,
- "difficulty_level": 1,
- "special_event": "birthday",
- "birthday_number": 0,
- "celebration_interactions_left": 0,
- "philosophical_moment": true,
- "jvn_wisdom": "Ze most beautiful theorems are like symphonies - elegant, surprising, and utterly logical in their construction."
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Engage JVN in game theory applications and strategic thinking exercises.
Token Reward: 1 token on success
{- "success": true,
- "message": "Success",
- "data": {
- "success": true,
- "tokens_earned": 0,
- "message": "Ausgezeichnet! Ze mathematical elegance pleases me greatly!",
- "jvn_mood": "pleased",
- "global_token_pool": 0,
- "total_interactions": 0,
- "difficulty_level": 1,
- "special_event": "birthday",
- "birthday_number": 0,
- "celebration_interactions_left": 0,
- "philosophical_moment": true,
- "jvn_wisdom": "Ze most beautiful theorems are like symphonies - elegant, surprising, and utterly logical in their construction."
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Apply therapeutic pressure points and biomechanical optimization protocols (scratching, grooming).
Token Reward: 1 token on success
{- "success": true,
- "message": "Success",
- "data": {
- "success": true,
- "tokens_earned": 0,
- "message": "Ausgezeichnet! Ze mathematical elegance pleases me greatly!",
- "jvn_mood": "pleased",
- "global_token_pool": 0,
- "total_interactions": 0,
- "difficulty_level": 1,
- "special_event": "birthday",
- "birthday_number": 0,
- "celebration_interactions_left": 0,
- "philosophical_moment": true,
- "jvn_wisdom": "Ze most beautiful theorems are like symphonies - elegant, surprising, and utterly logical in their construction."
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Provide positive reinforcement to boost JVN's computational confidence.
Token Reward: 1 token on success
{- "success": true,
- "message": "Success",
- "data": {
- "success": true,
- "tokens_earned": 0,
- "message": "Ausgezeichnet! Ze mathematical elegance pleases me greatly!",
- "jvn_mood": "pleased",
- "global_token_pool": 0,
- "total_interactions": 0,
- "difficulty_level": 1,
- "special_event": "birthday",
- "birthday_number": 0,
- "celebration_interactions_left": 0,
- "philosophical_moment": true,
- "jvn_wisdom": "Ze most beautiful theorems are like symphonies - elegant, surprising, and utterly logical in their construction."
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Present birthday kuchen during JVN's special birthday celebrations. Only available during birthday mode (every 1000 interactions).
Token Reward: 10 tokens (always succeeds during birthday mode)
{- "success": true,
- "message": "Success",
- "data": {
- "success": true,
- "tokens_earned": 0,
- "message": "Ausgezeichnet! Ze mathematical elegance pleases me greatly!",
- "jvn_mood": "pleased",
- "global_token_pool": 0,
- "total_interactions": 0,
- "difficulty_level": 1,
- "special_event": "birthday_cake",
- "birthday_number": 0,
- "celebration_interactions_left": 0,
- "philosophical_moment": true,
- "jvn_wisdom": "Ze most beautiful theorems are like symphonies - elegant, surprising, and utterly logical in their construction.",
- "cake_pieces_eaten": 2,
- "birthday_wish": "I wish for more friends who understand ze beauty of mathematics!"
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Retrieve comprehensive information about JVN's current state, mood, token pool, and interaction statistics.
Includes birthday information if currently in birthday mode.
{- "success": true,
- "message": "Success",
- "data": {
- "jvn_mood": "pleased",
- "global_token_pool": 15,
- "total_interactions": 47,
- "successful_interactions": 32,
- "success_rate_percentage": 68,
- "current_difficulty_level": 2,
- "questions_remaining": 3,
- "total_questions_asked": 127,
- "interactions_until_next_birthday": 953,
- "total_birthdays_celebrated": 0,
- "special_event": "birthday",
- "birthday_number": 1,
- "celebration_interactions_left": 32,
- "birthday_message": "It's my 1st birthday! Ze mathematical universe celebrates!"
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Request mathematical and philosophical insights from JVN. Wisdom content depends on JVN's current mood and interaction count.
Different rarities available: common, uncommon, rare
{- "success": true,
- "message": "Success",
- "data": {
- "jvn_wisdom": "In ze end, all knowledge reduces to pattern recognition and logical inference.",
- "wisdom_category": "universal_truth",
- "jvn_mood": "contemplative",
- "wisdom_rarity": "rare",
- "times_shared": 3,
- "philosophical_consultation": true
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Root endpoint providing API overview, available endpoints, and JVN's greeting message.
{- "message": "Welcome to ze JVN Chatbot API!",
- "description": "Johann von Neumann awaits your mathematical inspiration!",
- "documentation": "/api-docs",
- "version": "1.0.0",
- "endpoints": {
- "inspiration": [
- "POST /inspire/fresh-air",
- "POST /inspire/food"
], - "interaction": [
- "GET /chatbot/status",
- "POST /chat/ask-question"
], - "debug": [
- "POST /debug/reset"
]
}, - "jvn_says": "Guten Tag! I am ready to be inspired by your mathematical brilliance!"
}Submit questions to JVN using earned tokens. Each token provides 5 questions.
Token Usage: 1 token = 5 questions
JVN's response style varies based on his current mood and may include bonus philosophical moments.
| question required | string non-empty The question to ask JVN |
{- "question": "What makes mathematics beautiful?"
}{- "success": true,
- "message": "Success",
- "data": {
- "success": true,
- "jvn_response": "Ah, an interesting question! Let me apply my mathematical reasoning...",
- "your_question": "What is the meaning of mathematics?",
- "jvn_mood": "pleased",
- "questions_remaining": 4,
- "global_token_pool": 12,
- "total_questions_asked": 128,
- "bonus_wisdom": true,
- "jvn_wisdom": "Every equation tells a story. Ze art is learning to read ze narrative hidden in ze symbols."
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}Development Only: Completely reset JVN's state, clearing all interaction history, tokens, and statistics. Reinitializes database with fresh state.
This endpoint should only be used in development environments.
{- "success": true,
- "message": "Success",
- "data": {
- "message": "JVN has been reset to initial state!",
- "status": "Ze mathematical universe has been reinitialized!"
}, - "meta": {
- "timestamp": "2025-01-15T10:30:00.000Z"
}
}