> ## Documentation Index
> Fetch the complete documentation index at: https://dashtray.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Ai insights

# AI Insights Guide

Use AI to ask questions about your metrics and get intelligent insights - all while maintaining complete control over your data with BYOK (Bring Your Own Key).

## Overview

Dashtray's AI Insights feature lets you chat with your data using natural language. Ask questions, get summaries, identify trends, and receive recommendations - all powered by your own AI API key.

**Availability**: All plans (Free, Pro, Scale, Agency)

## What is BYOK (Bring Your Own Key)?

BYOK means **you** provide your own AI API key from OpenAI or Anthropic:

### Benefits

✅ **Complete data control**: Your data goes directly to your AI provider
✅ **Privacy first**: We never train on your data
✅ **Transparent costs**: You pay your AI provider directly
✅ **No markup**: We don't charge extra for AI features
✅ **Your choice**: Use OpenAI or Anthropic

### How It Works

1. You provide your API key (encrypted and stored securely)
2. You ask a question in Dashtray
3. We fetch relevant metrics from your integrations
4. We send the question + metrics to your AI provider using your key
5. AI response is displayed in Dashtray
6. You're billed directly by your AI provider

## Setting Up AI Insights

### Step 1: Choose Your AI Provider

**OpenAI** (ChatGPT)

