Skip to main content

Global AI Settings (Super Admin)

Super Admins can configure company-wide AI settings that serve as a fallback for users who haven't configured personal AI settings.

Super Admin Only

This feature is only available to Super Admin users. Organization Admins and regular users cannot access Global AI Settings.

Overview

How Global AI Settings Work

NirmIQ uses a priority-based system for AI configuration:

Priority 1: User Personal Settings (highest priority)
↓ (if not configured)
Priority 2: Global Company Settings (Super Admin)
↓ (if not configured)
Error: "AI not configured"

Key Principle: User settings always override global settings.

This allows:

  • ✅ Organizations to provide AI features to all users
  • ✅ Users to bring their own API keys for unlimited usage
  • ✅ Flexible billing (company pays vs. user pays)
  • ✅ Mixed deployment (some users use company key, others use personal)

Use Cases

Provide Global AI for All Users:

  • Configure global settings with company API key
  • Users without personal settings automatically use global
  • Centralized billing and usage tracking

Optional Fallback:

  • Users can configure personal settings for full control
  • Personal settings take precedence when configured
  • Global serves as backup for users who don't want to manage keys

Cost Management:

  • Company controls AI budget via global API key limits
  • Users who want unlimited usage provide their own keys
  • Track usage breakdown (user vs. company) in AI Usage Statistics

Accessing Global AI Settings

  1. Login as Super Admin

    • Must have super_admin role
    • Organization Admins cannot access this feature
  2. Go to Super Admin Dashboard

    • Click "Super Admin" in sidebar
    • Scroll to "Global AI Settings" section
  3. Click "Show Settings"

    • Settings panel expands
    • Shows current configuration

Dashboard Location

Super Admin Dashboard
├── Organization Management
├── User Management
├── Global AI Settings ← HERE
│ ├── [Show Settings] button
│ └── (Settings panel when expanded)
└── AI Usage Statistics

Configuring Global AI Settings

Step-by-Step Configuration

1. Show Settings Panel

Click "Show Settings" button to expand the configuration form.

2. Select AI Provider

Choose from dropdown:

  • Google Gemini - Fast, cost-effective (free tier available)
  • ChatGPT (OpenAI) - Industry-leading language model
  • Claude (Anthropic) - Advanced reasoning capabilities
  • Grok (xAI) - Cutting-edge AI from xAI
  • DeepSeek - High-performance AI analysis
Choosing a Provider

See AI Integration Guide for detailed provider comparison.

3. Enter Model Name

Model dropdown auto-populates based on provider:

ProviderCommon Models
Geminigemini-pro, gemini-2.0-flash-exp, gemini-1.5-flash, gemini-1.5-flash-8b
ChatGPTgpt-4, gpt-4-turbo-preview, gpt-3.5-turbo
Claudeclaude-3-sonnet-20240229, claude-3-haiku-20240307, claude-3-opus-20240229
Grokgrok-beta, grok-vision-beta
DeepSeekdeepseek-chat, deepseek-coder

4. Add Company API Key

Enter your organization's API key for the selected provider.

Where to get API keys:

API Key Security

API keys are stored encrypted in the database. Displayed as masked passwords in UI. Never logged or exposed in error messages.

5. Enable Global AI Settings

Check "Enable global AI settings" checkbox to activate.

6. Save Configuration

Click "Save Global AI Settings" button.

Success: You'll see a success toast notification.

Configuration Form

Global AI Settings
┌──────────────────────────────────────────────────┐
│ AI Provider: [▼ Select provider...] │
│ • Google Gemini │
│ • ChatGPT (OpenAI) │
│ • Claude (Anthropic) │
│ • Grok (xAI) │
│ • DeepSeek │
├──────────────────────────────────────────────────┤
│ Model: [▼ Select model...] │
│ (Auto-populated based on provider) │
├──────────────────────────────────────────────────┤
│ API Key: [●●●●●●●●●●●●●●●●●●●●] │
│ (Masked for security) │
├──────────────────────────────────────────────────┤
│ ☑ Enable global AI settings │
├──────────────────────────────────────────────────┤
│ [Save Global AI Settings] │
└──────────────────────────────────────────────────┘

ℹ️ Note: These global settings apply to organizations that
haven't configured their own AI settings. User-provided
API keys always take precedence.

How Users Experience Global Settings

User Has NOT Configured Personal AI

