Skip to content

Configuration Reference

All xopcbot configuration is centralized in the ~/.xopcbot/config.json file.

Full Configuration Example

json
{
  "agents": {
    "defaults": {
      "workspace": "~/.xopcbot/workspace",
      "model": {
        "primary": "anthropic/claude-sonnet-4-5",
        "fallbacks": ["openai/gpt-4o", "minimax/minimax-m2.1"]
      },
      "max_tokens": 8192,
      "temperature": 0.7,
      "max_tool_iterations": 20
    }
  },
  "providers": {
    "openai": "${OPENAI_API_KEY}",
    "anthropic": "${ANTHROPIC_API_KEY}",
    "deepseek": "${DEEPSEEK_API_KEY}",
    "groq": "${GROQ_API_KEY}",
    "google": "${GOOGLE_API_KEY}",
    "minimax": "${MINIMAX_API_KEY}"
  },
  "channels": {
    "telegram": {
      "enabled": true,
      "token": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
      "allow_from": []
    }
  },
  "gateway": {
    "host": "0.0.0.0",
    "port": 18790
  },
  "tools": {
    "web": {
      "search": {
        "api_key": "",
        "max_results": 5
      }
    }
  },
  "modelsDev": {
    "enabled": true
  }
}

Configuration Options

agents

Default configuration for agents.

FieldTypeDefaultDescription
workspacestring~/.xopcbot/workspaceWorkspace directory
modelstring / objectanthropic/claude-sonnet-4-5Default model
max_tokensnumber8192Maximum output tokens
temperaturenumber0.7Temperature parameter (0-2)
max_tool_iterationsnumber20Maximum tool call iterations

agents.defaults.model

Model configuration supports two formats:

Simple format (single model):

json
{
  "model": "anthropic/claude-sonnet-4-5"
}

Object format (with fallbacks):

json
{
  "model": {
    "primary": "anthropic/claude-sonnet-4-5",
    "fallbacks": ["openai/gpt-4o"]
  }
}

The model ID format is provider/model-id, e.g., anthropic/claude-opus-4-5.

models

model configuration. Use this to configure API providers and available models.

FieldTypeDefaultDescription
providersobject{}Provider API keys (see below)

providers

Configure LLM provider API keys. Keys can be actual values or environment variable references:

json
{
  "providers": {
    "openai": "${OPENAI_API_KEY}",
    "anthropic": "${ANTHROPIC_API_KEY}",
    "deepseek": "sk-...",
    "groq": "${GROQ_API_KEY}"
  }
}

Supported providers and their environment variables:

ProviderEnvironment Variable
openaiOPENAI_API_KEY
anthropicANTHROPIC_API_KEY
googleGOOGLE_API_KEY or GEMINI_API_KEY
groqGROQ_API_KEY
deepseekDEEPSEEK_API_KEY
minimaxMINIMAX_API_KEY
xaiXAI_API_KEY
mistralMISTRAL_API_KEY
cerebrasCEREBRAS_API_KEY
openrouterOPENROUTER_API_KEY
huggingfaceHF_TOKEN or HUGGINGFACE_TOKEN

You can also use environment variables directly without adding them to config. | name | string | (required) | Display name | | reasoning | boolean | false | Supports reasoning/thinking | | input | array | ["text"] | Input types: text, image | | cost | object | | Pricing info | | contextWindow | number | 128000 | Context window size | | maxTokens | number | 16384 | Max output tokens |

Supported Providers

xopcbot supports the following LLM providers:

ProviderAuth TypeCapabilitiesModel Prefixes
openaiAPI Keytext, vision, toolsgpt-, o1-
anthropicAPI Key, OAuthtext, vision, reasoning, toolsclaude-
googleAPI Keytext, vision, toolsgemini-
qwenAPI Keytext, vision, toolsqwen-, qwq-
kimiOAuth (Device Code)text, reasoning, toolskimi-
moonshotAPI Keytext, toolsmoonshot-
minimaxAPI Keytextabab-
deepseekAPI Keytext, reasoning, toolsdeepseek-
groqAPI Keytext, toolsllama-, mixtral-
openrouterAPI Keytext, vision, toolsopenrouter/
xaiAPI Keytext, toolsxai/, grok-
cerebrasAPI Keytextcerebras/
mistralAPI Keytext, toolsmistral-
zhipuAPI Keytextglm-
ollamaNone (local)text, visionllama3, qwen2, etc.
bailianAPI Keytextbailian-

Provider Examples

Kimi (OAuth):

json
{
  "kimi": {
    "auth": {
      "type": "oauth",
      "clientId": "your-client-id",
      "clientSecret": "your-client-secret"
    },
    "models": [
      { "id": "kimi-k2.5", "name": "Kimi K2.5", "reasoning": true }
    ]
  }
}

Moonshot (API Key):

json
{
  "moonshot": {
    "apiKey": "${MOONSHOT_API_KEY}",
    "models": [
      { "id": "moonshot-v1-8k", "name": "Moonshot V1 8K" }
    ]
  }
}

MiniMax:

json
{
  "minimax": {
    "apiKey": "${MINIMAX_API_KEY}",
    "baseUrl": "https://api.minimax.chat/v1",
    "models": [
      { "id": "abab6.5s-chat", "name": "MiniMax ABAB 6.5S" }
    ]
  }
}

Zhipu (智谱):

json
{
  "zhipu": {
    "apiKey": "${ZHIPU_API_KEY}",
    "models": [
      { "id": "glm-4-flash", "name": "GLM-4 Flash" }
    ]
  }
}

xAI (Grok):

json
{
  "xai": {
    "apiKey": "${XAI_API_KEY}",
    "models": [
      { "id": "grok-2-1212", "name": "Grok 2" }
    ]
  }
}

Cerebras:

json
{
  "cerebras": {
    "apiKey": "${CEREBRAS_API_KEY}",
    "models": [
      { "id": "llama-3.3-70b", "name": "Llama 3.3 70B" }
    ]
  }
}

Bailian (百川):

json
{
  "bailian": {
    "apiKey": "${BAILIAN_API_KEY}",
    "models": [
      { "id": "baichuan4", "name": "Baichuan 4" }
    ]
  }
}

channels

Communication channels configuration.

channels.telegram

FieldTypeDefaultDescription
enabledbooleanfalseEnable Telegram bot
tokenstring-Bot token from @BotFather
allow_fromarray[]Allowed user IDs (empty = all)
group_adminsbooleanfalseOnly allow group admins
magicstring-Magic prefix for mentions

channels.discord

FieldTypeDefaultDescription
enabledbooleanfalseEnable Discord bot
tokenstring-Bot token
allow_fromarray[]Allowed guild/channel IDs

channels.slack

FieldTypeDefaultDescription
enabledbooleanfalseEnable Slack bot
tokenstring-Bot token
allow_fromarray[]Allowed channel IDs

channels.signal

FieldTypeDefaultDescription
enabledbooleanfalseEnable Signal bot
phone_numberstring-Signal phone number
device_namestring-Device name
allow_fromarray[]Allowed phone numbers

gateway

HTTP API gateway configuration.

FieldTypeDefaultDescription
hoststring0.0.0.0Bind address
portnumber18790Port number
authobject-Authentication config
corsobject-CORS settings

gateway.auth

FieldTypeDefaultDescription
enabledbooleanfalseEnable auth
usernamestring-Auth username
passwordstring-Auth password
api_keystring-API key auth

gateway.cors

FieldTypeDefaultDescription
enabledbooleanfalseEnable CORS
originsarray[]Allowed origins
credentialsbooleanfalseAllow credentials

tools

Tool configurations.

tools.web

FieldTypeDefaultDescription
searchobject-Web search config
browseobject-Web browsing config
FieldTypeDefaultDescription
providerstringbraveSearch provider: brave, searxng
api_keystring-API key
max_resultsnumber5Max results

tools.web.browse

FieldTypeDefaultDescription
enabledbooleantrueEnable browsing
max_depthnumber2Max link depth
timeoutnumber30000Timeout ms

cron

Scheduled tasks configuration.

FieldTypeDefaultDescription
enabledbooleantrueEnable cron
jobsarray[]List of cron jobs

heartbeat

Periodic health check configuration.

FieldTypeDefaultDescription
enabledbooleantrueEnable heartbeat
intervalnumber300000Interval in ms (5 min)
checksarray-List of checks

modelsDev

Local model development settings.

FieldTypeDefaultDescription
enabledbooleantrueEnable local model cache

stt

Speech-to-Text configuration for voice messages.

FieldTypeDefaultDescription
enabledbooleanfalseEnable STT
providerstringalibabaProvider: alibaba, openai
alibabaobject-Alibaba DashScope config
openaiobject-OpenAI Whisper config
fallbackobject-Fallback configuration

stt.alibaba

FieldTypeDefaultDescription
apiKeystring-DashScope API key
modelstringparaformer-v1Model: paraformer-v1, paraformer-8k-v1, paraformer-mtl-v1

