Vercel Connect 新增托管的 Stripe API 密钥
Vercel Connect 现在可以为每个智能体或任务创建独立的受限 Stripe API 密钥。创建 Stripe 连接器时,可以选择「Managed API Key」(托管 API 密钥)作为连接方式。
Vercel 会在你的 Stripe 账户中创建密钥,权限限于你所选的范围内。现有的 MCP 和自带 API 密钥两种方式保持不变。


大多数应用和智能体使用的是 Stripe 默认密钥,拥有账户的完全访问权限。改用按智能体分配的密钥后,每个智能体只能拿到完成自身工作所需的权限。例如,每日营收报告智能体可以限制为对 charges 的只读访问,用户引导智能体可以限制为对 customers 的写权限。
密钥由 Vercel 创建和存储,无需手动粘贴。你可以在连接器设置中轮换密钥,无需重新部署;切换期间旧密钥最多保持 24 小时有效。
添加 Stripe 连接器
在连接器目录中创建 Stripe 连接器,选择 Managed API Key,挑选权限,然后附加到项目。也可以从 CLI 开始,CLI 会打开浏览器完成设置:
1vercel connect create stripe --connection-method managed-api-key --name acme-stripe2vercel connect attach stripe/acme-stripe --project my-app --environment production
使用 Vercel CLI 添加 Stripe 连接器
1import Stripe from 'stripe';2import { getToken } from '@vercel/connect';3const key = await getToken('stripe/acme-stripe', {4 subject: { type: 'app' },5});6const stripe = new Stripe(key);7const customers = await stripe.customers.list({ limit: 10 });
运行时调用 getToken 并传入连接器的 UID,即可获取受限密钥
要开始使用,请添加 Stripe 连接器或阅读文档。