Using Factory Droid with Claude Max & OpenAI Codex Subscriptions
I have been using Factory Droid with Claude Max and OpenAI Codex subscriptions through CLIProxyAPI. It is good. 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.
However, Droid expects API keys for Anthropic, but Claude Code Max subscriptions use OAuth tokens. CLIProxyAPI bridges this gap by accepting API key requests from Factory and converting them to OAuth-authenticated requests.
The short answer: run CLIProxyAPI locally, log in to Claude or Codex through it, then point Factory Droid’s custom models at http://localhost:8317.
Install CLIProxyAPI
brew install go
git clone https://github.com/luispater/CLIProxyAPI.git
cd CLIProxyAPI
go build -o cli-proxy-api ./cmd/server
Configure the Proxy
Create config.yaml:
port: 8317
remote-management:
allow-remote: false
secret-key: ""
auth-dir: "~/.cli-proxy-api"
debug: false
logging-to-file: false
usage-statistics-enabled: true
proxy-url: ""
request-retry: 3
quota-exceeded:
switch-project: true
switch-preview-model: true
auth:
providers: []
generative-language-api-key: []
Authenticate with Claude
./cli-proxy-api --claude-login
This opens your browser for OAuth. Tokens are saved to ~/.cli-proxy-api/claude-{email}.json.
Configure Factory
Add to ~/.factory/config.json:
{
"custom_models": [
{
"model": "claude-opus-4-1-20250805",
"base_url": "http://localhost:8317",
"api_key": "dummy-not-used",
"provider": "anthropic"
},
{
"model": "claude-sonnet-4-20250514",
"base_url": "http://localhost:8317",
"api_key": "dummy-not-used",
"provider": "anthropic"
}
]
}
The api_key field is required by Factory but ignored by the proxy.
Why CLIProxyAPI is needed
Factory Droid expects an API key and a provider endpoint.
Claude 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.
That makes the setup useful if you already pay for Claude Max or Codex and want to use those subscriptions from Droid.
Run
Start the proxy:
./cli-proxy-api --config config.yaml
Then start Factory Droid and select your model with /model.
If you need to re-authenticate later, run ./cli-proxy-api --claude-login again.
Update: Using Opus 4.6
Using 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:
cd CLIProxyAPI
git pull
go build -o cli-proxy-api ./cmd/server
Start the proxy as before, then use /model in Factory Droid and choose claude-opus-4-6.
Update: using OpenAI Codex
CLIProxyAPI also supports OpenAI Codex subscriptions. The same proxy and setup routes to the right provider based on the model name.
Authenticate with Codex:
./cli-proxy-api --codex-login
Tokens are saved to ~/.cli-proxy-api/codex-{email}.json.
Add to the custom_models array in ~/.factory/config.json:
{
"custom_models": [
{
"model": "gpt-5-codex",
"base_url": "http://localhost:8317",
"api_key": "dummy-not-used",
"provider": "anthropic"
},
{
"model": "gpt-5.4",
"baseUrl": "http://localhost:8317",
"apiKey": "dummy-not-used",
"displayName": "gpt-5.4",
"noImageSupport": false,
"provider": "anthropic"
}
]
}
Factory 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.
One 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.
Both Claude and Codex work simultaneously through the same proxy. Just switch models in Droid with /model. No need to restart anything.
When I Use This
I 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.
I still keep the proxy local. I intentionally set allow-remote to false. There is no reason to expose a subscription-backed proxy on the network when Droid and the proxy are running on the same Mac.
The 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.
Common Checks
If Droid cannot connect, check these first:
- CLIProxyAPI is running on
localhost:8317 base_urlorbaseUrlpoints tohttp://localhost:8317provideris"anthropic"- you ran
./cli-proxy-api --claude-loginor./cli-proxy-api --codex-login - the model name in Factory matches a model the proxy can route