Virtual card issuance and management for AI agents to make real-world purchases
为AI代理发行虚拟卡,实现真实世界购买,具备自动消费控制、欺诈检测和即时冻结功能。
始终强制执行:
bash
export SARDISAPIKEY=skyourkey_here
基础URL:https://api.sardis.sh/v2
bash
bash
bash
bash
bash
bash
bash
bash
bash
bash
CARD=$(curl -s -X POST https://api.sardis.sh/v2/cards \
-H Authorization: Bearer $SARDISAPIKEY \
-H Content-Type: application/json \
-d {
agentid: $AGENTID,
name: 采购代理卡,
spending_limit: {
per_transaction: 50.00,
daily: 200.00,
monthly: 1000.00
},
merchant_controls: {
allowedcategories: [officesupplies, software],
allowed_merchants: [amazon.com, staples.com]
},
expiresinmonths: 6
})
CARD_ID=$(echo $CARD | jq -r .id)
echo 卡片已创建:$CARD_ID
echo 后4位数字:$(echo $CARD | jq -r .last_four)
bash
CARDINFO=$(curl -s -X GET https://api.sardis.sh/v2/cards/$CARDID \
-H Authorization: Bearer $SARDISAPIKEY)
DAILYSPENT=$(echo $CARDINFO | jq -r .current_spend.daily)
DAILYLIMIT=$(echo $CARDINFO | jq -r .spending_limit.daily)
echo 每日消费:$DAILYSPENT / $DAILYLIMIT
bash
if [ $TX_COUNT -gt 3 ]; then
echo 警报:检测到多次快速交易
# 立即冻结卡片
curl -X POST https://api.sardis.sh/v2/cards/$CARD_ID/freeze \
-H Authorization: Bearer $SARDISAPIKEY \
-H Content-Type: application/json \
-d {
reason: 异常:多次快速交易
}
echo 卡片已冻结,等待审查
fi
bash
echo === 卡片仪表盘 ===
curl -s -X GET https://api.sardis.sh/v2/agents/$AGENT_ID/cards \
-H Authorization: Bearer $SARDISAPIKEY | \
jq -r .cards[] | 卡片 \(.lastfour):\(.status) - 每日:$\(.currentspend.daily)/$\(.spending_limit.daily)
bash
echo 正在冻结代理 $AGENT_ID 的所有卡片...
curl -s -X GET https://api.sardis.sh/v2/agents/$AGENT_ID/cards \
-H Authorization: Bearer $SARDISAPIKEY | \
j
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 sardis-cards-1776189885 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 sardis-cards-1776189885 技能
skillhub install sardis-cards-1776189885
文件大小: 4.38 KB | 发布时间: 2026-4-15 10:33