Integration Guide

Prerequisites

Before you begin, make sure:

  1. ChatBox is installed

    Download and install the version for your OS from ChatBox GitHub, or visit the ChatBox website.

  2. You have a MaiToken API key

    Sign in to the MaiToken Console to get your API key (it starts with sk-).

Tip: If you don't have a MaiToken account yet, sign up at MaiToken first and get your API key.

Step 1: Launch ChatBox and Start Configuring

When launching ChatBox for the first time or adding a new AI provider:

  1. Launch the ChatBox app
  2. On first use, the configuration wizard opens automatically
  3. Click the "Use your own API Key or local model" button
  4. If you've configured it before, click the ⚙️ Settings icon at the bottom left, or use the shortcut Ctrl+, (Windows/Linux) / Cmd+, (macOS)

ChatBox launch configuration wizard

Step 2: Configure the MaiToken API

2.1 Choose an AI Model Provider

On the settings page:

  1. Find the AI Model Provider or AI Provider setting
  2. From the dropdown, choose OpenAI API (for GPT-series models), Claude API (for Claude-series models), or Gemini API (for Gemini-series models)

ChatBox settings page

2.2 Configure the API Details

After selecting OpenAI API, fill in the following:

Setting Value
API Key Your MaiToken API key (sk-xxxxxxxxxxxx)
API Host or API Domain https://api.maitoken.com

API configuration

After selecting Claude API, fill in the following:

Setting Value
API Key Your MaiToken API key (sk-xxxxxxxxxxxx)
API Host or API Domain https://api.maitoken.com/v1

Claude model

After selecting Gemini API, fill in the following:

Setting Value
API Key Your MaiToken API key (sk-xxxxxxxxxxxx)
API Host or API Domain https://api.maitoken.com/

Gemini

Important:

  • For the OpenAI API, set the API Host to https://api.maitoken.com (without the /v1 suffix)
  • For the Claude API, set the API Host to https://api.maitoken.com/v1 (with the /v1 suffix)
  • For the Gemini API, set the API Host to https://api.maitoken.com/ (without the /v1 suffix)
  • The API Key must be a sk--prefixed key obtained from the MaiToken Console
  • Make sure your API key has sufficient balance

2.3 Choose a Model

Once configured, select the model you want in the Model dropdown:

Recommended models:

Model Name Model ID Highlights
GPT-5 gpt-5 The latest, most powerful model
GPT-4o gpt-4o or chatgpt-4o-latest High-quality conversation
GPT-4o Mini gpt-4o-mini Fast and economical
Claude Sonnet 4.5 claude-sonnet-4-5-20250929 Strong at code and reasoning
Claude Haiku 4.5 claude-haiku-4-5-20251001 Fast responses
Gemini 2.0 Flash gemini-2.0-flash-exp Multimodal support

Special note for using Claude models: If you choose a Claude model (such as claude-sonnet-4-5-20250929 or claude-haiku-4-5-20251001), you need the following additional configuration:

  1. Switch to the Claude API provider:
    • In settings, change the AI Model Provider to Claude API
    • Keep the API Host as https://api.maitoken.com/v1
    • Use your MaiToken API key (sk-xxxxxxxxxxxx) as the API Key
  2. Or add a custom request header (if using the OpenAI API provider):
    • Some versions of ChatBox support adding custom headers
    • In advanced settings, add the header: anthropic-version: 2023-06-01

Recommended approach: Use OpenAI API for GPT-series models, Claude API for Claude-series models, and Gemini API for Gemini-series models.

Performance suggestions:

  • 💰 Best value: gpt-4o-mini, claude-haiku-4-5-20251001
  • 🚀 High performance: gpt-5, gpt-4o, claude-sonnet-4-5-20250929
  • ⚡ Fast responses: gemini-2.0-flash-exp, gpt-4o-mini

Step 3: Start Using It

Once configured, you can start chatting with the AI in ChatBox:

  1. Return to the main screen
  2. Type your question or request in the input box
  3. Press Enter or click the send button
  4. The AI generates a reply using MaiToken's models

Chat interface

Adjust Model Parameters (optional)

