Connect your AI tools

Point Claude Code, Cursor, Windsurf, Aider, the OpenAI SDKs and other AI tools at your personal access URL: one setting each, with undo steps.

Updated 12 July 2026

This guide is for the people being metered: your organisation uses EngLedger to meter AI usage and cost, and connecting means routing your AI tools through your personal access URL. It's one configuration change per tool. You keep your own API keys and work exactly as before. Your access URL was included in the email that linked you here; use it wherever you see YOUR_ACCESS_URL below.

Jump to your tool: Claude Code · Cursor · Windsurf · Continue · Cline / Roo Code · Zed · Aider · Codex CLI · OpenAI SDK - Python · OpenAI SDK - Node · anything else

Claude Code

Add ANTHROPIC_BASE_URL to the env block in your user-level settings file. Create the file if it doesn't exist:

PlatformPath
Linux / macOS~/.claude/settings.json
Windows%USERPROFILE%\.claude\settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "YOUR_ACCESS_URL"
  }
}

If settings.json already has an "env" key, add ANTHROPIC_BASE_URL inside it.

Undo: remove the "ANTHROPIC_BASE_URL" line from the env block and save. Claude Code reverts to the default Anthropic endpoint.

Cursor

  1. Open Cursor settings (Ctrl+, / Cmd+,)
  2. Navigate to Cursor Settings → Models
  3. Enter your access URL in the OpenAI API Base URL field
  4. Save and restart Cursor

The settings UI evolves frequently. If the above doesn't match, look for any field labelled "base URL" or "API endpoint" under Models or AI settings.

Undo: return to the same field and clear the value.

Windsurf

  1. Open Windsurf and click the Cascade panel
  2. Click the model picker at the top of the chat
  3. Select Add custom model… or navigate to Settings → AI Providers
  4. Choose OpenAI-compatible as the provider type
  5. Enter your access URL as the base URL

Undo: delete the custom provider entry. Windsurf reverts to its default model list.

Continue

Config lives in a single JSON file, also reachable from the Continue sidebar → gear icon → Open config.json:

PlatformPath
Linux / macOS~/.continue/config.json
Windows%USERPROFILE%\.continue\config.json

Add or update a model entry with apiBase:

{
  "models": [
    {
      "title": "EngLedger",
      "provider": "openai",
      "model": "gpt-4o",
      "apiBase": "YOUR_ACCESS_URL",
      "apiKey": "YOUR_API_KEY"
    }
  ]
}

Continue reloads config automatically on save, no restart needed.

Undo: remove the apiBase line, or delete the entry and restore your original provider.

Cline / Roo Code

Both share the same configuration approach:

  1. Open the Cline or Roo Code panel in VS Code
  2. Click the settings / gear icon
  3. Set API Provider to OpenAI Compatible
  4. Enter your access URL in the Base URL field
  5. Enter your API key and save

Undo: change API Provider back to your original provider (e.g. Anthropic, OpenAI), which clears the custom base URL field.

Zed

Open ~/.config/zed/settings.json and add or update the assistant block:

{
  "assistant": {
    "version": "2",
    "default_model": {
      "provider": "openai",
      "model": "gpt-4o"
    },
    "openai_api_url": "YOUR_ACCESS_URL"
  }
}

Zed picks up the change on save.

Undo: remove the openai_api_url line. Zed reverts to https://api.openai.com/v1.

Aider

Environment variable (recommended), Linux / macOS, add to ~/.bashrc or ~/.zshrc and reload with source ~/.bashrc:

export OPENAI_BASE_URL=YOUR_ACCESS_URL

Windows (PowerShell), add to $PROFILE:

$env:OPENAI_BASE_URL = "YOUR_ACCESS_URL"

Or as a one-off CLI flag:

aider --openai-api-base YOUR_ACCESS_URL

Undo:

unset OPENAI_BASE_URL                   # Linux / macOS
Remove-Item Env:OPENAI_BASE_URL         # Windows PowerShell

Codex CLI

Two things need configuring: the base URL, and API-key auth so Codex doesn't prompt for a browser login.

Step 1: set the base URL. Add openai_base_url to your Codex config file (create it if it doesn't exist):

PlatformPath
Linux / macOS~/.codex/config.toml
Windows%USERPROFILE%\.codex\config.toml
openai_base_url = "YOUR_ACCESS_URL"

Step 2: configure API-key auth. Create or edit ~/.codex/auth.json and set auth_mode to apikey along with your key:

{
  "auth_mode": "apikey",
  "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
}

Replace YOUR_OPENAI_API_KEY with your OpenAI API key from platform.openai.com/api-keys. If the file already exists, merge these fields in rather than replacing it.

Undo: remove the openai_base_url line from ~/.codex/config.toml. To revert auth, delete ~/.codex/auth.json (or remove the fields you added) and run codex login.

OpenAI SDK (Python)

Also covers frameworks built on it (LangChain, LlamaIndex, etc.):

from openai import OpenAI

client = OpenAI(
    base_url="YOUR_ACCESS_URL/v1",
    api_key="YOUR_API_KEY",
)

Undo: remove base_url. The client defaults to https://api.openai.com/v1.

OpenAI SDK (Node / TypeScript)

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "YOUR_ACCESS_URL/v1",
  apiKey: process.env.OPENAI_API_KEY,
});

Undo: remove baseURL.

Anything else: the environment variable

Most OpenAI-compatible tools respect OPENAI_BASE_URL automatically. Setting it once covers them without any other config change.

Linux / macOS (add to ~/.bashrc or ~/.zshrc for persistence):

export OPENAI_BASE_URL=YOUR_ACCESS_URL

Windows PowerShell (add to $PROFILE for persistence):

$env:OPENAI_BASE_URL = "YOUR_ACCESS_URL"

Undo:

unset OPENAI_BASE_URL                   # Linux / macOS
Remove-Item Env:OPENAI_BASE_URL         # Windows PowerShell

Lost your access URL?

Ask your EngLedger admin to resend your setup email. It's the Send setup instructions action on your profile. If your URL was rotated, the old one stops working immediately; update your tools with the new one. What happens on the other side of the URL (what's metered and what appears in reports) is covered in set up AI usage metering and AI spend attribution; the pillar overview is on the AI Spend page.