Connect an AI agent
Connect Codex, Claude Code, Antigravity or an API key to DiffNode, and understand how usage limits and budgets apply to reviews.
DiffNode does not ship its own AI. Reviews run on an AI integration you connect: a subscription you already have, used through its agent, or an API key billed by the provider. To see your AI integrations, choose AI under the environment in the left panel (it reads, for example, "AI · 2").
Two kinds of integration
| Kind | Integrations | How you pay |
|---|---|---|
| Subscription · through the CLI | Codex, Claude Code, Antigravity | Your existing plan. Usage windows apply, no cost per token. |
| API key · billed per token | OpenAI, Anthropic, Google Gemini, OpenRouter, other providers, Custom endpoint | The provider charges per token. Daily and monthly budgets apply. |
DiffNode never switches to another integration, account or model by itself. If the chosen one cannot run, the review waits or stops with a visible reason.
Review sessions are read-only. The agent can only read and search the pinned code through DiffNode. Its own shell, file writes and web tools stay off, and your MCP servers, hooks, skills and plugins are not used.
Codex
DiffNode uses the Codex CLI installed on your computer and the account it is signed in with. DiffNode never signs in for you and never writes to the CLI's configuration.
-
Install Codex. If it is missing, Add integration → Install Codex… shows the exact install command and runs it only after you confirm.
-
Sign in in a terminal:
codex login -
Choose Refresh status on the Codex card. The card shows the account, plan, usage and models.
To use a second account, sign it in with its own folder, then add it with Add integration → Another Codex account:
CODEX_HOME="/path/to/folder" codex login
Claude Code
DiffNode uses your installed claude CLI and its sign-in. The account must be a Claude subscription. A Claude Code sign-in with an API key or through a third-party cloud shows an error; use an Anthropic API key integration instead.
-
Install Claude Code. If it is missing, Add integration → Install Claude Code… installs it after you confirm.
-
Sign in in a terminal:
claude auth login -
Choose Refresh status on the Claude Code card.
For a second account, use Add integration → Another Claude Code account and sign it in with its own folder:
CLAUDE_CONFIG_DIR="/path/to/folder" claude auth login
The path fields are optional. Left empty, they use the default (~/.codex, ~/.claude). Integrations that use the same folder are the same account and share its usage.
DiffNode can also update Codex and Claude Code when a new version is out. It does this only after you confirm, and never while a review uses the CLI.
Antigravity
Antigravity works differently: DiffNode runs it in its own managed runtime with its own sign-in. Your agy CLI and its Google sign-in are not used or changed.
- Choose Set up Antigravity on its card, or Add integration → Set up Antigravity…. The dialog shows what it downloads. Download runtime downloads and verifies the official runtime.
- Choose Sign in with Google, then Open sign-in page (or copy the URL) and finish signing in in your browser. The browser opens only when you click.
Disconnect… removes only this sign-in. Update Antigravity runtime updates the runtime when you choose it, never during a review.
API keys
An API-key integration sends reviews straight to a provider's API with your key. It runs on this computer only; a remote server has no API integrations.
- Choose Add integration, then OpenAI API…, Anthropic API… or Other API provider….
- Pick the Provider. For Custom endpoint, enter the Base URL of any OpenAI-compatible server.
- Add the key under Credential. Storage can be the OS keychain (recommended), a Key command (for example a password manager) or an Environment variable. DiffNode never picks up keys from your environment by itself.
- Choose Test connection. It only reads the provider's model list (for xAI also the key's team) and costs nothing.
- Check the Models you allow and the default.
- Set a Budget: Daily (US$) and Monthly (US$).
- Choose Save integration.
Automatic reviews of an API-key integration need a verified account: one the provider names when DiffNode reads it. OpenAI, Anthropic and xAI are read for their organization or team, but this is not yet confirmed with live accounts, so an integration may stay unverified; Google Gemini, OpenRouter, other providers and custom endpoints never name the account. Automatic reviews also need both budgets, a known price for the model and a fully known spend for the period. Otherwise the integration runs only manual reviews.
All fields are described in API integration.
Usage limits and budgets
DiffNode checks the account before each review and each group of files.
- Subscriptions have usage windows, for example 5 hours and 7 days. The card shows how much of each window is used and when it resets. Integrations on the same account share it.
- An exhausted window blocks the review. When Codex reports purchased credits, a manual review can offer Run once on credits.
- Automatic reviews need fresh, known usage below your limit. Missing or outdated usage pauses them; a manual run is still possible.
- API keys have no windows. The daily and monthly budgets cap what reviews may spend. A reached budget blocks every review of that account until it resets. Spend is an estimate; your provider's invoice is exact.
Edit limits on a card sets Maximum usage (%), Maximum usage data age (min), the Hourly limit and Daily limit of review starts, and Concurrent sessions. See Integration limits.
Choose models and the default
- Models on a card limits which models projects may use. All models also allows future ones.
- Default AI integration in App settings → AI integrations is preselected when you add a repository. Existing projects keep their own choice.
- A project sets its model and effort in AI defaults, and a pull request can override them.