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

# Droid

> Add Opper as a custom model provider in Factory's coding agent

[Droid](https://factory.ai) is Factory's coding agent for the terminal and IDEs. It supports bring-your-own-key custom models, so any OpenAI-compatible endpoint can serve it — including Opper.

## Setup

Add a `customModels` entry to `~/.factory/settings.json`:

```json theme={null}
{
  "customModels": [
    {
      "model": "anthropic/claude-sonnet-4-6",
      "displayName": "Claude Sonnet 4.6 (Opper)",
      "baseUrl": "https://api.opper.ai/v3/compat",
      "apiKey": "${OPPER_API_KEY}",
      "provider": "generic-chat-completion-api",
      "maxOutputTokens": 16384
    }
  ]
}
```

```bash theme={null}
export OPPER_API_KEY=your-opper-api-key
droid
```

Add one entry per model you want in the picker. `provider` must be `generic-chat-completion-api` for an OpenAI-compatible endpoint.

<Note>
  Factory also reads a legacy snake\_case format (`custom_models`, `base_url`) from `~/.factory/config.json`. Where both exist, `settings.json` wins — use it for new setups.
</Note>

## Choosing a model

Droid lists whatever you put in `customModels`; there is no catalog fetch. Pull the IDs you want from the [model catalog](/capabilities/models) and add an entry each.

## Troubleshooting

<AccordionGroup>
  <Accordion title="The model doesn't appear in Droid">
    Check you edited `~/.factory/settings.json` and not the legacy `config.json`, and that `customModels` is camelCase.
  </Accordion>

  <Accordion title="401 Unauthorized">
    `${OPPER_API_KEY}` is expanded from the environment, so the variable has to be exported in the shell that starts Droid. Opper keys start with `op-`.
  </Accordion>

  <Accordion title="Responses get cut off">
    Raise `maxOutputTokens` for that entry. The value above is a conservative default, not the model's limit.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Model catalog" icon="list" href="/capabilities/models">
    Browse the catalog for model IDs and capabilities.
  </Card>

  <Card title="All integrations" icon="plug" href="/integrations/overview">
    Every app that runs on Opper.
  </Card>
</CardGroup>