* Models: GPT-4, GPT-3.5
* Pricing: Pay-as-you-go
* Sign up: [platform.openai.com](https://platform.openai.com)

**Anthropic** (Claude)

* Models: Claude 3 (Opus, Sonnet, Haiku)
* Pricing: Pay-as-you-go
* Sign up: [console.anthropic.com](https://console.anthropic.com)

### Step 2: Get Your API Key

**For OpenAI**:

1. Go to [platform.openai.com/api-keys](https://platform.openai.com/api-keys)
2. Click **Create new secret key**
3. Name your key (e.g., "Dashtray")
4. Copy the key (starts with `sk-`)
5. **Save it securely** (you won't see it again)

**For Anthropic**:

1. Go to [console.anthropic.com/settings/keys](https://console.anthropic.com/settings/keys)
2. Click **Create Key**
3. Name your key (e.g., "Dashtray")
4. Copy the key (starts with `sk-ant-`)
5. **Save it securely** (you won't see it again)

### Step 3: Configure in Dashtray

1. Click **Insights** in the sidebar
2. Click **Setup AI Key** (first time only)
3. Select your provider (OpenAI or Anthropic)
4. Paste your API key
5. Click **Test Connection** to verify
6. Click **Save**

Your API key is encrypted using AES-256-GCM before storage.

### Step 4: Start Asking Questions

1. Type your question in the chat input
2. Press Enter or click Send
3. AI will analyze your metrics and respond
4. Continue the conversation with follow-up questions

## Example Questions

### Revenue & Growth

* "What's my MRR trend over the last 3 months?"
* "How much revenue did I make last month?"
* "What's my churn rate and how does it compare to last quarter?"
* "Show me my ARR growth rate"
* "Which month had the highest revenue?"

### Traffic & Engagement

* "How many visitors did I get this week?"
* "What's my bounce rate and is it improving?"
* "Compare page views from last month to this month"
* "What's my average session duration?"
* "Show me traffic trends over the last 90 days"

### Development Activity

* "How many commits did my team make this week?"
* "What's our pull request merge rate?"
* "How many deployments did we have last month?"
* "Show me our build success rate"
* "Compare development activity this quarter vs last quarter"

### Subscriptions

* "How many active subscriptions do I have?"
* "What's my subscription growth rate?"
* "How many customers canceled this month?"
* "Show me subscription trends"
* "What's my customer lifetime value?"

### Comparisons

* "Compare this month's metrics to last month"
* "Show me year-over-year growth"
* "What's changed in the last 7 days?"
* "Compare weekday vs weekend traffic"
* "Which integration has the best metrics?"

### Insights & Recommendations

* "What are my top 3 metrics to focus on?"
* "Identify any concerning trends"
* "What's performing well?"
* "Give me a summary of my business health"
* "What should I be worried about?"

## Quick Insights

The Insights page includes pre-generated quick insights:

### Metric Summaries

* Current values for key metrics
* Trend indicators (up/down)
* Comparison to previous period

### Suggested Questions

* Common questions based on your integrations
* Click to ask instantly
* Customized to your data

### Trend Analysis

* Automatic identification of significant changes
* Anomaly detection
* Growth/decline patterns

## Conversation History

Your AI conversations are saved:

1. **View history**: Scroll up in the chat
2. **Continue conversations**: Pick up where you left off
3. **Start new**: Click "New Conversation" to start fresh
4. **Search**: Find previous conversations (coming soon)

**Privacy**: Conversations are stored in your project database, not shared with anyone.

## Best Practices

### Asking Questions

* **Be specific**: "MRR last month" vs "revenue"
* **Include time ranges**: "last 7 days", "this quarter"
* **Ask follow-ups**: Build on previous answers
* **Request comparisons**: "compare X to Y"
* **Ask for explanations**: "why did X happen?"

### Getting Better Answers

* **Provide context**: Mention specific metrics or integrations
* **Use natural language**: Ask like you're talking to a colleague
* **Break down complex questions**: Ask multiple simpler questions
* **Verify numbers**: Cross-check with your dashboards
* **Iterate**: Refine your question if the answer isn't helpful

### Managing Costs

* **Monitor usage**: Check your AI provider's dashboard
* **Use efficiently**: Ask focused questions
* **Choose models wisely**: GPT-3.5 is cheaper than GPT-4
* **Set budgets**: Configure spending limits in your AI provider account

## Understanding AI Responses

### What AI Can Do

✅ Analyze trends and patterns
✅ Compare metrics across time periods
✅ Summarize data
✅ Identify anomalies
✅ Provide recommendations
✅ Answer questions about your data

### What AI Cannot Do

❌ Access data not in Dashtray
❌ Make changes to your integrations
❌ Predict the future with certainty
❌ Access other users' data
❌ Execute actions (e.g., send emails)

### Accuracy

* AI responses are based on your actual metrics
* Numbers are pulled directly from your integrations
* Interpretations and recommendations are AI-generated
* Always verify critical decisions with raw data

## Security & Privacy

### Data Protection

* **Encrypted storage**: API keys encrypted with AES-256-GCM
* **Direct communication**: Your data goes directly to your AI provider
* **No training**: We never use your data to train AI models
* **No sharing**: Your conversations are private to your project

### What We Send to AI

When you ask a question, we send:

* Your question
* Relevant metrics from your integrations
* Metric metadata (names, units, timestamps)

We **never** send:

* API keys or credentials
* Personal information
* Data from other users
* Unrelated metrics

### Revoking Access

To stop using AI Insights:

1. Go to **Settings** → **AI Configuration**
2. Click **Remove API Key**
3. Confirm removal
4. Delete the key in your AI provider's dashboard

## Troubleshooting

### "API Key Required"

1. Click **Setup AI Key**
2. Follow setup instructions above
3. Ensure you copied the entire key
4. Test connection before saving

### "Connection Failed"

**OpenAI**:

* Verify key starts with `sk-`
* Check key hasn't been revoked
* Ensure you have API credits
* Check [status.openai.com](https://status.openai.com)

**Anthropic**:

* Verify key starts with `sk-ant-`
* Check key hasn't been revoked
* Ensure you have API credits
* Check [status.anthropic.com](https://status.anthropic.com)

### "No Data Available"

1. **Connect integrations**: AI needs data to analyze
2. **Wait for sync**: Initial sync takes 5-10 minutes
3. **Check time range**: Ensure data exists for the period
4. **Verify connections**: Check integration status

### "Rate Limit Exceeded"

Your AI provider has rate limits:

**OpenAI**:

* Free tier: 3 requests/minute
* Paid tier: Higher limits based on usage
* Solution: Wait a minute or upgrade your OpenAI plan

**Anthropic**:

* Varies by plan
* Solution: Wait or upgrade your Anthropic plan

### Unexpected Responses

1. **Rephrase question**: Try asking differently
2. **Be more specific**: Add details or context
3. **Check data**: Verify metrics in dashboards
4. **Start new conversation**: Click "New Conversation"

## Cost Estimation

### OpenAI Pricing (as of 2024)

**GPT-4**:

* Input: \$0.03 per 1K tokens
* Output: \$0.06 per 1K tokens
* Typical question: $0.01 - $0.05

**GPT-3.5 Turbo**:

* Input: \$0.0015 per 1K tokens
* Output: \$0.002 per 1K tokens
* Typical question: $0.001 - $0.01

### Anthropic Pricing (as of 2024)

**Claude 3 Opus**:

* Input: \$0.015 per 1K tokens
* Output: \$0.075 per 1K tokens
* Typical question: $0.01 - $0.05

**Claude 3 Sonnet**:

* Input: \$0.003 per 1K tokens
* Output: \$0.015 per 1K tokens
* Typical question: $0.002 - $0.01

**Claude 3 Haiku**:

* Input: \$0.00025 per 1K tokens
* Output: \$0.00125 per 1K tokens
* Typical question: $0.0001 - $0.001

**Estimated Monthly Cost**: $5-$50 depending on usage

## FAQ

**Q: Which AI provider should I choose?**
A: Both are excellent. OpenAI (GPT-4) is popular and powerful. Anthropic (Claude) is known for longer context and nuanced responses. Try both!

**Q: Can I switch providers?**
A: Yes, update your API key in Settings → AI Configuration.

**Q: Is my data used to train AI models?**
A: No. We explicitly opt out of training, and you control your own API key.

**Q: Can other users see my conversations?**
A: No. Conversations are private to your project.

**Q: How much will this cost me?**
A: Depends on usage. Typical users spend $5-$20/month. Monitor in your AI provider dashboard.

**Q: Can I use AI without an API key?**
A: No. BYOK is required to maintain privacy and control.

**Q: What if I run out of API credits?**
A: Add credits in your AI provider account. Dashtray will show an error until credits are added.

**Q: Can AI make changes to my integrations?**
A: No. AI is read-only and can only analyze data.

**Q: How long are conversations stored?**
A: Based on your plan's data retention policy (3 days for Free, unlimited for Pro+).

## Need Help?

* Email: [support@dashtray.com](mailto:support@dashtray.com)
* OpenAI Documentation: [platform.openai.com/docs](https://platform.openai.com/docs)
* Anthropic Documentation: [docs.anthropic.com](https://docs.anthropic.com)
* Community: Join our Discord for AI tips and tricks


Built with [Mintlify](https://mintlify.com).