Scenario: User hasn't set up AI in Settings page.

What Happens:

  1. User clicks "AI Analyze" button on a requirement
  2. System checks: User has no personal AI settings
  3. System falls back to Global AI Settings
  4. API call uses company API key (global settings)
  5. AI analysis runs successfully
  6. Usage tracked as "Global API Call" in statistics

User Experience: Seamless - AI features "just work" without configuration.

User HAS Configured Personal AI

Scenario: User has set up personal API key in Settings.

What Happens:

  1. User clicks "AI Analyze" button on a requirement
  2. System checks: User has personal AI settings with API key
  3. Personal settings take precedence (global ignored)
  4. API call uses user's personal API key
  5. AI analysis runs successfully
  6. Usage tracked as "User API Call" in statistics

User Experience: Full control, unlimited usage (within personal API limits).

Priority System in Action

Example Organization:

Company: Acme Corp
Global Settings: Gemini (gemini-pro) with company API key
Users: 10 total

Alice: No personal AI settings
→ Uses global settings (Gemini)
→ Company pays for API calls

Bob: Personal settings (ChatGPT GPT-4)
→ Uses personal settings (ignores global)
→ Bob pays for API calls

Charlie: Personal settings (Claude Sonnet)
→ Uses personal settings (ignores global)
→ Charlie pays for API calls

7 other users: No personal AI settings
→ Use global settings (Gemini)
→ Company pays for API calls

AI Usage Statistics would show:

  • Total Calls: 1000
  • User API Calls: 300 (Bob + Charlie)
  • Global API Calls: 700 (Alice + 7 others)

Viewing Current Settings

Settings Display

When you click "Show Settings", the form displays current configuration:

If Global Settings Configured:

AI Provider:  Google Gemini
Model: gemini-pro
API Key: ●●●●●●●●●●AIzaSy... (last 4 chars visible)
☑ Enable global AI settings (checked)

If NOT Configured:

AI Provider:  (empty)
Model: (empty)
API Key: (empty)
☐ Enable global AI settings (unchecked)

Editing Existing Settings

To change global settings:

  1. Click "Show Settings" (if hidden)
  2. Modify any field (provider, model, API key)
  3. Keep "Enable global AI settings" checked
  4. Click "Save Global AI Settings"
Immediate Effect

Changes take effect immediately. Next AI call uses new settings.

Disabling Global AI Settings

How to Disable

Option 1: Uncheck Enable Checkbox

  1. Click "Show Settings"
  2. Uncheck "Enable global AI settings"
  3. Click "Save"

Option 2: Remove API Key

  1. Click "Show Settings"
  2. Clear the API Key field
  3. Click "Save"

Effect of Disabling

When global AI is disabled:

  • Users with personal settings → Continue using personal settings (unaffected)
  • Users WITHOUT personal settings → See error: "AI not configured. Please configure your AI settings in the Settings page."

Use Case: Force all users to provide their own API keys (no company-provided AI).

Best Practices

For Organizations

1. Provide Global Settings as Baseline

Do:

  • Configure global AI with company API key
  • Gives all users AI features by default
  • Centralized cost management
  • Easier onboarding (AI works out-of-the-box)

