Billing and organizations
SkillCommunicationLets your agent answer questions about LLM Gateway billing, plans, credits, and subscription logic.
Use Billing and organizations in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Billing and organizations and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Billing and organizations skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
About this skill
Organizations, plans, credits, and billing in LLM Gateway, org kinds, the Pro plan, DevPass and Chat entitlements, Stripe webhooks, end-user wallets, cost and token billing math, audit logs, and org-scoped emails and notifications. Use when changing apps/api/src/stripe.ts, subscription or credit lo
What this skill tells your AI
The instructions your AI receives, as published by theopenco/llmgateway in .agents/skills/billing/SKILL.md and read by ahel’s review.
Money
- Do all money, credit, and usage-threshold math with
Decimalfromdecimal.js; convert DB decimal strings withnew Decimal(value ?? 0). - Token extraction (
apps/gateway/src/chat/tools/extract-token-usage.ts) normalizes completion tokens to include reasoning;calculateCosts(packages/actions/src/costs.ts) bills the completion count and reportsreasoningTokensas a detail. Verify a new reasoning provider's usage semantics live.
Organization kinds and plans
organization.kind(default/devpass/chat) is set at creation and never changes; DevPass and Chat signups get a separate organization (apps/api/src/utils/personal-org.ts). Joining on it for historical attribution is safe.organization.planchanges over time.- The Pro plan exists only on
defaultorgs. DevPass and Chat entitlements live indevPlan/chatPlanand their*CreditsLimit/*StripeSubscriptionIdcolumns;organization.stripeSubscriptionIdis reserved for a team org's Pro subscription. - Every Stripe webhook that sets
plan: "pro"or stampsstripeSubscriptionIdfirst returns for non-default kinds, ascheckout.session.completed,customer.subscription.created, andinvoice.payment_succeededinapps/api/src/stripe.tsdo. Adevpassorchatorg withplan: "pro"is corrupt state; gate product behavior for those orgs on their own entitlement columns. - End-user wallet organizations are regular PAYG
defaultorgs.withWalletCreditsaffects only downstream credit gating, never kind- or plan-gated gateway logic. - For "has this org ever paid for DevPass", use
hasBillingHistoryfromGET /dev-plans/status; plan end clears everydevPlan*column.
Audit log, emails, notifications
audit_logrecords actions owned by one organization. User-account events (email, password, profile) belong in a user-scoped store.- Send org-scoped email only when the org owner's email is verified, via
isOrgOwnerEmailVerified/resolveVerifiedOrgRecipient(@llmgateway/db). Only verification and password-reset emails reach unverified users. - Prefix org-scoped notification event keys with the org id.
Signals
- GitHub stars
- 2k
- Forks
- 190
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
billing-theopenco- Source
- github.com/theopenco/llmgateway
github.com/theopenco/llmgateway
More in Communication
Skill · anthropics
More in Communicationerror-handling
Skill · affaan-m
More in Communicationemails
Skill · coreyhaines31
More in Communicationazure-messaging
Skill · microsoft
More in Communicationinvestor-outreach
Skill · affaan-m
More in Communicationgws-gmail
Skill · googleworkspace
More in Communication