

1.登录chatgpt(烂机场英国节点都行没必要家宽)
2.F12 控制台粘贴长链接
3.使用控制台显示的长链接直接支付即可(账单地址可填美国)
(async function generateTeamHostedLink() {
console.log("⏳ [team-link] 正在获取 Session Token...");
// ── 1. 获取当前登录的 Access Token ──────────────────────────────────────
let accessToken;
try {
const session = await fetch("/api/auth/session").then((r) => r.json());
accessToken = session?.accessToken;
if (!accessToken) throw new Error("accessToken 为空");
} catch (e) {
console.error("❌ [team-link] 获取 Token 失败,请确保已登录 ChatGPT:", e.message);
return;
}
console.log("✅ [team-link] Token 获取成功");
// ── 2. 构造请求 Payload ──────────────────────────────────────────────────
const payload = {
plan_name: "chatgptteamplan",
team_plan_data: {
workspace_name: "MyTeam", // ← 你可以改成自己想要的工作区名字
price_interval: "month", // month 或 year
seat_quantity: 2, // ← 至少填 2,推荐 2~5
},
billing_details: {
country: "GB", // 🇬🇧 必须为 GB (英国) 才能匹配 geccogb 优惠码
currency: "GBP", // 💷 改为 GBP (英镑)
},
cancel_url: "https://chatgpt.com/#team-pricing",
// 🔥 关键:使用 promo_code
promo_code: "geccogb",
checkout_ui_mode: "hosted",
};
// ── 3. 发送请求 ──────────────────────────────────────────────────────────
console.log("⏳ [team-link] 正在请求 Stripe 长链接...");
let data;
try {
const response = await fetch(
"https://chatgpt.com/backend-api/payments/checkout",
{
method: "POST",
headers: {
Authorization: Bearer ${accessToken},
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
}
);
data = await response.json();
if (!response.ok) {
console.error("❌ [team-link] 请求失败,HTTP", response.status);
console.error(data);
return;
}
} catch (e) {
console.error("❌ [team-link] 网络请求异常:", e.message);
return;
}
// ── 4. 输出结果 ──────────────────────────────────────────────────────────
const hostedUrl = data?.url || data?.stripe_hosted_url || data?.checkout_url;
if (!hostedUrl) {
console.warn("⚠️ [team-link] 未找到长链接,原始响应如下:");
console.log(data);
return;
}
console.log("─".repeat(60));
console.log("✅ [team-link] 生成成功!geccogb promo 已生效 (英国/英镑)");
console.log("");
console.log("📋 Checkout Session ID :", data.checkout_session_id);
console.log("🏢 Plan : ChatGPT Team");
console.log("👥 Seats :", payload.team_plan_data.seat_quantity);
console.log("");
console.log("🔗 Stripe 长链接(直接打开即可支付):");
console.log(hostedUrl);
console.log("─".repeat(60));
console.log("💡 提示:打开链接后检查价格是否已显示为 11 英镑");
})();