Models
A model is what thinks for an agent. Each session runs on the model its harness is set to, and you choose both: Claude through Claude Code, GPT through Codex, or whichever models Pi and Cursor offer. Every turn is also paid for by someone. A session can run on a subscription you already have, on your own API key, or on Mod's inference router. Whichever you use, your keys and logins never go onto the log or into a document.
How it works
There are three ways to pay.
A subscription, through its harness. A Claude or ChatGPT login belongs to the harness that signed in, such as Claude Code or Codex. The login stays on that machine, in the harness's own files. In a VM on your Mac or your own server, you sign in once inside a VM and every session VM mounts that login volume. Mod does not read it. A session on a subscription therefore runs only on your own machines.
Your own API key, at Mod's edge. You store an Anthropic or OpenAI key with Mod once, and it is kept encrypted at Mod's edge. A harness is given only a base URL and a placeholder. Its requests carry your Mod sign-in, which the host adds outside the VM, and the edge swaps that for your key on the way to the provider. The real key never enters the VM's environment or files. Mod does not meter these turns: you pay the provider directly. A session on an edge key can run on any of your machines, and it can also run in the pool.
Mod's router. The router talks to Anthropic and OpenAI through one interface and streams the reply as it arrives. It is what a document-only session uses, and what mod-next's own agent falls back to when there is no Codex login on the machine. Every turn through the router is metered. Usage is recorded per person and per project, each person has a credit balance and rate limits by the minute and by the day, and a request that would overrun the balance is refused. A runaway agent stops instead of spending.
Which sign-in a session runs on is recorded on the session. That, not the harness, decides where the session may be placed.
Using it as you build
You choose how each session pays by choosing its harness and model in the composer's model picker. A harness model runs on that harness's own sign-in. A Mod model runs on the router.
To run Mod's agent from the command line, start the inference worker for a project. It uses a Codex login if this machine has one, and Mod's router otherwise:
mod-next workers <projectId> inference
Nothing you write as a developer touches a key. An app, a script or an agent asks for work by writing to a session; the worker that serves it brings the credential.
Limits
- The router supports Anthropic and OpenAI models only, and which models you can use depends on your plan.
- A ChatGPT plan works on your own machines through the login volume. Using it at Mod's edge waits on OpenAI's approval.
- Codex on an OpenAI key held at Mod's edge, inside a VM, is not finished. soon
- Spending limits for a team. soon
- Your own provider behind the router, installed as a package. soon