One gateway for Claude Code, Codex CLI and Antigravity CLI

memtrunk sits between your AI tools and your model providers. It holds the credentials, spreads load across the provider accounts you already have, shows the estimated cost of the keys, teams and sessions you can see, and offers opt-in memory that carries across sessions.

~/projects/api
# Claude Codeexport ANTHROPIC_BASE_URL=https://memtrunk.your-host.dev/<your-token>export ANTHROPIC_AUTH_TOKEN=placeholderclaude# Codex CLI and Antigravity CLI use the same address,# on their own native routes.
Claude poolNext up: work-max
Sample data.

The short version

What is memtrunk?

memtrunk is a self-operated AI control plane: a unified model proxy and admin console for Claude Code, Codex CLI and Antigravity CLI. It sits between your tools and your LLM providers. Provider credentials are registered once and held centrally, and you issue scoped API keys to the clients that call through it. It pools the upstream accounts you already have, spreads load across them, and routes each request to the right provider and model through rules you control. Usage and estimated cost are recorded for every request, each tool call is attributed to the agent that made it, and spend limits catch an overage early. Memory persists centrally in your own deployment. Role-based access is enforced on the server, with org-scoped admins and a read-only auditor role. See the full list of features, how security and access control work, or where pricing stands.

Connect

Keep your tools, change one base URL

Your CLI keeps talking the protocol it already speaks. memtrunk decides which account and model serves each request, and estimates what it cost.

  1. Copy your personal addressThe Dashboard setup guide shows a personal address that holds your proxy token. Claude Code, Codex CLI and Antigravity CLI need no API key with it. If the guide shows no address, use a named API key.
  2. Point your client at memtrunkEach tool takes that address in its own setting. The setup guide shows where.
  3. Send a requestEach request is recorded with its usage and estimated cost, and the session appears in the console.

Full Claude Code setup guide

Why it exists

Running more than one provider gets messy fast

  • Credentials scattered across client configs and CI secrets

    Provider credentials are registered once and held centrally. Clients connect with a personal address or an API key, not with the provider credentials

  • One subscription hits its 5-hour or weekly window while the others sit idle

    Requests draw from a pool of accounts, chosen by how much of each window is left

  • No one can say what a session cost, who ran it, or which agent failed

    Each request is attributed by key, user, project, session and agent, with cost estimated from your configured prices

  • Agents forget everything between sessions and between machines

    Memory is captured and injected on the server, so it follows you to any device

What you get

Four things your CLI can't do on its own

Pool the subscriptions you already have

Register Claude, ChatGPT and Antigravity accounts alongside metered API keys. memtrunk tracks each account's rolling 5-hour and 7-day windows and spreads load before any one of them runs dry.

  • Create a dedicated key that draws on your subscription, so any tool that takes an API key can use the plan you already have.
  • Owner controls: share, keep private, hide from team, or mark as backup only.
  • Weekly pacing caps and per-account utilisation caps.
  • Optional paid fallback to an API key, off by default and capped at $1.00 per day unless you lower it.

Memory that lives in the path, not in a plugin

Claude traffic through memtrunk gets memory with no setup and no tool schemas in its context. Past work is synthesised into digests, facts and procedures and injected as a bounded block on the way to the model.

  • Per-project control over collecting, injecting and sharing with teammates.
  • Embeddings and reranking run inside your deployment, not on a third-party API.
  • Other clients, and tools that can't route through the gateway, can use memory over MCP.
Outgoing request+ memory
  1. claude
  2. memtrunk recall
  3. model
<memory project="api">· Tests run with pytest -n 4; the HGB suite needs OMP_NUM_THREADS=1· Migrations: one Alembic head, never re-parent· Deploy is blue/green via deploy/blue-green.sh</memory>
Sample data. Injection is fail-open, so a slow recall never blocks the request.

See every session, and pick it back up

Sessions group each conversation with its project, client, estimated cost and turn timeline. Sessions from Claude Code and Codex CLI also show a copyable resume command for the tool that started them.

  • Tool calls attributed to the agent or sub-agent that made them.
  • Failures classified by type, not a single generic error flag.
  • Request logs with redaction controls and retention you set.
SessionsLast active
  • Refactor billing webhooksapi · 4 min ago
    claude --resume 7f3c9e21
  • Fix flaky e2e login specweb · 1 h ago
    codex resume 019a4b2c
  • Draft migration planinfra · yesterday
    claude --resume 3d81aa07
Sample data.

Spend ceilings that hold at request time

Limits cascade from key to user to team to the whole pool and are enforced before a request goes out, not reported after the invoice arrives.

  • Threshold and anomaly alerts with burn-rate and exhaustion forecasts.
  • In-app notifications, plus a webhook when configured.
  • Per-model rates you can override, hide or reveal.
Budgets this monthCap
  • Key$21 / $50
  • User$126 / $200
  • Team$860 / $1,000
  • Pool$2,040 / $4,000
Sample data. Projected to reach the team cap in 4 days.

Why memtrunk

  • Subscription pooling, not just metered keys

    Beyond metered API keys, memtrunk pools the provider subscription accounts you already have and spreads load across the pool automatically.

  • Access control included, not bolted on

    Role-based access is enforced on the server and ships as part of the console, with org-scoped admins and a read-only auditor role.

  • Per-agent telemetry, not just aggregate estimated cost

    Estimated cost and usage totals don't show which agent or tool call failed, or why. memtrunk records each tool call against the agent that made it, with an error classification, alongside estimated cost and usage.

Everything in the console

Provider & key management

Register every upstream provider once, hold its credentials centrally, and issue scoped API keys to the clients that call through you.

Account pooling

Draw from a pool of upstream accounts so load and quota spread automatically instead of hitting one account's ceiling.

Routing

Route every request to the right provider and model, including rules that span providers, without touching client code.

Usage & cost telemetry

Every request is recorded with its tokens and estimated cost, and spend ceilings are enforced before an overage becomes a surprise bill.

More capabilities

Where it stands

What's ready today

Claude

Has carried real, sustained production traffic in this deployment and works reliably there.

OpenAI, Codex and Azure OpenAI

Built, tested and configurable today, without the same production mileage yet.

Pricing

Not published yet. You can create an account and connect your own providers now. Read more

Point one CLI at memtrunk

Create your account, connect the providers you already use, and watch your first session show up with its estimated cost, and a resume command for Claude Code and Codex CLI sessions.

Create your account