Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

6.7 KB
Raw Blame
title: Multiple Claude, Codex & Grok accounts
description: Add several logins or API keys per engine, plus OpenAI- or Anthropic-compatible servers, in one order to use, with automatic failover across engines when one runs out of usage.
card_title: Accounts & profiles
path: docs/accounts.html
nav: accounts
card: Several accounts per engine, one order to use, and failover across engines.
card_art: avatar:user
---
<p class="kicker">Docs</p>
<h1>Multiple Claude, Codex and Grok accounts</h1>
<p class="intro">Use every account you have. A space can hold several accounts per engine, for example a work Claude subscription, a personal one and an API key. When one runs out of usage, kwant moves the turn to the next account in your order, on any engine.</p>
<figure>
  <div class="frame">{{shot:v2-accounts|Settings, This space, Apps and accounts, AI accounts: Claude is used first, ready and used by Ann and Ben. If it runs out: Codex, ready, which Cody uses first, a Personal Max Claude login out until 06:34, and Ollama on the Mac, which can't connect, each with Use first. Grok isn't used and isn't installed. Below: Sign-ins and settings, and Advanced.|(max-width: 860px) 100vw, 760px}}</div>
  <figcaption>Accounts live under <strong>Settings → This space → Accounts</strong>, and belong to that space.</figcaption>
</figure>

<h2 id="profiles">Account profiles</h2>
<p>A profile is one account for an engine, for example a work Claude subscription and a personal one. Every engine starts with a <strong>This machine</strong> profile, which uses the CLI's own login, or the key from Settings or the environment.</p>
<div class="table-wrap"><table>
  <thead><tr><th>Kind</th><th>Runs with</th><th>Signed in by</th></tr></thead>
  <tbody>
    <tr><td><code>system</code></td><td>The CLI's default config folder, or the Settings or environment key</td><td>Whatever you did on the host</td></tr>
    <tr><td><code>cli_home</code></td><td>Its own config folder; host credential variables are removed</td><td>The in-app sign-in, or your own folder</td></tr>
    <tr><td><code>api_key</code></td><td>The provider's API, with only the profile's key</td><td>The key you paste</td></tr>
    <tr><td><code>custom_api</code></td><td>Your own server, with its key if it has one</td><td>A check of the server's model list</td></tr>
  </tbody>
</table></div>
<p>Keys are write-only: no API response ever contains one, only whether it's set.</p>

<h3 id="sign-in">Signing in a CLI profile</h3>
<p>kwant runs the CLI's own login with the profile's folder. For Claude, open the link and paste the code shown back into kwant. For Codex and Grok, open the link and enter the code. A sign-in expires after 10 minutes.</p>

<h2 id="order">Order to use</h2>
<p>Settings → This space → Accounts starts with <strong>Order to use</strong>: every account in the space, across Claude, Codex, Grok and Custom API, in one list. When one runs out, kwant bots move to the next that still works, in this order. Use the arrows, or drag a row, to move an account earlier or later. Each row shows its engine and whether it's Ready or out until its reset, for example "Out until 03:00". Accounts that are signed out or not installed are listed below, under <strong>Not in the order</strong>, with no number or arrows. They join the order at the bottom once they're ready.</p>
<figure>
  <div class="frame">{{shot:v66-order-to-use|Settings, This space, Accounts: the Order to use list. "When one runs out, kwant bots move to the next that still works, in this order." Work, a Claude login, is out until 03:00. Personal, another Claude login, is ready, then Codex on an API key and a Custom API account, each numbered, with up and down buttons. Under Not in the order, with no number or arrows, are This machine's Claude, Codex and Grok and a Grok login, all signed out.|(max-width: 860px) 100vw, 760px}}</div>
  <figcaption>One order for the whole space. Updated in 0.6.6.</figcaption>
</figure>

<h3 id="failover">Failover</h3>
<p>A turn starts on its bot's account: the one it's pinned to, or its engine's default. When that account is out of usage or signed out, and nothing has been shown or done yet in the turn, kwant moves the turn to the next account in the order that still works, on any engine, up to 6 attempts. An account known to be out is skipped until its reset, and bots go back to it after the reset on their own.</p>
<ul>
  <li><strong>The same kind of model.</strong> On another engine, the turn uses that engine's model of the same tier. A Custom API account uses a model its server offers.</li>
  <li><strong>One quiet line.</strong> Under the bot's name, the reply says once per outage what happened, for example "Claude is out until 03:00 · answered on Codex (GPT-6.1)".</li>
  <li><strong>A limit message is never the reply.</strong> A line like "You've hit your session limit · resets 3am (Europe/Berlin)" counts as the account running out, with its reset time. It's never saved as the bot's answer.</li>
  <li><strong>When every account is out,</strong> the message waits for the earliest reset, and the chat says "Every model is out until 03:00 CET; I'll answer then." The time is in your saved time zone, with its abbreviation.</li>
  <li><strong>Overloads and rate limits</strong> are retried, not failed over.</li>
</ul>
<p>Turn failover off for a bot to keep it on its own account.</p>

<h2 id="pin">Pinning a bot</h2>
<p>In a bot's settings, pick the account it should use, or leave it on the engine's default. Clear <strong>Switch to the engine's next account when this one runs out of usage or is signed out</strong> to keep the bot on its account.</p>
<figure>
  <div class="frame">{{shot:v2-bot-account-pin|Editing QA: engine, model and the account Team gateway, ready, with the switch to move to the engine's next account when this one runs out, and the approval override.|(max-width: 860px) 100vw, 760px}}</div>
</figure>

<h2 id="custom">Custom API accounts</h2>
<p>Add an account with the server's base URL and, if needed, a key. kwant checks the server's model list when you save it and shows whether it's ready, unreachable or rejected the key. A space can have several custom accounts, and they belong to that space only.</p>
<ul>
  <li>Paste the base URL with or without <code>/chat/completions</code> or <code>/messages</code>: kwant trims it to the API root.</li>
  <li>MCP tools are offered on OpenAI-chat servers. Anthropic-Messages servers run without tools and say so.</li>
  <li>Custom API never falls back to the host's accounts.</li>
</ul>
<div class="note"><strong>Keep a space off this machine.</strong> Each space has a <strong>Use This machine</strong> switch. Turn it off to keep the space on its own accounts: its bots never fall back to the CLIs signed in on the computer running kwant.</div>