Skip to content

Signing in to your AI providers ​

On a Hapimatic Cloud VM you sign in to Claude Code, Codex, and Gemini CLI yourself, inside your own VM, with each tool's own sign-in. Your provider accounts are yours: each provider's own terms and limits apply to them, and Hapimatic does not change either.

The sign-in page at hapimatic.com does not ask for or receive a provider credential. If your instance was set up before in-VM sign-in, hapimatic.com and your VM still hold the credential delivered at that onboarding until the operator moves your instance to in-VM sign-in and removes it.

Claude Code ​

  1. Open your instance, then Settings → Provider Accounts. The first time you arrive, the setup guide takes you there.
  2. In Anthropic, choose Add, then Sign in to Claude Code.
  3. Choose Open sign-in page, sign in, and click Authorize. To add a different account from the one already signed in, use the Switch account link on that page. If claude.com emails you a 6-digit code, enter it there on claude.com.
  4. Copy the long code the page shows, paste it into the dialog, and press Done.

The code works once and expires in a few minutes. If it is not accepted, open a new link and try again. On a phone you can leave for your browser and come back: Hapimatic keeps your place, even if the app reloads.

If a sign-in has already finished when you open a new link or start over, Hapimatic adds that account instead of starting another sign-in.

The code you paste goes from your browser to your own VM, straight into Claude Code's own sign-in, and is not stored. hapimatic.com is not in that path, and Claude Code itself does the sign-in.

To sign in from a terminal instead, choose Use a terminal instead in the dialog, run the command it shows in a session's Terminal tab, and type /login. Hapimatic adds the account once Claude Code finishes. Either route signs in the same way. The terminal route needs a running session, so it works once one account is already signed in; sign the first account in with the paste sign-in above.

Each account you add gets its own folder on your VM, under ~/.config/hapimatic/account-configs/, and Claude Code keeps that account's credential there and renews it itself. Hapimatic records only the account's name and email, never the credential, and starts each session for that account with that folder.

A sign-in you make from your own shell on the VM (running claude and typing /login) is for terminal claude only: Hapimatic sessions do not use it. Add every account you want Hapimatic sessions to run on here, under Add account.

Codex ​

  1. In Settings → Provider Accounts, go to OpenAI and choose Add.
  2. Choose Sign in with a ChatGPT subscription (Codex shows a link and a one-time code), or open Log Codex in with an API key and enter an OpenAI API key.
  3. Press Done.

Codex runs its own codex login on your VM and keeps the credential in that account's own folder.

Gemini CLI ​

Gemini CLI uses an API key only. Google does not allow other tools to use Gemini CLI's own sign-in.

  1. In Settings → Provider Accounts, go to Google Gemini and choose Add.
  2. Enter your Gemini API key and press Test, or press Done. Hapimatic stores the key only after Google accepts it.

The key is stored on your VM.

OpenRouter and other keys ​

Add an OpenRouter key, or another service's key, on your VM under Settings → Provider Accounts → Provider API Keys. It is stored on your VM.

An OpenRouter key needs Codex or OpenCode on your VM, and a session uses it once you pick a model under OpenRouter model on the New Session page. A session left on Codex's default uses Codex's own sign-in rather than your key.

Switching accounts ​

You can add several accounts for a provider and choose which one each session uses. Each account's own limits apply: switching moves a session to another account's allowance, and never pools or raises them.

How long a sign-in lasts ​

Each account card on Settings → Provider Accounts shows the nodes the account is on in one line, however many there are: the number of nodes, a bar with one cell per node (red needs a new sign-in, amber is ending soon, grey is quarantined, green is running, faint is not read yet), and the nodes that need you, such as "SL7 re-login · 2 ending". Tap the arrow at the start of the line to open one row per node.

Where Hapimatic signs a Claude account in itself (a Hapimatic you install on your own machine, which adds each account through Provider Accounts), each node's row shows, beside the node's pill, how many days ago the account last signed in on that node, such as "12d". When a sign-in stops refreshing, the age reads "died" and the age at which it stopped, such as "died 30d", and that number no longer rises. Signing in again starts the count at 0. Hover over the age, or tap it, to read the full sentence. The account switcher shows the same age in each account's row, for the node the session runs on, or will start on. On a Cloud VM, where Claude Code keeps and renews each account's credential in that account's own folder, no age is shown.

A Claude sign-in also has an end date: Claude Code records it when you sign in, usually 30 days later, and renewing the credential never moves it later. Once it passes, sessions on that account stop until you sign in again. Hover over or tap the age to see roughly when the sign-in ends, such as "ends in about 18 days". If Hapimatic cannot work out the date, the sentence says "end date unknown".

Three days before the end date, Hapimatic starts warning you:

  • The age becomes a countdown, such as "2d left", and then "due" once the date has passed. The node's pill gets an amber ring. Its sentence says "ends in 2 days", or "ends in about 2 days" when Hapimatic estimated the date because Claude Code had not recorded it.
  • An Ending soon list at the top of Anthropic has one row per account. An account ending on one node names it, with a Sign in again button; an account ending on several shows how many, and its arrow opens one row per node, each with its own Sign in again.
  • You get one Sign-in ending notification for each sign-in, with Sign in again. Turn it off under Settings → Notifications → Sign-in Ending.

Signing in again on that node clears the warning and starts a new end date. On a Cloud VM no end date is shown, because Claude Code keeps and renews the credential in the account's own folder.

Usage and limits ​

To show each account's usage, to pace new sessions across accounts, and to list the Claude models each account can use, Hapimatic reads that account's usage and model list from Anthropic. These reads happen on your VM and go only to api.anthropic.com, with the credential Claude Code keeps in that account's folder. Nothing is copied or sent anywhere else. To turn them off, add HAPI_TENANT_USAGE_READ=0 to ~/.config/hapimatic/env, which both the Hapimatic server (where the usage and model reads are checked) and its daemon read, then run systemctl --user restart hapimatic-private hapimatic-private-daemon. Usage then shows as unavailable, new sessions are not paced by usage, and the model list is Hapimatic's built-in one.

What the operator can access ​

The operator keeps SSH access to your VM for setup, updates, and support, as the consent statement describes. That access could reach the files on your VM, including your account folders. Each manual operator session on your VM is recorded, with who opened it, when, why, and which VM, in a log the operator keeps; automated setup and update runs are not in that log.

Your machine, your settings ​

Your VM records whether it is a customer VM in two files under ~/.config/hapimatic/. Because you administer your VM, you can change them. That changes only how Hapimatic behaves on your own VM: hapimatic.com still decides from its own records and never accepts a provider credential for your instance.

The self-hosted core is licensed under AGPL-3.0.