stt.openai

FieldTypeDefaultDescription
apiKeystring-OpenAI API key
modelstringwhisper-1Model: whisper-1

stt.fallback

FieldTypeDefaultDescription
enabledbooleantrueEnable fallback
orderarray["alibaba", "openai"]Provider fallback order

Example:

json
{
  "stt": {
    "enabled": true,
    "provider": "alibaba",
    "alibaba": {
      "apiKey": "${DASHSCOPE_API_KEY}",
      "model": "paraformer-v1"
    },
    "fallback": {
      "enabled": true,
      "order": ["alibaba", "openai"]
    }
  }
}

tts

Text-to-Speech configuration for voice replies.

FieldTypeDefaultDescription
enabledbooleanfalseEnable TTS
providerstringopenaiProvider: openai, alibaba
triggerstringautoTrigger mode: auto, never
openaiobject-OpenAI TTS config
alibabaobject-Alibaba CosyVoice config

tts.openai

FieldTypeDefaultDescription
apiKeystring-OpenAI API key
modelstringtts-1Model: tts-1, tts-1-hd
voicestringalloyVoice: alloy, echo, fable, onyx, nova, shimmer

tts.alibaba

FieldTypeDefaultDescription
apiKeystring-DashScope API key
modelstringcosyvoice-v1Model: cosyvoice-v1
voicestring-Voice ID

Example:

json
{
  "tts": {
    "enabled": true,
    "provider": "openai",
    "trigger": "auto",
    "openai": {
      "apiKey": "${OPENAI_API_KEY}",
      "model": "tts-1",
      "voice": "alloy"
    }
  }
}

Trigger modes:

  • auto: Send voice reply when user sends voice message
  • never: Disable TTS, only send text

Environment Variables

xopcbot supports environment variables for sensitive data:

VariableDescription
ANTHROPIC_API_KEYAnthropic API key
OPENAI_API_KEYOpenAI API key
GOOGLE_API_KEYGoogle AI API key
DASHSCOPE_API_KEYAlibaba DashScope API key (for STT/TTS)
TELEGRAM_BOT_TOKENTelegram bot token

Environment variables take priority over config file values.

Q&A

Q: How to use multiple providers?

Use the models configuration to define multiple providers. The agent automatically selects the appropriate provider based on the model ID:

json
{
  "models": {
    "mode": "merge",
    "providers": {
      "openai": {
        "baseUrl": "https://api.openai.com/v1",
        "apiKey": "${OPENAI_API_KEY}",
        "models": [
          { "id": "gpt-4o", "name": "GPT-4o" }
        ]
      },
      "anthropic": {
        "apiKey": "${ANTHROPIC_API_KEY}",
        "models": [
          { "id": "claude-sonnet-4-5", "name": "Claude Sonnet 4.5", "reasoning": true }
        ]
      }
    }
  }
}

Set different models in agents.defaults.model to use different providers.

Q: How to use Ollama?

json
{
  "models": {
    "providers": {
      "ollama": {
        "baseUrl": "http://127.0.0.1:11434/v1",
        "enabled": true,
        "autoDiscovery": true,
        "models": [
          { "id": "llama3", "name": "Llama 3" }
        ]
      }
    }
  }
}

Q: How to configure OAuth?

xopcbot supports OAuth authentication for certain providers:

Kimi (Device Code Flow - Recommended):

json
{
  "models": {
    "providers": {
      "kimi": {
        "auth": {
          "type": "oauth",
          "clientId": "17e5f671-d194-4dfb-9706-5516cb48c098"
        },
        "models": [
          { "id": "kimi-k2.5", "name": "Kimi K2.5", "reasoning": true }
        ]
      }
    }
  }
}

Kimi uses Device Code Flow - the CLI will prompt you to visit auth.kimi.com and enter a code to complete authentication.

Other OAuth Providers:

json
{
  "models": {
    "providers": {
      "anthropic": {
        "baseUrl": "https://api.anthropic.com",
        "auth": {
          "type": "oauth",
          "clientId": "...",
          "clientSecret": "..."
        },
        "models": []
      }
    }
  }
}

Note: Qwen OAuth was removed in favor of browser-based login (run qwen CLI).

Q: What is modelsDev?

When enabled, xopcbot automatically loads model information from the built-in local cache, which includes models from providers like OpenAI, Anthropic, Google, Groq, DeepSeek, and more. This provides faster model listing without requiring network requests at runtime.

Released under the MIT License.