Factory Droid CLI connects to Nbility through BYOK custom models. The current file is ~/.factory/settings.json with camelCase fields; legacy config.json and snake_case names are compatibility-only. See Factory's BYOK guide.
Install
macOS or Linux:
curl -fsSL https://app.factory.ai/cli | sh
Windows PowerShell:
irm https://app.factory.ai/cli/windows | iex
Configure custom models
Set an environment variable first:
export NBILITY_API_KEY="YOUR_API_KEY"
Edit ~/.factory/settings.json:
{
"customModels": [
{
"model": "gpt-5.4",
"displayName": "GPT-5.4 via Nbility",
"baseUrl": "https://api.nbility.ai/v1",
"apiKey": "${NBILITY_API_KEY}",
"provider": "openai",
"maxOutputTokens": 16384
},
{
"model": "claude-sonnet-4-6",
"displayName": "Claude Sonnet 4.6 via Nbility",
"baseUrl": "https://api.nbility.ai/v1",
"apiKey": "${NBILITY_API_KEY}",
"provider": "generic-chat-completion-api",
"maxOutputTokens": 16384
}
]
}
Choose the provider by protocol:
| Provider | API format | Use for |
|---|---|---|
openai | OpenAI Responses | GPT-5/Codex models that require Responses |
generic-chat-completion-api | OpenAI Chat Completions | Most OpenAI-compatible models |
anthropic | Anthropic Messages | Endpoints explicitly using native Claude format |
Do not copy arbitrary context or million-token output limits. maxOutputTokens should match the actual model; use a conservative value when uncertain.
Use and troubleshoot
Start droid, run /model, and select a Custom Model. Use Models as the source of truth for IDs.
- Model missing: confirm the file is
settings.json, the field iscustomModels, and restart Droid. Invalid provider: use one of the current provider values above.401: make sureNBILITY_API_KEYis present in Droid's process environment.404or empty output: ensure the provider type matches the model's protocol.
Custom models are available in Droid CLI only; they do not automatically appear in Factory's web or mobile apps.