Factory Droid CLI
Use RuToken models in Factory's AI software engineering agent Droid through custom models.
Droid is the command-line AI software engineering agent from Factory. It plans, implements, tests and refactors code from your terminal and supports "bring your own key" custom models, which lets it call Claude, GPT and other models through RuToken. Official docs: docs.factory.ai.
Prerequisites
- An API key: open the console, go to API Keys and create a dedicated key (for example, named
Droid). - A free Factory account — Droid asks you to sign in on first launch.
Installation
curl -fsSL https://app.factory.ai/cli | sh
irm https://app.factory.ai/cli/windows | iex
If the installer prints a command to add Droid to your PATH (for example echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.zshrc), run it and open a new terminal.
If PowerShell refuses to run the script, allow local scripts for your user first: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser.
Configuration
Custom models are defined in the Factory config file:
| OS | Path |
|---|---|
| macOS / Linux | ~/.factory/config.json |
| Windows | %USERPROFILE%\.factory\config.json |
Create the file (or merge into it) and list the models you want to use. Each entry picks a protocol through provider:
{
"custom_models": [
{
"model_display_name": "Claude Sonnet 4.5 [ RuToken]",
"model": "claude-sonnet-4-5-20250929",
"base_url": "https://rutoken.ai",
"api_key": "sk-xxxx",
"provider": "anthropic",
"max_tokens": 64000
},
{
"model_display_name": "GPT-5 [ RuToken]",
"model": "gpt-5",
"base_url": "https://rutoken.ai/v1",
"api_key": "sk-xxxx",
"provider": "openai",
"max_tokens": 32000
},
{
"model_display_name": "DeepSeek V3 [ RuToken]",
"model": "deepseek-chat",
"base_url": "https://rutoken.ai/v1",
"api_key": "sk-xxxx",
"provider": "generic-chat-completion-api",
"max_tokens": 8192
}
]
}
provider |
Protocol | base_url |
|---|---|---|
anthropic |
Anthropic Messages (Claude models) | https://rutoken.ai |
openai |
OpenAI Responses (GPT / Codex models) | https://rutoken.ai/v1 |
generic-chat-completion-api |
OpenAI Chat Completions (any other model) | https://rutoken.ai/v1 |
Replace the model values with IDs from the Model Square; model_display_name is only the label shown in Droid.
Recent Droid versions can also read custom models from ~/.factory/settings.json (key customModels). The legacy config.json format above is still supported; follow the official BYOK docs if your version differs.
Verify
cd /path/to/your/project
droid
Sign in to your Factory account if prompted, type /model and select one of the models under Custom models, then send a short prompt such as Reply with "Connection successful". The request should appear in the console under Usage Logs.
Troubleshooting
| Symptom | Fix |
|---|---|
401 / invalid API key |
Check api_key in every entry; the key must be enabled, not expired and have quota left. |
404 / not found |
anthropic entries use https://rutoken.ai without /v1; openai and generic-chat-completion-api entries need https://rutoken.ai/v1. |
| Model not found | model must exactly match an ID from the Model Square, and the key's model limits must allow it. |
| Custom models do not appear | Validate the JSON (no trailing commas), save the file and restart droid. |