detachbox
PagesRotate subscriptions and keys

Rotate subscriptions and keys

Connect two Claude subscriptions, or two Codex, turn rotation on in the launch, and a limit at 2 a.m. no longer ends the night: the agent moves to the next subscription with room and carries on in the same conversation. You wake up to finished work. API keys of one provider rotate the same way.

The default launch of api: Claude Code on one of three Claude subscriptions, with a DeepSeek key and a Z.ai key also on offer, an optional model, and rotation across the Claude subscriptions as limits run out.

Turn rotation on

Rotation belongs to a launch and covers all its terminals. Turn it on in either place:

  • In the launch: open the project on Projects, pick Edit on the default launch or in the ⋯ menu of a saved one, tick Rotate subscriptions as they run out, and pick Save.
  • From a running terminal: pick the account in the bar over the terminal, then Subscription rotation…. The window edits the launch and says how many of its terminals follow. Pick Save rotation: running terminals follow at once, with no restart.

The launch starts on the account picked under Runs on, or on your default if you left Always my default. A launch on a key offers Rotate keys as they run dry and Key rotation… instead. A pool holds subscriptions or keys, never both.

Pick the pool

  • All my Claude subscriptions, All my Codex subscriptions, or all your keys of that provider. Accounts you connect later join the rotation at the end of the list.
  • Chosen ones: tick the accounts that rotate. The account in use always stays in the pool, with at least one other beside it.

Pick the order

For subscriptions, choose how the next one is picked:

  • My order: the accounts are numbered; move one with its up and down arrows. The agent goes to the next account after the current one that still has quota above its switch line. After the last comes the first.
  • Auto: soonest reset first: the subscription whose weekly limit resets soonest is spent first, because whatever is left on it is lost at the reset. Claude Code moves to it early, even with room left where it runs; other agents move when theirs runs out.

Keys rotate to the next key of the provider when one hits its limit or runs out of balance.

Set the switch line

Under Switch line: move on when this much is left, set % of the 5-hour limit and % of the week, from 0 to 95. They start at 2 % and 1 %, so the agent moves on just before a limit cuts it off mid-step.

  • 0 moves on only when the limit runs out.
  • When no other subscription has quota above its line, the agent stays put until the limit, then moves to the next one with any room left.
  • A reserve set on Subscriptions & keys still holds, and the larger of the two counts. While you have lifted the reserve until the reset, only the switch line counts.

When the agent switches

The launch moves to another account when the one it runs on:

  • hits its limit in a terminal
  • reaches 100 % of a window, or a key's balance runs out
  • reaches the switch line
  • reaches the reserve you set
  • signs out
  • gets disconnected

In Auto: soonest reset first, a Claude Code launch also moves early to a subscription that resets at least an hour sooner and has room above its line.

While your Compute runs, the server checks each launch with rotation every 2 minutes, and right away after you change its rotation. Switch rotation on for a launch whose account already ran out, and it moves at once.

Where the agent goes

The agent skips accounts that ran out, sit at their reserve, signed out or have no limits read yet. The launch then stays on its new account until that one reaches its line or runs out in turn. Your default stays your default, and a reset on the old account does not pull the launch back, so it never bounces between two accounts.

What happens to the terminals

detachbox hands the new login to the agents of that launch and carries on its stopped terminals. Terminals of other launches and shells stay as they are. Claude Code picks up the new login by itself and gets "continue". Codex restarts with codex resume --last, then gets "continue".

When the whole pool runs out

The launch waits. With Continue after the limit resets on, it moves to the first account that resets and continues the terminals there, and the night's work carries on.

See where it went

  • The launch's row on the project page names the account it runs on now and reads rotates subscriptions.
  • Its terminals carry the same account and a rotate mark in the Terminals list.
  • Activity records every move with its reason: the limit, your reserve, the switch line, a lost sign-in, a disconnected account or a sooner reset.

What rotation needs

FeatureNeeds
RotationA launch on a subscription or key connected in the dashboard, and a second one of the same provider and kind
Switch line and orderSubscriptions; keys move to the next key at their limit

A launch whose agent signs in inside the terminal has no connected account to watch, so its form has no rotation. Connect more accounts as Subscriptions shows.