From ad1d33bbb8854200fc873e1cfbfb36bddff8315a Mon Sep 17 00:00:00 2001 From: Luke Inglis Date: Mon, 17 Aug 2026 15:08:53 -0400 Subject: [PATCH] docs: add custom endpoint profile documentation to README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document how config.toml credential profiles can reroute the claude runner to any API-compatible endpoint (e.g. LiteLLM proxy) by setting/unsetting env vars — no new runner class needed. Includes a worked example, override semantics, and protected-vars note. Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/index.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/index.md b/docs/index.md index 3f5cc66ce..64ea697ac 100644 --- a/docs/index.md +++ b/docs/index.md @@ -385,6 +385,28 @@ FACTORY_RUNNER = "bob" BOBSHELL_API_KEY = "..." ``` +### Custom Endpoints via Profiles + +Profiles can do more than switch runners — they can reroute the default `claude` runner to any API-compatible endpoint by setting and unsetting environment variables. This lets you point at a custom model endpoint (e.g. a LiteLLM proxy) without writing a new runner class. + +Example profile for a LiteLLM proxy: + +```toml +[credentials.glm] +ANTHROPIC_BASE_URL = "https://your-litellm-proxy.example.com" +ANTHROPIC_API_KEY = "your-litellm-key" +CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1" + +[credentials.glm.unset] +vars = ["CLAUDE_CODE_USE_VERTEX", "CLAUDE_CODE_USE_BEDROCK"] +``` + +```bash +factory ceo /path/to/project --profile glm +``` + +Profile keys **override** existing shell env vars (the profile is authoritative when you opt in with `--profile`). The `[credentials..unset]` sub-table removes vars that would conflict — here, clearing Vertex/Bedrock flags so the runner hits the proxy instead. For security, system-critical vars (`PATH`, `HOME`, `LD_PRELOAD`, `PYTHONPATH`, etc.) cannot be set or unset via profiles. + Run `factory config show` to see resolved config, or `factory config edit` to open the file. See [Setup Guide](setup.md) for full details. ---