{
"$type": "site.standard.document",
"description": "How I use Factory Droid with Claude Max and OpenAI Codex subscriptions through CLIProxyAPI, including OAuth login, custom_models config, and the provider gotcha.",
"path": "/using-factory-droid-with-claude-code-max-subscription/",
"publishedAt": "2025-12-27T03:29:00.000Z",
"site": "at://did:plc:bryys25pc2fnagnyxqgsglhd/site.standard.publication/3mn26bjkkmh23",
"tags": [
"AI",
"Tools"
],
"textContent": "I have been using Factory Droid for the past 2 weeks and I like it. I don't find that it's worse than Claude Code (other than the lack of vi mode) and the startup time is much faster.\n\nHowever, Droid expects API keys for Anthropic, but Claude Code Max subscriptions use OAuth tokens. CLIProxyAPI bridges this gap—it accepts API key requests from Factory and converts them to OAuth-authenticated requests.\n\nThe short answer: run CLIProxyAPI locally, log in to Claude or Codex through it, then point Factory Droid's custom models at http://localhost:8317.\n\nINSTALL CLIPROXYAPI\n\nbrew install go\ngit clone https://github.com/luispater/CLIProxyAPI.git\ncd CLIProxyAPI\ngo build -o cli-proxy-api ./cmd/server\n\nCONFIGURE THE PROXY\n\nCreate config.yaml:\n\nport: 8317\nremote-management:\n allow-remote: false\n secret-key: \"\"\nauth-dir: \"~/.cli-proxy-api\"\ndebug: false\nlogging-to-file: false\nusage-statistics-enabled: true\nproxy-url: \"\"\nrequest-retry: 3\nquota-exceeded:\n switch-project: true\n switch-preview-model: true\nauth:\n providers: []\ngenerative-language-api-key: []\n\nAUTHENTICATE WITH CLAUDE\n\n./cli-proxy-api --claude-login\n\nThis opens your browser for OAuth. Tokens are saved to ~/.cli-proxy-api/claude-{email}.json.\n\nCONFIGURE FACTORY\n\nAdd to ~/.factory/config.json:\n\n{\n \"custom_models\": [\n {\n \"model\": \"claude-opus-4-1-20250805\",\n \"base_url\": \"http://localhost:8317\",\n \"api_key\": \"dummy-not-used\",\n \"provider\": \"anthropic\"\n },\n {\n \"model\": \"claude-sonnet-4-20250514\",\n \"base_url\": \"http://localhost:8317\",\n \"api_key\": \"dummy-not-used\",\n \"provider\": \"anthropic\"\n }\n ]\n}\n\nThe api_key field is required by Factory but ignored by the proxy.\n\nWHY CLIPROXYAPI IS NEEDED\n\nFactory Droid expects an API key and a provider endpoint.\n\nClaude Max and Codex subscriptions don't work that way. They use account login/OAuth, not a normal provider API key you paste into a config file. CLIProxyAPI sits between Droid and the subscription login. Droid thinks it is talking to an Anthropic-style API. The proxy handles the account token.\n\nThat makes the setup useful if you already pay for Claude Max or Codex and want to use those subscriptions from Droid.\n\nRUN\n\nStart the proxy:\n\n./cli-proxy-api --config config.yaml\n\nThen start Factory Droid and select your model with /model.\n\nIf you need to re-authenticate later, run ./cli-proxy-api --claude-login again.\n\nUPDATE: USING OPUS 4.6\n\nUsing Opus 4.6 with Factory Droid is easier than before—no need to update config.json. Just make sure the proxy is up to date and rebuild:\n\ncd CLIProxyAPI\ngit pull\ngo build -o cli-proxy-api ./cmd/server\n\nStart the proxy as before, then use /model in Factory Droid and choose claude-opus-4-6.\n\nUPDATE: USING OPENAI CODEX\n\nCLIProxyAPI also supports OpenAI Codex subscriptions. Same proxy, same setup—it routes to the right provider based on the model name.\n\nAuthenticate with Codex:\n\n./cli-proxy-api --codex-login\n\nTokens are saved to ~/.cli-proxy-api/codex-{email}.json.\n\nAdd to the custom_models array in ~/.factory/config.json:\n\n{\n \"custom_models\": [\n {\n \"model\": \"gpt-5-codex\",\n \"base_url\": \"http://localhost:8317\",\n \"api_key\": \"dummy-not-used\",\n \"provider\": \"anthropic\"\n },\n {\n \"model\": \"gpt-5.4\",\n \"baseUrl\": \"http://localhost:8317\",\n \"apiKey\": \"dummy-not-used\",\n \"displayName\": \"gpt-5.4\",\n \"noImageSupport\": false,\n \"provider\": \"anthropic\"\n }\n ]\n}\n\nFactory writes camelCase keys (baseUrl, apiKey, etc.) when it exports a custom entry. If your export also includes id or index, keep whatever Factory gave you — they only need to be unique per config. Droid accepts both naming styles in the same array.\n\nOne gotcha: set provider to \"anthropic\", not \"openai\". Droid with \"openai\" sends requests to /responses, which the proxy doesn't serve at that path. With \"anthropic\", Droid hits /v1/messages instead, and the proxy routes correctly based on the model name.\n\nBoth Claude and Codex work simultaneously through the same proxy. Just switch models in Droid with /model—no need to restart anything.\n\nWHEN I USE THIS\n\nI use this setup when I want Droid's UI and permission model, but I already have subscription access through Claude Max or Codex. It keeps the billing path simple: Droid talks to one local endpoint, and CLIProxyAPI decides whether the request goes to Claude or Codex based on the model name.\n\nI still keep the proxy local. allow-remote: false is intentional. There is no reason to expose a subscription-backed proxy on the network when Droid and the proxy are running on the same Mac.\n\nThe part I check after every config change is the provider. If a model works in one tool but fails in Droid, I look at the request path first. For this setup I want Droid to send Anthropic-style /v1/messages requests, even for Codex models, because CLIProxyAPI handles the routing behind that endpoint.\n\nCOMMON CHECKS\n\nIf Droid cannot connect, check these first:\n\n * CLIProxyAPI is running on localhost:8317\n * base_url or baseUrl points to http://localhost:8317\n * provider is \"anthropic\"\n * you ran ./cli-proxy-api --claude-login or ./cli-proxy-api --codex-login\n * the model name in Factory matches a model the proxy can route",
"title": "Using Factory Droid with Claude Max & OpenAI Codex Subscriptions",
"updatedAt": "2026-06-04T00:00:00.000Z"
}