/iblai-vibe:iblai-vibe-billingfrom ibl.ai vibe
Adds an organization-wide billing settings surface to a Next.js app with Credits (plan picker, add-credits, auto-recharge), workspace Spend Limit, Agent Limits table, and User Limits with default for new members.
Ships in ibl.ai vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Add the organization-wide Billing surface -- "Manage your billing and
subscription" for the whole workspace, in four tabs: Credits (the
current plan with Upgrade — the plan picker — or Change Plan,
the credit balance with its USD equivalent, Add Credits, and Auto
Recharge with threshold / recharge amount / spending limit), Spend Limits (the single
workspace-wide LLM spend limit covering everything all agents and
users spend), Agent Limits (every agent spend cap in the
workspace in one searchable table — each row opens the same per-agent
Billing editor documented in /iblai-vibe-agent-billing), and User
Limits (a spend limit per user covering everything they spend across
all agents, plus the Default for New Users each member who joins
later gets).
This is the org-wide counterpart of the per-agent Billing tab:
per-agent and per-user limits live in each agent's settings
(/iblai-vibe-agent-billing); this surface holds the plan/credits
management, the workspace-wide cap, and the cross-agent overview.








Common setup (brand, conventions, env files, verification): see docs/skill-setup.md.
Two sibling surfaces overlap with this one — check before mounting:
/iblai-vibe-account — the <Account> settings page already
hosts this exact component as its Billing tab (shown when
billingURL or topUpURL is set). If your app uses the Account
page, you likely don't need a standalone mount — deep-link with
targetTab: "billing" instead./iblai-vibe-credit — the compact <CreditBalance> navbar
widget (plan badge, credits, add-credits/upgrade dropdown). It is a
top-nav companion to this page, not a replacement./iblai-vibe-auth)@iblai/mcp in .mcp.json)@iblai/iblai-js@^3.6.0: the User Limits tab is not in releases
before 2.62.3; the plan picker and Change Plan not before 2.73.0subscription, topBanner and appleRestriction
slices and the app mounts SubscriptionConfigProvider
(/iblai-vibe-credit-exhaustion Step 1; vibe-starter ships both)Before proceeding, check for an iblai.env in the project root. Look for
PLATFORM, DOMAIN, and TOKEN variables. If the file does not exist or
is missing these variables, tell the user:
"You need an iblai.env with your platform configuration. Download the
template and fill in your values:
curl -o iblai.env https://raw.githubusercontent.com/iblai/vibe/refs/heads/main/iblai.env"
BillingTabBillingTab imports from @iblai/iblai-js/web-containers (the base
bundle, not /next). It takes the org key plus the acting user's
identity — the agent search and the Stripe flows need them.
// app/(app)/settings/billing/page.tsx
"use client";
import { useEffect, useState } from "react";
import { BillingTab } from "@iblai/iblai-js/web-containers";
import { useSubscriptionConfig } from "@iblai/iblai-js/web-utils";
export default function BillingPage() {
// The platform's main organization (`main` unless the provider says
// otherwise): where free-trial users live and the only one that lists and
// changes plans. Never this app's organization.
const { mainTenantKey: platformMainOrg } = useSubscriptionConfig();
const [tenant, setTenant] = useState("");
const [username, setUsername] = useState("");
const [email, setEmail] = useState("");
useEffect(() => {
try {
const raw = localStorage.getItem("userData");
if (raw) {
const parsed = JSON.parse(raw);
setUsername(parsed.user_nicename ?? parsed.username ?? "");
setEmail(parsed.user_email ?? "");
}
setTenant(
localStorage.getItem("app_tenant") ??
localStorage.getItem("tenant") ??
"",
);
} catch {}
}, []);
if (!tenant || !username) return null;
return (
<div className="flex h-full flex-col bg-white p-6">
<BillingTab
tenant={tenant}
username={username}
currentUserEmail={email}
mainPlatformKey={platformMainOrg}
/>
</div>
);
}
get_component_info("BillingTab")
get_component_info("AgentSpendCapsTab")
<BillingTab> PropsImport from @iblai/iblai-js/web-containers.
| Prop | Type | Required | Description |
|---|---|---|---|
tenant | string | Yes | Org key this Billing page manages |
username | string | Yes | Acting admin's username (Stripe portal + agent search) |
mainPlatformKey | string | Yes | The platform's main organization — useSubscriptionConfig().mainTenantKey, main on hosted ibl.ai — where free-trial users live and the only one that lists and changes plans. Never this app's organization (NEXT_PUBLIC_MAIN_TENANT_KEY): with it in the slot Change Plan is refused (404) |
currentUserEmail | string | Yes | Acting user's email, passed to the Stripe upgrade flow |
userActiveApp | UserApp | null | No | Active subscription record (from @iblai/iblai-api) — enables renewal-date / trial-days copy on the Plan card |
redirectUrl | string | No | Stripe checkout return URL; defaults to the current page |
plan_name) with a "Current" badge; trial end date or renewal date when
userActiveApp carries a subscription. A trial gets a gradient
Upgrade button that opens the plan picker (UpgradePackageModal:
four cards, the bullets from the host's planFeatures, "contact our
team" for enterprise). An organization on a plan gets an outline
Change Plan beside Add Credits once the backend sends plan_key: the
picker in change mode marks the current card. A recurring plan replaces
the subscription in place (updated): a dearer one starts a new period
today and is charged at once (a full period less the unused part of the
current one), a cheaper one takes its price from the next renewal. Only
Free waits for the end of the period (scheduled, with effective_at),
and a plan with no subscription behind it opens its checkout (checkout).
Both call useStripeUpgrade (choosePlan / changePlan).One limit covering everything all agents and users spend in this
workspace — the org-wide scope of the same spend-cap editor documented
in /iblai-vibe-agent-billing (enable toggle, usage bar, Spend Limit,
Resets Every, Block Requests / Alert Only, Alert At thresholds,
Delete Limit / Save). Before a cap exists, the section shows the
workspace's actual spend (this month + all time, from the
financial analytics endpoint) so an admin can pick a sensible number.
Every configured agent spend cap in the org, from the org-wide list endpoint (no per-agent fan-out):
$10.00 / Day), Spent, Remaining, Status
(direct toggle that saves immediately, with Exceeded / Alert-only
badges).AgentSpendCapsTab: This Agent + Per User sub-tabs) in a
popup titled with the agent's name, exactly as in
/iblai-vibe-agent-billing.User Limits — one user's spend across every agent in the workspace
(the user scope, beside the per-agent user limits in
/iblai-vibe-agent-billing):
80, 95).Default for New Users — the limit each person gets when they join the workspace as a member, as their own user limit:
Chat (/iblai-vibe-agent-chat) reads each user's own limits, as zones
and percentages, never dollars: a banner above the composer when a limit
is near ("Usage is nearing its limit."), and once a Block Requests
limit is exceeded a red banner with Send disabled until the period
resets. A refused send tells a member to contact their administrator and
gives an admin an Open Billing button, which calls the chat config's
navigateToAdminBilling (vibe-starter sends it to /admin/billing).
From @iblai/iblai-js/web-containers:
BillingTab — this surface. (The Spend Limits / Agent Limits
sections and the credits modals are internal to it.)From @iblai/iblai-js/web-containers/next (see
/iblai-vibe-agent-billing):
AgentSpendCapsTab — the per-agent editor the Agent Limits popup
hosts.From @iblai/iblai-js/data-layer:
useGetAccountBillingInfoQuery (plan_key /
plan_name name the plan; absent on a trial),
useGetCreditTransactionsQuery, useUpdateAutoRechargeInfoMutation,
useTriggerAutoRechargeMutation (a top-up: amount_usd),
useCreateStripeCustomerPortalMutation,
useRenewSubscriptionMutationuseGetStripePricingPageSessionQuery (the plans list),
useChangeStripePlanMutation ({ plan_key } → updated / scheduled /
checkout)useGetTenantSpendCapQuery,
useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutationuseListAgentSpendCapsQuery (optional mentor
filter)useListTenantUserSpendCapsQuery (username / email
filters), useGetTenantUserSpendCapQuery,
useUpsertTenantUserSpendCapMutation,
useDeleteTenantUserSpendCapMutationuseGetNewUserSpendCapDefaultQuery,
useUpsertNewUserSpendCapDefaultMutation,
useDeleteNewUserSpendCapDefaultMutationuseGetFinancialStatsQueryFrom @iblai/iblai-js/web-utils:
useStripeUpgrade — the plans (plans, loadPlans), a trial's
choosePlan (the plan's Stripe link) and changePlan (in place, through
the backend); STRIPE_PLAN_KEYS (free, premium = Pro, max, ultra).openExternalUrl — opens Stripe-hosted pages (portal/checkout).Run /iblai-vibe-ops-test before telling the user the work is ready, and give
every page, control and state this skill added its own checkpoint — one Playwright
test titled <ID> · … in e2e/journeys/, listed in e2e/coverage.json;
pnpm e2e:coverage must pass:
pnpm build -- must pass with zero errorspnpm test -- vitest must pass/settings/billing in the browser as /iblai-vibe-ops-test says: open it,
use every control this skill added (User Limits: search, set, toggle, edit,
delete; Default for New Users: switch, Save), read the console, check the
phone width.mentorReducer and mentorMiddlewareinitializeDataLayer(): 5 args (v1.2+)@reduxjs/toolkit: Deduplicated via webpack aliases in next.config.tssonner and @iblai/iblai-web-mentor must be installed
(pnpm add sonner @iblai/iblai-web-mentor)BillingTab comes from
@iblai/iblai-js/web-containers (base bundle) — unlike the agent
settings tabs, which come from /next.plan_key./iblai-vibe-credit) and in the plan picker the 402 flow opens
(/iblai-vibe-credit-exhaustion).spend_cap_exceeded 429. Full spend-caps REST tables live in
/iblai-vibe-agent-billing; the org-scoped endpoints are
spend-caps/tenant/ (GET/PUT/DELETE), spend-caps/agents/
(org-wide list, ?mentor=<uuid> filter), spend-caps/users/ and
spend-caps/users/{username}/ (user limits), and
spend-caps/users/default/ (the default for new users; a full-replace
PUT whose enabled: false means off). REST: /iblai-api-spend-caps.iblai-vibe-billing-add-credits.png (opens in a new tab)iblai-vibe-billing-agent-limits-manage.png (opens in a new tab)iblai-vibe-billing-agent-limits-per-user.png (opens in a new tab)iblai-vibe-billing-agent-limits.png (opens in a new tab)iblai-vibe-billing-manage-usage.png (opens in a new tab)iblai-vibe-billing-spend-limits.png (opens in a new tab)iblai-vibe-billing-user-limits.png (opens in a new tab)iblai-vibe-billing.png (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub iblai/base --plugin iblai-vibe166 skills in this plugin
/iblai-api-agent-accessManage role-based access to an ibl.ai agent via the platform API — list role policies, search users/groups, and grant/revoke editor, chat, or analytics_viewer roles for users, groups, and emails. Use when controlling who can edit, chat with, or view analytics for an agent./iblai-api-agent-auditRead an ibl.ai agent's audit log via the platform API — a who-changed-what trail filterable by action, actor email, and date range. Read-only. Use when investigating configuration changes to an agent./iblai-api-agent-chatSet up live chat with a deployed ibl.ai agent by wiring the hosted iblai-api-agent-chat MCP server into the project (.mcp.json / claude mcp add) using the .env Api-Token and a chosen agent's unique id, or by signing in from claude.ai, ChatGPT or Claude Desktop with only the URL. Use to enable runtime conversations with an agent, and to list or disconnect the apps a user has connected. The actual chatting then happens through the MCP server's tools.Other plugins' skills for the same job