> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aireserve.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Factory Droid

> Run Factory's Droid CLI through the AI Reserve gateway with one customModels block — personal setup or org-wide enforcement.

<Card title="Connect Factory Droid in one click →" icon="zap" href="https://aireserve.com/connect/droid" horizontal>
  The guided connect page mints your key and generates the `customModels`
  block for exactly the models you pick.
</Card>

Everything below is the manual equivalent.

Droid reads custom models from `~/.factory/settings.json`
([Factory's BYOK reference](https://docs.factory.ai/cli/byok/overview)). Add the gateway
as `customModels` entries with `provider: "generic-chat-completion-api"` — the
gateway's OpenAI chat-completions surface serves every gateway model, streaming and
tool calls included:

```json theme={"dark"}
{
  "customModels": [
    {
      "model": "gpt-5.4-mini",
      "displayName": "AI Reserve GPT-5.4 Mini",
      "baseUrl": "https://api.aireserve.com/v1",
      "apiKey": "${AIRESERVE_API_KEY}",
      "provider": "generic-chat-completion-api"
    },
    {
      "model": "claude-sonnet-4-6",
      "displayName": "AI Reserve Claude Sonnet 4.6",
      "baseUrl": "https://api.aireserve.com/v1",
      "apiKey": "${AIRESERVE_API_KEY}",
      "provider": "generic-chat-completion-api"
    }
  ]
}
```

Export your key (Droid expands `${VAR}` references in `apiKey` at parse time, so
the settings file never holds the secret):

```bash theme={"dark"}
export AIRESERVE_API_KEY="aireserve_api_..."   # your key
droid   # run /model — AI Reserve models appear under "Custom models"
```

Headless runs work the same way — `droid exec -m "custom:gpt-5.4-mini" "..."`
routes through the gateway with no extra setup.

<Note>
  **Claude models can also use Droid's native Anthropic dialect.** Set
  `"provider": "anthropic"` with `"baseUrl": "https://api.aireserve.com"` (host
  root — no `/v1`); Droid then calls the gateway's `/v1/messages` surface, and
  prompt caching works as it does first-party. The
  `generic-chat-completion-api` entries above work for Claude models too, so
  this is optional.
</Note>

## Enterprise rollout

Factory's enterprise plans distribute
[org-managed settings](https://docs.factory.ai/enterprise/hierarchical-settings-and-org-control)
to every Droid seat. Publish the AI Reserve models as org-defined `customModels` and pin
`modelPolicy` so members cannot add models that bypass the gateway:

```json theme={"dark"}
{
  "customModels": [
    {
      "model": "claude-sonnet-4-6",
      "displayName": "AI Reserve Claude Sonnet 4.6",
      "baseUrl": "https://api.aireserve.com/v1",
      "apiKey": "${AIRESERVE_API_KEY}",
      "provider": "generic-chat-completion-api"
    }
  ],
  "modelPolicy": {
    "allowCustomModels": false,
    "allowedBaseUrls": ["https://api.aireserve.com/v1"]
  }
}
```

`allowCustomModels: false` disables personal BYOK while org-defined entries keep
working (org-level keys are locked — projects and users can add to them but never
override them), and `allowedBaseUrls` limits custom-model traffic to the gateway.
Each member exports their own `AIRESERVE_API_KEY`, so usage is metered per person.
