bailian-usage-proxy
阿里百炼大模型平台的多人共享账号用量统计代理服务。用于解决公司共用阿里百炼账号时无法区分个人用量的问题。当用户需要:1) 部署阿里百炼用量统计代理,2) 统计多人Token用量和调用次数,3) 管理大模型API调用配额时激活此技能。
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bjmfjoy/bailian-usage-proxyWhat This Skill Does
The bailian-usage-proxy is a critical utility for enterprise teams utilizing the Alibaba Bailian (DashScope) large language model platform. It acts as an intermediary layer between individual users and the centralized enterprise API key. By deploying this proxy, organizations can effectively monitor, attribute, and restrict AI usage at a granular level. The service intercepts OpenAI-compatible API requests, logs token consumption and call counts per user or department, enforces daily quota limits to prevent budget overruns, and provides a centralized management dashboard for cost analysis and reporting. It transforms a shared, anonymous API account into a controlled, multi-user resource.
Installation
To install this skill, run the following command in your terminal: clawhub install openclaw/skills/skills/bjmfjoy/bailian-usage-proxy.
After installation, follow these steps to configure your environment:
- Prepare the environment by cloning the source and installing dependencies via
pip install -r requirements.txt. - Configure your
.envfile by inputting your primary Alibaba Bailian API key and database connection strings. - Initialize the persistence layer by executing
python scripts/init_db.py. - Start the proxy server using the provided
docker-compose up -dfor production orpython -m app.mainfor local development. - Provision individual access tokens for your team using
python scripts/create_user.pyto ensure every user has a unique identifier for tracking.
Use Cases
- Enterprise Cost Attribution: Distribute API costs accurately across different departments (e.g., Engineering, Marketing, Product) based on verified usage logs.
- Budget Control: Prevent "runaway" token usage by setting strict daily or weekly quotas for individual developers or test environments.
- Regulatory Compliance: Maintain an audit trail of who accessed which LLM model and at what time, which is essential for sensitive enterprise deployments.
- Development Workflow Integration: Seamlessly integrate the proxy into existing CI/CD pipelines or local development environments by simply updating the
base_urlto the proxy's endpoint.
Example Prompts
- "OpenClaw, can you check the usage statistics for the 'Algorithms' department for the last 7 days using the bailian-usage-proxy?"
- "Please generate a report of the top 5 users by token consumption for the current month and export it to a CSV file."
- "Set a new daily limit of 500,000 tokens for user 'Zhang San' to ensure we stay within our project budget."
Tips & Limitations
- Performance: While the proxy adds a negligible latency overhead, ensure the server hosting the proxy has sufficient network bandwidth to handle concurrent requests.
- Persistence: Regularly back up your database, as all historical usage data and user configurations are stored there.
- Security: Treat the proxy's server as a sensitive internal asset. Ensure the management interface is protected behind a firewall or VPN, as it contains sensitive API usage data and administrative controls.
- Compatibility: This skill only intercepts and proxies API requests that follow the standard OpenAI/DashScope compatible format.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bjmfjoy-bailian-usage-proxy": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, file-write, file-read, external-api
Related Skills
contract_auditor
合同审计 Skill - AI 辅助审查合同条款,识别风险和问题 功能: - 自动提取合同文本(Word 格式) - 审查金额条款(一致性、付款节点、违约金) - 审查交付条款(时间、标准、延期责任) - 审查合规性(签章、日期、关键条款) - 风险提示(不利条款、模糊表述) - 生成审计报告 + 批注文档
chat_logger
对话记录 - 自动记录飞书/钉钉消息(严格触发规则版) ⚠️ 严格触发规则: - 消息 "chatlog汇总" → 只能执行此 Skill,禁止主 Agent 处理 - 消息 "今日简报" → 只能执行此 Skill,禁止主 Agent 处理 - 消息 "我的记录" → 只能执行此 Skill,禁止主 Agent 处理 设计原则: - 精确匹配触发,不经过主 Agent 判断 - 提供清晰的 API 供主 Agent 使用 - 自检功能确保记录正常