AI Analysis
Ask natural language questions about your business data. Powered by your configured AI provider (Claude, GPT-4, or Gemini), or falls back to rule-based answers from the database.
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
| Field | Type | Required | Description |
|---|---|---|---|
| question | String | required | Natural 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
- "How is my revenue trending this month vs last month?"
- "Which products are running low on stock?"
- "Who are my top 5 customers by spending?"
- "What is my average order value this quarter?"
- "How many new customers did I acquire this week?"