You can adjust the following parameters as needed:

Parameter Description Recommended value
Temperature Controls output randomness 0.7 (creative) / 0.3 (precise)
Max Tokens Maximum output length 2000-4000
Top P Nucleus sampling parameter 0.9

Advanced Features

Multi-Session Management

ChatBox supports creating multiple conversation sessions:

  1. Click the New conversation button
  2. Create separate sessions for different tasks
  3. Switch between conversations in the session list on the left

Save and Export Conversations

  1. Right-click a conversation session
  2. Choose the Export option
  3. Export as Markdown, JSON, and other formats

Use Prompt Templates

  1. Find the Prompts setting in the settings
  2. Save frequently used prompt templates
  3. Quickly invoke preset prompts in a conversation

FAQ

Q1: Can't connect to the MaiToken service?

Solution:

  1. Check the API Host:
    • Make sure it is https://api.maitoken.com
    • Don't add /v1 or any other path
  2. Verify the API Key:
    • Confirm the API Key is correct and starts with sk-
    • Check whether the key is valid in the MaiToken Console
  3. Check your network connection:
    • Make sure you can reach https://api.maitoken.com
    • If you're in mainland China, you may need to configure a proxy

Q2: MaiToken's models don't show up in the model list?

Solution:

  1. Enter the model name manually:
    • Type the model ID directly in the model input box
    • For example: gpt-4o, gpt-4o-mini, claude-sonnet-4-5-20250929
  2. Refresh the model list:
    • Restart the ChatBox app
    • Reconfigure the API details

Q3: Getting an error during a conversation?

Common errors and solutions:

Error Message Cause Solution
401 Unauthorized API Key invalid or expired Get a new API Key and update the config
429 Too Many Requests Request rate exceeded Wait a moment and retry
500 Internal Server Error Temporary server failure Wait a few minutes and retry
insufficient_quota Insufficient account balance Top up in the Console

Q4: How do I view API usage and cost?

Sign in to the MaiToken Console to view:

  • 📊 API call statistics
  • 💰 Cost breakdown
  • 📈 Usage trend charts
  • 🔍 Detailed request logs

Q5: Which platforms does ChatBox support?

ChatBox supports several platforms:

  • 🪟 Windows - Windows 10/11
  • 🍎 macOS - macOS 10.15+
  • 🐧 Linux - major distributions
  • 🌐 Web - browser version

Tips

1. Keyboard Shortcuts

Make full use of ChatBox's shortcuts to boost your efficiency:

Shortcut Function
Ctrl/Cmd + Enter Send message
Ctrl/Cmd + N New conversation
Ctrl/Cmd + K Search conversations
Ctrl/Cmd + , Open settings
Ctrl/Cmd + / Show shortcut help

2. Optimize Your Prompts

Write better prompts to get better replies:

❌ A poor prompt:

Help me write some code

✅ A good prompt:

Please help me write a Python function that:1. Takes a list of strings as input2. Filters out strings shorter than 3 characters3. Returns the result sorted alphabeticallyPlease include detailed comments and example usage

3. Leverage Conversation History

ChatBox saves your conversation history:

  • The AI remembers the context of the current session
  • You can keep asking based on earlier answers
  • Great for in-depth discussion and iteration

4. Switch Models

Switch to the right model for different tasks:

  • Writing tasks - use gpt-4o or claude-sonnet-4-5
  • Coding tasks - use claude-sonnet-4-5
  • Quick Q&A - use gpt-4o-mini
  • Multimodal - use gemini-2.0-flash-exp

Features

With ChatBox + MaiToken, you can:

  • 💬 Smooth conversation - real-time streaming for a smoother experience
  • 🎯 Multi-session management - manage multiple independent conversations at once
  • 💾 Local storage - conversations are stored locally to protect your privacy
  • 📤 Export conversations - export conversation records in multiple formats
  • 🎨 Clean interface - a clean, attractive UI
  • 🔒 Open source and free - fully open source and free to use
  • 🌍 Cross-platform - supports Windows, macOS, and Linux
  • 🚀 Great performance - a lightweight app that runs smoothly

Support and Help

If you run into any issues while using MaiToken: