Docs

Install tab. Set a cap.

Two minutes with the tab CLI; five by hand with any OpenAI client. Every refusal comes back as an HTTP error with its reason.

What changed lately is in the changelog (feed).

  1. 1. Install tab

    Node 22 or newer, nothing else. Login is once per machine; the Agent is per folder, kept in .flocktab with no secret in it.

    npm i -g @hanamorilabs/tab
    tab login          # approve this machine in the console
    cd my-project
    tab claude         # first run asks which Agent this folder runs as
    tab codex          # same Agent; any command works: tab <cmd>

    Keys on your own machine instead of ours: tab up runs the self-hosted proxy (one small binary that ships with tab), then tab login and pick Self-hosted. The ledger and the kill switch stay on flocktab.com.

  2. 2. By hand: create a tab, copy the key

    Console, New tab. Name the agent. Cap in dollars. Window: day is the default. The key is shown once, prefix ft_live_, hash stored; rotate by issuing a new one.

  3. 3. By hand: point the client

    from openai import OpenAI
    import os
    
    client = OpenAI(
        base_url="https://proxy.flocktab.com/v1",
        api_key=os.environ["FLOCKTAB_KEY"],
        default_headers={
            "x-flocktab-unlock": os.environ["FLOCKTAB_UNLOCK"],
        },
    )
  4. 4. Handle denials

    Body error.code. Header x-flocktab-reason. BLOCKED never reaches the provider.

    HTTPerror.codex-flocktab-reasonWhen
    402tab_closedcap.dayCap or closed tab. Do not retry until it reopens.
    402tool_cappolicy.toolNamed tool hit its cap.
    403risk_blockedpolicy.riskIrreversible. Empty allowlist denies. Remaining floor $25.00.
    429velocityvelocityToo many calls this minute.
    403model_blockedpolicy.modelsModel not on the allowlist.
    401key_revoked-Unknown or rotated key.
    503ledger_unavailableledgerFail closed. Matching in-flight replay is not a green light.

    Do not retry a closed tab until it reopens. 503 is fail closed: do not retry as a green light on a matching in-flight idempotency replay.

    Unknown tools are write, not read.

  5. 5. Let an agent run the tab

    The MCP server gives Claude Code, Codex, Cursor or claude.ai your console: read spend, close a tab, change a cap. OAuth, nothing to paste. Set up the MCP server.

    claude mcp add --transport http flocktab https://console.flocktab.com/api/mcp

Run Claude Code or Codex in a project

Install the harness you use, install tab, and approve this machine with tab login. In the project folder, tab claude or tab codex selects the folder’s Agent on first launch. Confirm the selected Agent and its kind before starting work. Each harness in a project has its own Agent.

npm i -g @hanamorilabs/tab
tab login
cd my-project
tab claude   # Claude Code
# or, for a Codex Agent:
tab codex

For a disposable API Agent, set a cap in the console, run a small task, and verify its ledger entry. Close the tab and confirm the next request is refused. Reopen only after reviewing the reason. See the kill-switch drill for stronger upstream evidence and in-flight behavior.

Test an API-key Agent

An API-key Agent is paid by the flock’s provider key and metered against its cap. Make a small one in an empty folder and run Claude Code on it:

mkdir -p ~/ft-api-test && cd ~/ft-api-test
tab agent create api-test --api --cap 5 --harness claude
tab use        # pick api-test for this folder
tab claude     # say hello

tab status shows the folder running as api-test with its cap, and the console shows the spend. Close the tab in the console and the next message is refused with tab_closed; reopen it and it works again. Lower the cap below one call and the call is refused before the provider.

To test in a folder that already runs as another Agent, run tab use there, pick the API Agent, test, then tab use again and pick the original. Sessions already running keep the Agent they started with; only sessions started in between use the new one. Picking an Agent whose key is already on this machine reuses that key; an Agent keyed on another machine gets a new key, which revokes the one there.

