diff --git a/app/main.py b/app/main.py
index c4c743f..8176268 100644
--- a/app/main.py
+++ b/app/main.py
@@ -40,6 +40,12 @@ BROKER_SECRET = os.environ.get("BROKER_SECRET", "")
DEFAULT_CREDIT_PACK_URL = "https://opencollective.com/inference-cooperative/contribute"
CREDIT_PACK_URL = (os.environ.get("CREDIT_PACK_URL") or "").strip() or DEFAULT_CREDIT_PACK_URL
+# Where a GUEST account's "Become a member" button points (the contribution
+# page — what actually starts a membership). Deliberately independent of
+# CREDIT_PACK_URL: a guest needs a membership, not a credit pack, even if the
+# credit-pack link is ever repointed at a pack page.
+BECOME_MEMBER_URL = "https://opencollective.com/inference-cooperative/contribute"
+
app = FastAPI()
@@ -311,6 +317,7 @@ def render_page(identity: str) -> str:
return (
PAGE_HTML.replace("@@IDENTITY@@", _esc(identity))
.replace("@@CREDIT_PACK_URL@@", _esc(CREDIT_PACK_URL))
+ .replace("@@BECOME_MEMBER_URL@@", _esc(BECOME_MEMBER_URL))
)
@@ -590,7 +597,7 @@ PAGE_HTML = """
Shared across chat and API.
-
+
Matrix chat
We use the Matrix chat protocol to collaborate. You can access our space with an inference.coop account or an account hosted elsewhere.
Current Matrix ID:
@@ -701,6 +708,20 @@ async function load() {
if (r.status === 401) { location.reload(); return; }
const d = await r.json();
if (d.error) { flash(d.error, false); return; }
+
+ // Gift accounts (portal flag): no Matrix section — the card is hidden in
+ // the markup and only shown to members — and a Become-a-member button in
+ // place of the credit-pack buy path. Everything else stays.
+ const isGuest = !!d.guest;
+ $('matrix-card').style.display = isGuest ? 'none' : '';
+ if (isGuest) {
+ const b = $('buy-btn');
+ b.href = '@@BECOME_MEMBER_URL@@';
+ b.textContent = 'Become a member';
+ $('buy-credits').textContent = 'Your gift credit never expires · members get a monthly allowance';
+ $('meta').textContent = 'A gift from a member — $5 of AI usage across chat and the API.';
+ }
+
const balance = d.balance ?? 0;
const spend = d.spend ?? 0;
const remaining = d.remaining ?? Math.max(0, balance - spend);
@@ -744,7 +765,7 @@ async function load() {
renderModels(d.models || []);
renderBoard(d.coop_models || []);
renderKeys(d.keys || [], d.key_spend || []);
- loadMxid();
+ if (!isGuest) loadMxid();
} catch (e) {
flash('Could not load usage: ' + e.message, false);
}