Evidence-based WFPB lifestyle medicine protocols, lab interpretation, and six-pillar assessments — accessible to any AI agent via a simple API. Pay per call with x402. No API keys. No subscriptions.
Biologically-driven, Observationally-validated, Nutritionally-tested, Safe, Accessible, Integrative — a health intelligence framework grounded in whole-food plant-based (WFPB) lifestyle medicine and the ACLM Six Pillars.
This API lets your AI agent query our knowledge base, generate condition-specific food-as-medicine protocols, interpret lab results with pattern recognition, and run full six-pillar lifestyle assessments. Every response is backed by clinical evidence from the AHA, ADA, WHO, and peer-reviewed literature.
Pay per call via the x402 protocol using USDC on Base (Coinbase L2). No API keys, no monthly billing. Your agent sends a payment header with each request and gets the response instantly.
Semantic search across the knowledge base. Returns matched chunks with citations. No LLM involved.
Food-as-medicine protocol for a specific condition. Therapeutic foods, sample meals, and monitoring guidance.
Biomarker-calibrated protocol with pattern recognition, risk stratification, and optimal targets.
Full six-pillar assessment with personalized recommendations, priority ranking, and phased plan.
Your agent finds B.O.N.S.A.I. via MCP registry or OpenAPI spec
x402 header with USDC payment sent automatically with the request
Request routed to the right tier based on endpoint
Evidence-based response with citations and B.O.N.S.A.I. scoring
No API keys needed. The x402 payment header is your authentication. Any agent with a USDC wallet on Base can start making requests immediately.
Base URL: https://api.bons.ai/v1
Semantic search across the B.O.N.S.A.I. knowledge base. Returns evidence-based chunks with clinical citations. No LLM call — pure vector retrieval for maximum speed.
| Parameter | Type | Required | Description |
|---|---|---|---|
q |
string | required | Natural language health question |
pillar |
string | optional | Filter by pillar: nutrition, physical_activity, sleep, stress_management, substance_avoidance, social_connection |
limit |
integer | optional | Max results to return (default: 3) |
# Query the knowledge base curl "https://api.bons.ai/v1/query?q=best+foods+for+lowering+blood+pressure&pillar=nutrition&limit=3" \ -H "X-402-Payment: <x402_payment_header>"
Generate a B.O.N.S.A.I.-scored food-as-medicine protocol for a specific condition. Returns therapeutic foods ranked by evidence score, sample meals, and monitoring guidance.
| Field | Type | Required | Description |
|---|---|---|---|
condition |
string | required | hypertension, type_2_diabetes, hyperlipidemia, autoimmune, gi_health, weight_management |
user_context |
object | optional | Age, dietary restrictions, current medications, severity (mild/moderate/severe) |
duration_weeks |
integer | optional | Protocol duration, 1–12 weeks (default: 4) |
# Generate a hypertension protocol curl -X POST "https://api.bons.ai/v1/protocol" \ -H "Content-Type: application/json" \ -H "X-402-Payment: <x402_payment_header>" \ -d '{ "condition": "hypertension", "user_context": { "age": 52, "severity": "moderate" }, "duration_weeks": 4 }'
Generate a biomarker-calibrated dietary protocol using the B.O.N.S.A.I. labs engine. Features pattern recognition (insulin resistance cluster, dysbiosis cluster, cardiovascular risk cluster), risk stratification (red/orange/yellow/green), and optimal targets beyond standard reference ranges.
| Field | Type | Required | Description |
|---|---|---|---|
lab_values |
object | required | Key-value pairs of biomarker names and values with units |
health_goals |
array | optional | List of health goals |
current_medications |
array | optional | List of current medications |
condition |
string | optional | Primary condition if known |
# Get a lab-informed protocol curl -X POST "https://api.bons.ai/v1/lab-protocol" \ -H "Content-Type: application/json" \ -H "X-402-Payment: <x402_payment_header>" \ -d '{ "lab_values": { "fasting_glucose": "105 mg/dL", "HbA1c": "6.1%", "LDL": "142 mg/dL", "HDL": "38 mg/dL", "triglycerides": "188 mg/dL", "CRP": "3.2 mg/L" }, "health_goals": ["reduce inflammation", "improve insulin sensitivity"], "condition": "type_2_diabetes" }'
Full six-pillar lifestyle medicine assessment. Submit the user's current habits and receive personalized recommendations across nutrition, physical activity, sleep, stress management, substance avoidance, and social connection — with priority ranking, clinical basis, and a phased improvement plan.
| Field | Type | Required | Description |
|---|---|---|---|
current_habits |
object | required | Includes: diet_description, exercise_minutes_per_week, sleep_hours_per_night, stress_level, tobacco_use, alcohol_drinks_per_week, social_connection_quality |
health_goals |
array | optional | User's health goals |
lab_values |
object | optional | Optional lab values for enhanced personalization |
# Run a full lifestyle assessment curl -X POST "https://api.bons.ai/v1/assess" \ -H "Content-Type: application/json" \ -H "X-402-Payment: <x402_payment_header>" \ -d '{ "current_habits": { "diet_description": "Standard American diet, fast food 3x/week", "exercise_minutes_per_week": 60, "sleep_hours_per_night": 5.5, "stress_level": "high", "tobacco_use": false, "alcohol_drinks_per_week": 8, "social_connection_quality": "limited" }, "health_goals": ["lose weight", "sleep better", "reduce stress"] }'
B.O.N.S.A.I. is available as a Model Context Protocol (MCP) server, enabling native discovery by AI platforms like Claude, ChatGPT, and Gemini. Four tools are exposed:
| Tool | Maps To | Description |
|---|---|---|
health_query |
GET /v1/query | Ask a health or nutrition question with optional pillar filtering |
generate_protocol |
POST /v1/protocol | Generate a food-as-medicine protocol for a specific condition |
lab_informed_protocol |
POST /v1/lab-protocol | Biomarker-calibrated protocol with pattern recognition |
lifestyle_assessment |
POST /v1/assess | Full six-pillar lifestyle assessment with phased plan |
For AI platform developers: The full MCP tool specification is available at https://api.bons.ai/.well-known/mcp.json. Register B.O.N.S.A.I. in your MCP directory to make it discoverable to your agents.
Add this to your claude_desktop_config.json and restart Claude. Your Claude will instantly have access to all four B.O.N.S.A.I. tools.
// ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) // %APPDATA%\Claude\claude_desktop_config.json (Windows) { "mcpServers": { "bonsai-health": { "url": "https://web-production-ae61.up.railway.app" } } }
Add this to your .cursor/mcp.json in any project root — or globally at ~/.cursor/mcp.json.
{
"mcpServers": {
"bonsai-health": {
"url": "https://web-production-ae61.up.railway.app"
}
}
}
Point any MCP-compatible client at the server URL. The tool manifest is auto-served at /.well-known/mcp.json.
# Server URL https://web-production-ae61.up.railway.app # MCP Registry ID io.github.rabyavalla/bonsai-health
30-second setup: Copy one of the config blocks above, paste it into your config file, restart the client, and you're connected. No API keys needed — payment happens automatically via x402 when your agent calls a tool.
All endpoints use the x402 protocol for payment. This means your agent pays per call using USDC on the Base network (Coinbase L2). No API keys, no OAuth, no billing accounts.
402 Payment Required and payment instructionsX-402-Payment headerSupported facilitator: Coinbase x402. Your agent needs a USDC balance on Base to make requests. See coinbase.com/x402 for integration details.
B.O.N.S.A.I. provides evidence-based lifestyle medicine intelligence. It does not provide:
Disclaimer: B.O.N.S.A.I. provides educational health and nutrition information grounded in peer-reviewed evidence. It is not a substitute for professional medical advice, diagnosis, or treatment. Always consult a qualified healthcare provider for medical decisions. Agents integrating this API should present responses as informational, not prescriptive.
Medical Disclaimer: The B.O.N.S.A.I. Health Intelligence API provides educational information about nutrition and lifestyle medicine based on peer-reviewed evidence and clinical guidelines from organizations including the American College of Lifestyle Medicine (ACLM), American Heart Association (AHA), American Diabetes Association (ADA), and World Health Organization (WHO). This information is not intended to be a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of a qualified healthcare provider with any questions regarding a medical condition. Never disregard professional medical advice or delay in seeking it because of information provided by this API. If you think you may have a medical emergency, call your doctor or emergency services immediately.