Client variables reference
Reference for the variables and config keys that the console setup guide shows for Claude Code, Codex CLI and Antigravity CLI, with placeholder values.
Last updated
The console setup guide shows the settings that point Claude Code, Codex CLI and Antigravity CLI at memtrunk. This page lists each name, the value, and where the setting goes. The values here are placeholders. Replace <your-memtrunk-address> with the address of your instance. Replace <your-proxy-token> with your proxy token. Replace <your-memtrunk-key> with your memtrunk key.
The clients read these settings. The client documentation defines how each client reads them. For the steps, see connect Claude Code, connect Codex CLI and other clients.
Claude Code#
Variables#
| Name | Value | Purpose |
|---|---|---|
ANTHROPIC_BASE_URL | https://<your-memtrunk-address>/<your-proxy-token> | Your personal address. It is the address of your instance followed by your proxy token as a path. |
ANTHROPIC_AUTH_TOKEN | placeholder | A placeholder. memtrunk ignores its value on your personal address. |
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY | 1 | Asks Claude Code to discover models from the gateway. The setup guide names Claude Code v2.1.129 and later. |
ANTHROPIC_CUSTOM_HEADERS | X-MemTrunk-Project: git:<host>/<path> | Optional. Declares the project by its repository. |
On your personal address the proxy token in the path identifies you. The gateway reads no key header there. The console guide says the model list comes from the memtrunk GET /v1/models route. See the endpoints reference.
With a named API key, use the second form below instead. Set ANTHROPIC_BASE_URL to the address with no path. Set ANTHROPIC_AUTH_TOKEN to the key. The gateway reads the key from the request headers. See authentication headers.
Where to set them#
The setup guide offers these places for the three required variables.
- The
envobject in~/.claude/settings.json. This file applies to your user account. - The
envobject in.claude/settings.local.jsoninside a project. This file applies to that project. The guide adds the file to.gitignore. - Shell exports for one session, or lines in your shell profile.
Do not put your personal address or a key in a settings file that you commit. The guide uses .claude/settings.local.json for this reason.
Personal address form:
{
"env": {
"ANTHROPIC_BASE_URL": "https://<your-memtrunk-address>/<your-proxy-token>",
"ANTHROPIC_AUTH_TOKEN": "placeholder",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"
}
}Named API key form:
{
"env": {
"ANTHROPIC_BASE_URL": "https://<your-memtrunk-address>",
"ANTHROPIC_AUTH_TOKEN": "<your-memtrunk-key>",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"
}
}Project header#
ANTHROPIC_CUSTOM_HEADERS is optional. The value X-MemTrunk-Project: git:<host>/<path> names a project by its repository.
Memtrunk uses a valid value for session capture and memory recall. This needs two conditions. The user opted in to session capture. The request has a session id. Memtrunk ignores a value that is not valid.
export ANTHROPIC_CUSTOM_HEADERS="X-MemTrunk-Project: git:<host>/<path>"Codex CLI#
Variable and config keys#
The personal address form is the first choice. Its base_url holds your personal address followed by /v1. The named key form uses the memtrunk address followed by /v1.
| Name | Value | Where | Purpose |
|---|---|---|---|
MEMTRUNK_API_KEY | placeholder | Environment variable | Personal address form. A placeholder. memtrunk ignores its value on your personal address. |
MEMTRUNK_API_KEY | <your-memtrunk-key> | Environment variable | Named key form. Holds your memtrunk key. |
model_provider | "memtrunk" | Top level of config.toml | Selects the memtrunk provider. |
name | "memtrunk" | [model_providers.memtrunk] | The name of the provider. |
base_url | "https://<your-memtrunk-address>/<your-proxy-token>/v1" | [model_providers.memtrunk] | Personal address form. Your personal address with the /v1 suffix. |
base_url | "https://<your-memtrunk-address>/v1" | [model_providers.memtrunk] | Named key form. The address of the gateway, with the /v1 suffix. |
env_key | "MEMTRUNK_API_KEY" | [model_providers.memtrunk] | The variable that holds the key. |
wire_api | "responses" | [model_providers.memtrunk] | The request format. |
CODEX_HOME | A folder path | Environment variable | Optional. Moves the folder that holds config.toml. |
The config.toml file lives in ~/.codex unless CODEX_HOME names another folder. With wire_api set to responses, Codex CLI sends OpenAI Responses requests. On your personal address, the gateway serves them at POST /<your-proxy-token>/v1/responses. With a named key, it serves them at POST /v1/responses.
Personal address form:
model_provider = "memtrunk"
[model_providers.memtrunk]
name = "memtrunk"
base_url = "https://<your-memtrunk-address>/<your-proxy-token>/v1"
env_key = "MEMTRUNK_API_KEY"
wire_api = "responses"Named API key form:
model_provider = "memtrunk"
[model_providers.memtrunk]
name = "memtrunk"
base_url = "https://<your-memtrunk-address>/v1"
env_key = "MEMTRUNK_API_KEY"
wire_api = "responses"Place model_provider above every [section] line in the file.
export MEMTRUNK_API_KEY="placeholder"For the named key form, set the variable to "<your-memtrunk-key>" instead.
Use memtrunk for one run#
The setup guide also shows a per-run form. It needs the [model_providers.memtrunk] table in config.toml and the MEMTRUNK_API_KEY variable. Skip the top-level model_provider line. Codex CLI then uses memtrunk only for that run. The setup guide did not test this form.
codex -c 'model_provider="memtrunk"'The guide says that Codex CLI ignores provider settings in the .codex/config.toml file of a project. For one project, use the per-run form.
Antigravity CLI#
Antigravity CLI is agy. The guide says agy needs three things. It needs a model provider setting in its settings file, a base URL variable and a non-empty key variable. The guide says agy does not read .env files, so the two variables must come from your environment.
The Antigravity CLI tab of the setup guide shows the exact names, the settings file path and the commands. This page does not repeat them. Copy them from the tab.
Values#
| Setting | Personal address form | Named key form |
|---|---|---|
| Base URL variable | https://<your-memtrunk-address>/<your-proxy-token> | https://<your-memtrunk-address>, with no path |
| Key variable | placeholder. memtrunk ignores its value on your personal address. | <your-memtrunk-key> |
On your personal address, an Antigravity CLI request goes to POST /<your-proxy-token>/v1beta/models/<model>:streamGenerateContent. The gateway also serves the same path with :generateContent. The setup guide offers a one-session setup, a direnv setup for one project on macOS and Linux, and a permanent setup in your shell profile or, on Windows, your user environment variables.
The setup guide says it tested Antigravity CLI 1.5.12 with agy -p against a local test server. It lists these as not tested: a live provider, other versions, the interactive screen, agy models, the direnv project form, a real zsh login shell, and Windows and PowerShell.