Don't:

  • Force users to configure personal settings
  • Leave global settings empty (users confused why AI doesn't work)

2. Choose Cost-Effective Provider

For global company AI:

  • Budget-conscious: Google Gemini (free tier, then low cost)
  • Best quality: ChatGPT GPT-4 (higher cost)
  • Balanced: Gemini 2.0 Flash (fast and affordable)

3. Set API Limits

On your provider dashboard:

  • Set monthly spending limits (e.g., $100/month)
  • Configure rate limits (e.g., 1000 requests/day)
  • Set up billing alerts
  • Monitor usage regularly

4. Communicate to Users

Tell your team:

  • ✅ "AI features work automatically (company-provided)"
  • ✅ "Want unlimited AI? Configure personal settings in Settings page"
  • ✅ "Personal API keys take priority over company settings"

For Power Users

If you want users to provide their own keys:

Option A: Disable Global Settings

  • Users must configure personal AI to use features
  • Company pays nothing
  • Higher barrier to adoption

Option B: Provide Global as Fallback

  • Users can use company AI (limited)
  • Power users configure personal AI (unlimited)
  • Best of both worlds

Security Considerations

API Key Protection:

  • ✅ Keys stored encrypted in database
  • ✅ Displayed masked in UI (●●●●●●)
  • ✅ Never logged in error messages
  • ✅ Transmitted over HTTPS only

Access Control:

  • ✅ Super Admin only (not Organization Admins)
  • ✅ Row-Level Security enforced at database level
  • ✅ Audit trail for changes (coming soon)

Best Practices:

  • 🔐 Use dedicated API key for NirmIQ (not personal)
  • 🔐 Rotate keys periodically (every 90 days)
  • 🔐 Set spending limits on provider dashboard
  • 🔐 Monitor usage for anomalies

Cost Management

Understanding AI Costs

Company Pays When:

  • Global AI settings configured and enabled
  • Users without personal settings use AI features
  • Usage tracked in "Global API Calls"

Users Pay When:

  • User has personal AI settings with API key
  • Usage tracked in "User API Calls"

Cost Breakdown Example:

Monthly AI Usage: 10,000 API calls
├── User API Calls: 3,000 (users with personal keys)
│ Cost: $0 to company (users pay directly)
└── Global API Calls: 7,000 (using company key)
Cost: ~$7-$70 depending on provider/model

Estimating Costs

Gemini Pricing (as of 2024):

  • Free tier: 15 requests/minute
  • Paid: ~$0.001 per request (varies by model)
  • 7,000 requests ≈ $7/month

ChatGPT Pricing:

  • GPT-3.5-turbo: ~$0.002 per request
  • GPT-4: ~$0.06 per request
  • 7,000 requests ≈ $14-$420/month

Claude Pricing:

  • Claude Haiku: ~$0.001 per request
  • Claude Sonnet: ~$0.015 per request
  • Claude Opus: ~$0.075 per request
  • 7,000 requests ≈ $7-$525/month
Cost Control

Use AI Usage Statistics to monitor breakdown and adjust strategy.

Optimizing Costs

1. Encourage Personal API Keys

Educate power users:

  • "Configure personal AI for unlimited usage"
  • "Control your own costs and provider choice"
  • "Personal settings take priority"

2. Choose Affordable Model

For global settings:

  • Gemini 2.0 Flash (fastest, cheapest)
  • ChatGPT 3.5-turbo (good quality, affordable)
  • Claude Haiku (cheap, fast)

Avoid expensive models for global:

  • ❌ GPT-4 (unless budget allows)
  • ❌ Claude Opus (most expensive)

3. Set API Limits

On provider dashboard:

  • Monthly budget cap (e.g., $50/month)
  • Daily request limit (e.g., 500/day)
  • Rate limiting (prevent abuse)

Troubleshooting

Global Settings Not Saving

Error: Click "Save" but settings don't persist

Possible Causes:

  1. Not Super Admin - Check role in user management
  2. Missing Required Fields - Provider, model, or API key empty
  3. Invalid API Key - Key format incorrect
  4. Network Issue - Check internet connection

Solution:

  • Verify all fields filled
  • Test API key on provider's platform first
  • Check browser console for errors

Users Still See "AI Not Configured"

Error: Global settings configured, but users see error

Possible Causes:

  1. Global Settings Not Enabled - Checkbox unchecked
  2. Invalid API Key - Key expired or wrong
  3. API Billing Issue - Provider account has no credits
  4. User Has Personal Settings - Empty personal settings override global

Solution:

  • Verify "Enable global AI settings" is checked
  • Test API key manually (try on provider's playground)
  • Check provider account has credits/active billing
  • Ask user to delete personal AI settings (or fill them completely)

Different Behavior for Different Users

Issue: Alice's AI works, Bob's doesn't

Cause: User-level settings override global

Investigation:

  1. Check if Bob has personal AI settings configured
  2. If yes: Bob's personal key might be invalid
  3. If no: Bob should be using global (check global key valid)

Solution:

  • Bob should either delete personal settings (use global) OR fix personal API key
  • See AI Integration Guide for user settings help

High API Costs

Issue: Unexpected high bills from AI provider

Investigation:

  1. Check AI Usage Statistics dashboard
  2. See "Global API Calls" count
  3. Identify heavy usage patterns

Solutions:

  • Set spending limits on provider dashboard
  • Switch to cheaper model (Gemini vs GPT-4)
  • Encourage users to provide personal keys
  • Disable global AI, require users to configure personal

Questions? Contact support or visit our Training Portal