Bailian Usage Proxy for Openclaw

A sophisticated proxy service designed to track, manage, and report individual token usage for teams sharing a single Alibaba Bailian account.

bjmfjoy
v1.0.0
Mar 24, 2026
0
752
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install bailian-usage-proxy

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install bailian-usage-proxy using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Bailian Usage Proxy?

The Bailian Usage Proxy is an essential utility for organizations utilizing Alibaba Cloud's large language model platform. In many corporate environments, multiple team members or departments share a single master account, making it nearly impossible to attribute costs or monitor individual resource consumption. This skill bridges that gap by acting as a transparent intermediary.

By providing an OpenAI-compatible interface, it allows developers to swap their endpoint URLs and internal keys easily. The service then captures real-time usage metrics, enforces daily quotas, and provides a centralized management dashboard. This ensures that Openclaw Skills integrations remain cost-effective and transparent across the entire enterprise.

Bailian Usage Proxy Use Cases

  • Managing shared corporate Alibaba Bailian accounts where individual employee usage tracking is required.
  • Allocating LLM API costs across different projects or departments for internal billing.
  • Preventing budget overruns by implementing strict daily token quotas and rate limiting for specific users.

How Bailian Usage Proxy Works

  1. The user sends a request to the proxy server instead of the direct Alibaba Bailian endpoint using an internal key.
  2. The proxy validates the internal key and checks if the user has exceeded their assigned daily quota.
  3. If valid, the proxy forwards the request to the Alibaba Bailian API using the master account credentials.
  4. The proxy receives the stream or response from the model, parses the usage metadata (tokens, model name), and logs it to the database.
  5. Real-time usage data is then updated on the management dashboard for administrators to monitor.

Bailian Usage Proxy Setup

1. Environment Preparation

# Clone the repository and enter the directory
cd bailian-proxy

# Install required dependencies
pip install -r requirements.txt

# Configure environment variables
cp .env.example .env
# Edit .env to include your Alibaba Bailian Master Key and DB settings

2. Database Initialization

python scripts/init_db.py

3. Service Deployment

# For development
python -m app.main

# For production use
docker-compose up -d

4. User Creation

python scripts/create_user.py --name "John Doe" --department "AI-Research" --daily-limit 1000000

Bailian Usage Proxy Data Schema & Taxonomy

The system organizes data to ensure high-performance tracking and clear reporting. Below is the primary metadata taxonomy:

Table Description Key Fields
Users Stores internal identity and access keys user_key, name, department, daily_limit
Usage Logs Records every API interaction timestamp, user_id, model_name, tokens_used
Quotas Tracks daily consumption resets user_id, current_day_total, last_reset

Bailian Usage Proxy Advanced Features

  • OpenAI Protocol Compatibility: Seamlessly integrates with any client library that supports the OpenAI API format.
  • Real-time Dashboard: Access a web-based UI at port 8081 featuring usage leaderboards and model distribution charts.
  • Exportable Reports: Generate CSV reports for financial audits and project-based cost allocation.
  • Docker Support: Ready for containerized deployment in professional Openclaw Skills environments.
  • Flexible Rate Limiting: Configure granular controls beyond just token counts, including request-per-minute (RPM) limits.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*