Skip to content

Channel Configuration API

Configure API channels for AI model access.

Channel Structure

yaml
channels:
  - name: openai-main        # Unique name
    baseUrl: https://api.openai.com/v1
    apiKey: ${OPENAI_API_KEY}
    model: gpt-4o
    priority: 1              # Lower = higher priority
    enabled: true

Required Fields

FieldTypeDescription
namestringUnique channel identifier
baseUrlstringAPI endpoint URL
apiKeystringAPI key (supports env vars)
modelstringDefault model name

Optional Fields

FieldTypeDefaultDescription
prioritynumber1Channel priority
enabledbooleantrueEnable/disable
maxTokensnumber4096Max output tokens
temperaturenumber0.7Response creativity
timeoutnumber60000Request timeout (ms)

Built-in Free Channels

Free Channel Notice

The plugin may come with pre-configured free/demo channels (e.g. free Gemini, GLM). These are provided by third-party relay services:

  • No availability guarantee: Free channels may stop, throttle, or change at any time
  • No stability guarantee: Response speed and quality may be unstable
  • For trial use only: Configure your own API Key for stable service
  • Security note: Data may pass through third parties; do not send sensitive information

Supported Providers

International

ProviderbaseUrlFeatures
OpenAIhttps://api.openai.com/v1Chat, vision, tools, embedding, audio
Anthropic Claudehttps://api.anthropic.comChat, vision, tools, thinking
Google Geminihttps://generativelanguage.googleapis.comChat, vision, tools, grounding
xAI Grokhttps://api.x.ai/v1Chat, tools
Mistral AIhttps://api.mistral.ai/v1Chat, embedding, tools
Groqhttps://api.groq.com/openai/v1Chat, tools (ultra-fast)

Chinese Providers

ProviderbaseUrlFeatures
DeepSeekhttps://api.deepseek.com/v1Chat, tools, reasoning
Zhipu AIhttps://open.bigmodel.cn/api/paas/v4Chat, vision, tools, embedding
Qwenhttps://dashscope.aliyuncs.com/compatible-mode/v1Chat, vision, tools, embedding
Moonshot Kimihttps://api.moonshot.cn/v1Chat, tools, file

Relay/Aggregation

ProviderbaseUrlDescription
OpenRouterhttps://openrouter.ai/api/v1Multi-model aggregation
SiliconFlowhttps://api.siliconflow.cn/v1Chinese aggregation platform
Together AIhttps://api.together.xyz/v1Open-source model hosting

Compatibility

Most OpenAI-compatible APIs can be connected using the openai type — just change baseUrl and apiKey.

Provider Examples

yaml
- name: openai
  baseUrl: https://api.openai.com/v1
  apiKey: ${OPENAI_API_KEY}
  model: gpt-4o
yaml
- name: claude
  baseUrl: https://api.anthropic.com
  apiKey: ${ANTHROPIC_API_KEY}
  model: claude-sonnet-4-20250514
  provider: claude
yaml
- name: deepseek
  baseUrl: https://api.deepseek.com/v1
  apiKey: ${DEEPSEEK_API_KEY}
  model: deepseek-chat
yaml
- name: gemini
  baseUrl: https://generativelanguage.googleapis.com
  apiKey: ${GOOGLE_API_KEY}
  model: gemini-2.5-flash
  provider: gemini

Load Balancing

yaml
channelStrategy:
  mode: priority      # priority, round-robin, random
  failover: true      # Auto switch on failure
  maxRetries: 3       # Retry attempts
  retryDelay: 1000    # Delay between retries (ms)

Environment Variables

Security

Use environment variables for API keys:

yaml
apiKey: ${OPENAI_API_KEY}

Set in system or .env file:

bash
export OPENAI_API_KEY=sk-xxx
export ANTHROPIC_API_KEY=sk-ant-xxx

Testing Channels

Via Web Panel

  1. Go to Channels tab
  2. Click Test Connection

Via Command

txt
#ai测试渠道 openai

Next Steps

Released under the MIT License