Skip to content

Add credit top-up UI and proxy route#28

Merged
pranavpatilsce merged 2 commits intomainfrom
feat/fleet-credits-topup
Apr 8, 2026
Merged

Add credit top-up UI and proxy route#28
pranavpatilsce merged 2 commits intomainfrom
feat/fleet-credits-topup

Conversation

@pranavpatilsce
Copy link
Copy Markdown
Contributor

Summary

Adds a credit top-up flow to the reef UI so users can add LLM credits without leaving the chat.

What changed

  • Header button — persistent + credits button in the top bar with a dropdown for $5/$10/$25/$50 top-ups. Always accessible, so users can add credits before starting big tasks.
  • Inline widget — appears in the chat stream when a task finishes with "No credits available", with the same amount buttons right where the error shows up.
  • Proxy routePOST /ui/api/topup-credits forwards the request to vers-landing's /api/reef/topup-credits endpoint using the reef auth token. The reef server already has VERS_AUTH_TOKEN in its env.

How it works

  1. User clicks an amount button (header dropdown or inline widget)
  2. Reef UI calls /ui/api/topup-credits (reef server)
  3. Reef server proxies to ${VERS_LANDING_URL}/api/reef/topup-credits with the auth token
  4. vers-landing verifies the token, checks for a Stripe card on file, charges it off-session, then calls the Chelsea admin API to grant credits to the team pool
  5. UI shows success/failure feedback

New env var

  • VERS_LANDING_URL — defaults to https://vers.sh, set on the reef VM to point to the vers-landing instance

Cross-repo context

Depends on vers-landing feat/fleet-credits branch which adds the /api/reef/topup-credits endpoint, the DB migration for llm_proxy_key_id, and the deploy route changes to store the LLM proxy key ID at exchange time.

Header button (+ credits) with dropdown for $5/$10/$25/$50 top-ups,
always accessible. Inline widget also appears in chat when credits
are exhausted. Both call /ui/api/topup-credits which proxies to
vers-landing's reef topup endpoint using the reef auth token.
@pranavpatilsce pranavpatilsce merged commit 43674a8 into main Apr 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant