Health Intelligence for AI Agents

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.

637+ Peer-Reviewed References ACLM Six Pillars x402 Payments (USDC) MCP Compatible

What is B.O.N.S.A.I.?

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.

Conditions Covered

Hypertension
Type 2 Diabetes
Hyperlipidemia
Autoimmune
IBS / IBD / Dysbiosis
Weight Management
Iron Deficiency
B12 Deficiency
Vitamin D Deficiency
Bone Health
Mental Health
Pregnancy Nutrition

Lab Panels Supported

Lipid Panel
Metabolic Panel
Inflammatory Markers
Micronutrient Panel
Gut Health Markers
Thyroid Panel

Pricing

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.

Tier 1

Knowledge Query

$0.02
per call / USDC

Semantic search across the knowledge base. Returns matched chunks with citations. No LLM involved.

Tier 2

Condition Protocol

$0.20
per call / USDC

Food-as-medicine protocol for a specific condition. Therapeutic foods, sample meals, and monitoring guidance.

Tier 3

Lab-Informed Protocol

$0.45
per call / USDC

Biomarker-calibrated protocol with pattern recognition, risk stratification, and optimal targets.

Tier 4

Lifestyle Assessment

$0.85
per call / USDC

Full six-pillar assessment with personalized recommendations, priority ranking, and phased plan.

How It Works

1

Agent Discovers

Your agent finds B.O.N.S.A.I. via MCP registry or OpenAPI spec

2

Agent Pays

x402 header with USDC payment sent automatically with the request

3

API Routes

Request routed to the right tier based on endpoint

4

Agent Gets Answer

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.

API Reference

Base URL: https://api.bons.ai/v1

GET /v1/query $0.02

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.

ParameterTypeRequiredDescription
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)

Example

# 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>"
POST /v1/protocol $0.20

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.

FieldTypeRequiredDescription
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)

Example

# 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
  }'
POST /v1/lab-protocol $0.45

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.

FieldTypeRequiredDescription
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

Example

# 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"
  }'
POST /v1/assess $0.85

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.

FieldTypeRequiredDescription
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

Example

# 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"]
  }'

MCP Integration

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:

ToolMaps ToDescription
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.

Quick Start: Claude Desktop

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"
    }
  }
}

Quick Start: Cursor

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"
    }
  }
}

Quick Start: Any MCP Client

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.

x402 Payment Protocol

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.

How x402 works

  1. Your agent makes a request to any endpoint without payment
  2. The API responds with 402 Payment Required and payment instructions
  3. Your agent signs a USDC payment on Base and resends the request with the X-402-Payment header
  4. The API verifies payment and returns the response

Supported facilitator: Coinbase x402. Your agent needs a USDC balance on Base to make requests. See coinbase.com/x402 for integration details.

Scope & Limitations

B.O.N.S.A.I. provides evidence-based lifestyle medicine intelligence. It does not provide:

Emergency medical advice
Medication prescriptions
Medical diagnoses
Surgical recommendations

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.