How to Build a Paid AI Zodiac Chatbot with Alibaba Cloud and Alipay MCP
Learn step‑by‑step how to create an AI‑driven zodiac horoscope chatbot on Alibaba Cloud Baileian, configure the Alipay MCP payment service, set up secure KMS credentials, and achieve a complete commercial pay‑to‑use loop from user query to transaction confirmation.
Solution Overview
Large language models can converse well but cannot directly generate revenue. This guide shows how to build a paid AI zodiac‑horoscope assistant using Alibaba Cloud Baileian large‑model service and integrate Alipay MCP to complete the “create order → query order → confirm payment → refund” commercial loop.
Step 1: Create the AI Agent Application
Log in to the Baileian console, enable model service, and create a new application (first‑time users can claim free quota). Choose the “Tongyi Qianwen‑Plus” model, set “Maximum response length” to 16384 and “Context rounds” to 10.
Step 2: Define Prompt and Skills
## 角色
你是「星付宝」,一个毒舌又暖心的星座运势付费智能体。你以90%段子手+10%玄学家的口吻,在收到用户的打赏后,结合本月网络热梗生成星座运势,拒绝枯燥说教。
## 技能
### 技能 1: 星座识别
- 若用户输入含日期,则直接通过日期匹配星座。
- 若含星座关键词,则直接识别。
- 若既没有日期及星座关键词,则反问:"这位施主,您的星座是?(双手合十.jpg)"。
### 技能 2: 今日运势生成
- **评分**:1-5★随机但符合星座当日特性(水逆必低分)。
- **热点融合**:糅合3个当日微博/抖音热搜梗。
- **毒舌预警**:对土象星座加大吐槽力度,对水象星座温柔治愈。
### 技能 3: 输出模板
**【星座】{星座名} · {今日日期}**
运势指数:{X个★}
-----------------------------------------
**今日批命**(热梗版):
- {2-3句幽默分析,含1个翻车预警 + 1个网络热梗}
- {1句扎心建议}
-----------------------------------------
幸运Buff:
- 颜色:{颜色}
- 数字:{数字}
-----------------------------------------
宜忌指南:
- 宜:{2件离谱但合理的事}
- 忌:{2件作死行为}
### 技能 4: 支付规则
1. 当用户请求今日运势时,调用 Alipay MCP “create-web-page-alipay-payment”生成二维码链接,创建金额为0.01元的订单。
2. 用户回复“已付款”或类似信息时,调用 “query-alipay-payment”。若订单未支付,返回提示并重复二维码;若已支付,显示收款成功并继续生成运势。
3. 用户请求退款时,调用 “refund-alipay-payment”。Step 3: Configure Alipay MCP
In the Baileian console, enable the Alipay MCP service (or the trial version). For the trial version, payments go to a test account and cannot be withdrawn; use 0.01 CNY as the test amount.
Step 4: Set Up Secure KMS Credentials
Create a KMS secret in Alibaba Cloud, name it with the prefix bailian! (e.g., bailian!alipay_mcp_secret), store the Alipay app key and secret, and grant the Baileian service permission to read the secret.
Step 5: Bind Credentials and Activate Service
In the Alipay MCP page, select the previously created KMS secret, confirm the configuration, and click “Activate”. The system will deploy and complete authentication.
Step 6: Test the Paid Agent
Send a sample query such as “请帮我分析今日射手座的运势”. The agent replies with a payment QR code.
Click the QR code to pay 0.01 CNY, then resend the query. The agent now returns the horoscope.
Send “我已支付” to trigger the refund flow and verify the refund response.
Result
After completing the steps, you have a fully functional AI assistant that can accept payments, deliver paid content, and process refunds, demonstrating a complete commercial pay‑to‑use loop.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Alibaba Cloud Developer
Alibaba's official tech channel, featuring all of its technology innovations.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
