AI Analysis API

Endpoint

POST/ai/analyzeAsk a business question

Provider setup Configure your AI provider in Settings → Integrations → AI. Supports Anthropic (Claude), OpenAI (GPT), and Google Gemini. Without a configured provider, answers are computed directly from your database.

Request

FieldTypeRequiredDescription
questionStringrequiredNatural language question about your business
POST /ai/analyze
{
  "question": "What are my top 3 best-selling products this month?"
}

Response

{
  "success": true,
  "data": {
    "question": "What are my top 3 best-selling products this month?",
    "answer": "Your top 3 products this month by revenue are: 1. Widget Pro ($12,450), 2. Smart Hub ($8,200), 3. Cable Kit ($3,100). Widget Pro accounts for 52% of your total revenue.",
    "source": "ai",
    "provider": "anthropic"
  }
}

When no AI is configured, source is "database" and the answer is a summary computed from your data.

Example questions