Skip to main content

API Configuration

Configure your Moorcheh AI integration for optimal chat performance.

Environment Variables

Set your API key in the environment:
# .env.local
NEXT_PUBLIC_MOORCHEH_API_KEY=your_api_key_here

API Configuration File

Create config/api-config.json with your settings:
{
  "namespace": "test",
  "query": "",
  "top_k": 15,
  "type": "text",
  "aiModel": "anthropic.claude-3-7-sonnet-20250219-v1:0",
  "temperature": 0.7,
  "kiosk_mode": true,
  "threshold": 0.01,
  "chatHistory": [
    {
      "role": "assistant",
      "content": "Hello! I'm Moorcheh AI, ready to assist you. How can I help you today?"
    }
  ],
  "headerPrompt": "You are a helpful AI assistant. Based on the provided context and chat history, please answer the user's query. If the context is not sufficient, say you don't have enough information.",
  "footerPrompt": "Base your answers on the context provided in the following context block and on our chat history. When using context chunks, prioritize information from chunks with higher relevance labels. Pay special attention to content labeled as 'Close Match' or 'Very High Relevance' as these are most likely to contain the most pertinent information for answering the query."
}

Quick Setup via Console

The easiest way to configure your API settings:
1

Visit Playground

2

Select Namespace

Choose your text namespace from the dropdown
3

Choose AI Model

Select your preferred AI model
4

Adjust Parameters

Configure temperature, top-k, and other parameters
5

Export Configuration

Click “Export” to download the complete configuration
6

Save Configuration

Copy the JSON content into config/api-config.json

Branding Configuration

Customize your application’s branding and appearance. Use the interactive setup flow for instant preview and configuration:
Visit http://localhost:3000/landing to use our 4-step interactive setup flow.

Manual Configuration

Edit config/appearance.json directly:
{
  "fonts": {
    "primary": "Inter",
    "heading": "Playfair Display",
    "mono": "JetBrains Mono"
  },
  "theme": {
    "defaultTheme": "slate"
  },
  "branding": {
    "appName": "My Chat App",
    "appTitle": "My Chat",
    "appSubtitle": "How can I help you today?",
    "appDescription": "AI-powered chat application",
    "companyName": "My Company",
    "contactEmail": "support@mycompany.com",
    "storagePrefix": "my-app-chat",
    "exportPrefix": "MyApp-chat",
    "logo": "/assets/logo.png"
  }
}

Branding Options Reference

FieldDescriptionExample
appNameMain app name shown in chat header”My AI Assistant”
appTitleBrowser tab title”My Chat App”
appSubtitleWelcome message in chat”How can I help you today?”
companyNameYour company/organization name”My Company”
contactEmailSupport contact emailsupport@mycompany.com
logoLogo image path”/assets/logo.png”

Theme Configuration

Choose from 10+ beautiful themes to match your brand.

Available Themes

Set your default theme in the configuration:
{
  "theme": {
    "defaultTheme": "slate"  // Choose from available themes
  }
}

Theme Options

The boilerplate includes these beautiful themes: Available themes:
  • Slate
  • Gray
  • Zinc
  • Neutral
  • Stone
  • Red
  • Orange
  • Amber
  • Yellow
  • Lime
  • Green
  • Emerald
  • Teal
  • Cyan
  • Sky
  • Blue
  • Indigo
  • Violet
  • Purple
  • Fuchsia
  • Pink
  • Rose

Live Theme Preview

Test themes instantly using the interactive setup:
Visit http://localhost:3000/landing → Step 3: Theme Selection to see live previews.

Font Configuration

Configure typography with 30+ Google Fonts and system fonts.

Font Types

Configure three main font categories:
{
  "fonts": {
    "primary": "Inter",           // Main UI text font
    "heading": "Playfair Display", // Titles and headings
    "mono": "JetBrains Mono"      // Code blocks and technical text
  }
}
  • Primary: Inter
  • Heading: Space Grotesk
  • Mono: JetBrains Mono
  • Primary: Lora
  • Heading: Playfair Display
  • Mono: Fira Code
  • Primary: Inter
  • Heading: Poppins
  • Mono: JetBrains Mono

Live Font Preview

Test fonts with real-time updates:
Visit http://localhost:3000/landing → Step 4: Typography to see live font previews.

Configuration via Console

Alternative method using Moorcheh Console Playground:
1

Visit Console

2

Navigate to Appearance

Go to the Appearance section
3

Configure Settings

Set up your branding, themes, and fonts
4

Download Configuration

Click “Download” to export the complete configuration
5

Save File

Save the JSON file as config/appearance.json
The console playground provides the same configuration options as the interactive setup, with the added benefit of being able to download the complete configuration file.

Configuration Validation

Ensure your configuration is valid and working:

Check Configuration

Visit http://localhost:3000/demo to test your themes and fonts.

Test Chat Interface

Your main chat interface at http://localhost:3000 will reflect your configuration.

Troubleshooting

Common Configuration Issues

  • Check file paths and JSON syntax
  • Ensure files are in the correct directories
  • Restart the development server
  • Verify theme name spelling
  • Check that theme files exist
  • Clear browser cache
  • Ensure font names are correct
  • Check Google Fonts availability
  • Verify font configuration syntax

Debug Steps

  1. Check browser console for errors
  2. Verify configuration files are properly formatted
  3. Test with default configuration first
  4. Use the interactive setup to validate settings
  5. Check that all required fields are present

Next Steps

Now that you’ve configured your application: