Client setup

AstrBot Chatbot Setup Guide

Connect AstrBot (Telegram, Discord, Slack, Lark, QQ) to ZhenAPI via OpenAI-compatible or Anthropic endpoints with per-key spending caps.

AstrBot is a popular open-source multi-platform chatbot and agent framework supporting Telegram, Discord, Slack, Feishu/Lark, WeCom and QQ with built-in RAG knowledge bases and plugins. Connecting AstrBot to ZhenAPI lets you mix ultra-low-cost chat models with flagship reasoning models under per-key spending limits.

Group & Quota Tip: Choose general/external channel groups such as Codex Lite (up to 93% off), Claude Plus (86% off), DeepSeek Direct, or Zhipu GLM — never "CC Only" or "Codex Only" groups. Set a spending cap on your bot's key in API Keys to prevent runaway group-chat usage.

1. Add ZhenAPI in AstrBot WebUI

  1. Open the AstrBot Web dashboard (default port 6185) and navigate to Model Providers → + Add Provider.
  2. Configure either the OpenAI-compatible provider or native Anthropic provider:

Option A: OpenAI-Compatible Provider (GPT, DeepSeek, GLM, Kimi)

  • Provider Type: OpenAI
  • API Base URL (include /v1):
OpenAI API Base URL
1https://api.zhenapi.ai/v1
  • API Key: Paste your sk-... key from the matching ZhenAPI group
  • Model: e.g. deepseek-flash, glm-5.4, kimi-k3.1-pro, or gpt-6.2-sol (copy exact IDs from Model Pricing)

Option B: Native Anthropic Provider (Claude)

  • Provider Type: Anthropic
  • API Base URL (without /v1):
Anthropic Base URL
1https://api.zhenapi.ai
  • API Key: Paste your "Claude Plus" or "Claude Max (Universal External)" key
  • Model: claude-sonnet-5-5 or claude-opus-5-5

2. Troubleshooting

SymptomCauseFix
403 cyber_policy or misreported "Invalid API Key"A custom bot persona/system prompt triggered upstream content-safety rules (your key itself is valid).Switch to the default persona, run /reset to clear chat history, and remove jailbreak wording from system prompts.
403 client restriction errorKey belongs to a "CC Only" or "Codex Only" group.Reassign the key to "Claude Plus", "Codex Lite", or an External group on API Keys.