Do not switch the kind of an Agent that has sessions running. tab agent kind moves the Agent for every folder that uses it, and a running subscription session is refused with 403 not_subscription on its next call once the Agent is api.

Supported harnesses

tab sets each harness up in the form it reads, so tab <name> is all you type. Yes means a live run proved it: the call settled on the tab and its tokens matched the vendor’s own count, or, for Agent Guard, a risky call was stopped and an everyday one let through. Coming means built or planned, not yet proven.

HarnessOwn keyFlock keySubscriptionAgent Guard
Claude Codetab claudeYesa direct Anthropic key must be workspace-scopedYesYesClaude Pro or MaxYes
Codextab codexYesYesYesChatGPT planYes
Gemini CLItab geminiYesYesNono plan loginYes
Antigravitytab agyYesYesNono plan loginYes
Groktab grokYesits own XAI_API_KEYYesYesSuperGrokYesfrom tab 0.1.43
Kimi Codetab kimiYesYesCominga Kimi plan with Kimi CodeYesfrom tab 0.1.43
OpenCodetab opencodeYesYesNono plan loginYes
Goosetab gooseYesYesNono plan loginYesmacOS and Linux; Windows isn't covered
Clinetab clineYesYesNono plan loginYesfrom tab 0.1.43; a held call is refused at once; allow it from the queue and the agent retries
OpenClawtab openclawYesYesNono plan loginComing
Pitab piYesYesNono plan loginYesfrom tab 0.1.43
Aidertab aiderYesYesNono plan loginNono hook API
Copilot CLItab copilotYesits own-key mode, no GitHub modelsYesNono plan loginNono hook API

Tested in live runs on 26 September 2026.

Own key: an API-key Agent keeps the keys the harness already uses (ANTHROPIC_API_KEY, OPENROUTER_API_KEY, ...); tab only moves where they are sent, and every call is held and charged to the tab’s cap. Flock key: a vendor it has no key for uses the flock’s key. Subscription: the harness’s own plan login, recorded at list price and never charged to the tab. A model named vendor/model goes to OpenRouter, and with no Anthropic key, Anthropic models go through OpenRouter too.

Editors are set up once, by hand, with the tab’s key and the proxy as an OpenAI-compatible endpoint (/v1, or /v1/openrouter for vendor/model ids):

  • VS Code Copilot agent mode: Chat: Manage Language Models, Add Models, custom endpoint. It runs on your machine, so a local proxy works.
  • Cline extension: API Provider OpenAI Compatible, base URL, the tab key, a model id.
  • Cursor: Settings, Models, API Keys, OpenAI key and Override OpenAI Base URL. Cursor sends these calls from its own servers, so it needs the hosted proxy (https://proxy.flocktab.com), not a local one. Tab completion stays on Cursor.

Not yet: Cursor’s command-line agent has no model endpoint setting, and Devin runs entirely in its own cloud; record their spend as outside spend.

Use your own subscription login

Choose a subscription Agent when creating it, sign in through the harness, and launch it with tab. The proxy passes that login to the vendor and records usage under the account the vendor identifies. Account and plan discovery comes from the vendor; you do not need to declare them.

The tab’s kill switch and supported policies still apply. List-price activity is not charged to the tab balance and does not replace the vendor’s quota. Use the subscription pool guide and keep usage valuations separate from invoices.

Attribute costs to a project

  1. In the console, select the project that owns the work and check which named Agents belong to it.
  2. Connect the relevant vendor in Outside spend. Confirm the reporting period, currency, and whether the amount is billed usage or an estimate.
  3. Assign a known resource, such as an OpenRouter key, to its project. Assign an entire account only if all the represented usage has that owner.
  4. Reconcile the attributed components and unresolved remainder to the account total. Keep subscription list-price activity separate from charges.

Follow the worked OpenRouter example and weekly review template. Project reporting does not create a shared enforced project cap; admission is controlled by each Agent’s tab.