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

# Droid

> Route Claude, GPT, and Gemini models through Orq.ai directly from Droid CLI. Mix providers in a single session using a single config file.

[Droid](https://app.factory.ai/) is the Factory.ai CLI. A single `~/.factory/config.json` file lets sessions mix Claude, GPT, Gemini, and any other **AI Gateway**-supported model, all routed through **Orq.ai** for unified tracing, cost tracking, and access controls.

## Prerequisites

* Droid CLI installed
* Active Factory.ai account (free tier, no paid subscription required)
* Active **Orq.ai** account
* [Orq.ai API key](/ai-studio/organization/api-keys)

### Install Droid CLI

<Tabs>
  <Tab title="macOS / Linux" icon="terminal">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl -fsSL https://app.factory.ai/cli | sh
    ```
  </Tab>

  <Tab title="Windows" icon="windows">
    ```powershell theme={"theme":{"light":"github-light","dark":"github-dark"}}
    irm https://app.factory.ai/cli/windows | iex
    ```
  </Tab>
</Tabs>

## Setup

<Steps>
  <Step title="Authenticate with Factory">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    droid login
    ```

    Login is required. The free tier covers BYOK (bring-your-own-key) fully.
  </Step>

  <Step title="Clear conflicting environment variables">
    If `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`, or `ANTHROPIC_API_KEY` are set in your shell, they override `config.json` and requests bypass **Orq.ai**. Unset them before running Droid:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    unset ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL ANTHROPIC_API_KEY
    ```
  </Step>

  <Step title="Edit ~/.factory/config.json">
    Add a `custom_models` array with one entry per model. The example below registers Claude, GPT-5.6 Sol, and Gemini all routed through **Orq.ai**:

    ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      "custom_models": [
        {
          "model_display_name": "Claude Sonnet 5 via Orq",
          "model": "anthropic/claude-sonnet-5",
          "base_url": "https://my.orq.ai/v3/anthropic",
          "api_key": "<ORQ_API_KEY>",
          "provider": "anthropic",
          "max_tokens": 64000
        },
        {
          "model_display_name": "GPT-5.6 Sol via Orq",
          "model": "openai/gpt-5.6-sol",
          "base_url": "https://my.orq.ai/v3/router",
          "api_key": "<ORQ_API_KEY>",
          "provider": "generic-chat-completion-api",
          "max_tokens": 16000
        },
        {
          "model_display_name": "Gemini 3.5 Flash via Orq",
          "model": "google/gemini-3.5-flash",
          "base_url": "https://my.orq.ai/v3/router",
          "api_key": "<ORQ_API_KEY>",
          "provider": "generic-chat-completion-api",
          "max_tokens": 8000
        }
      ]
    }
    ```

    Replace `<ORQ_API_KEY>` with your key from [Workspace Settings → API Keys](https://my.orq.ai/settings/api-keys).
  </Step>

  <Step title="Start Droid and select a model">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    droid
    ```

    Inside the session, use `/model` to switch between registered custom models.
  </Step>
</Steps>

## Configuration Reference

### Provider field

| Value                           | Behavior                                                                                                                                  |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `"anthropic"`                   | Uses the Anthropic SDK, which appends `/v1/messages` to the base URL automatically. Point `base_url` to `https://my.orq.ai/v3/anthropic`. |
| `"generic-chat-completion-api"` | Uses the OpenAI-compatible Chat Completions format. Point `base_url` to `https://my.orq.ai/v3/router`.                                    |
| `"openai"`                      | Hardcoded to `api.openai.com`. Ignores `base_url`. Do not use this value for Orq-routed models.                                           |

### Base URL by provider type

| Provider value                  | Correct `base_url`               |
| ------------------------------- | -------------------------------- |
| `"anthropic"`                   | `https://my.orq.ai/v3/anthropic` |
| `"generic-chat-completion-api"` | `https://my.orq.ai/v3/router`    |

<Tip>
  See the [Anthropic Messages API](/ai-gateway/features/anthropic-messages-api) for endpoint details, authentication, and cache\_control breakpoints.
</Tip>

<Warning>
  Do not use `"provider": "openai"` for **Orq.ai**-routed models. It is hardcoded to `api.openai.com` and ignores `base_url`, so requests bypass **Orq.ai** entirely.
</Warning>

## Skills

**Orq Skills** add pre-built agentic workflows to Droid for the full Build, Evaluate, Optimize lifecycle.

### Installation

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
npx skills add orq-ai/assistant-plugins --agent droid
```

Set an [API key and connect the Orq MCP server](/ai-studio/integrations/code-assistants/orq-skills#prerequisites) first. Skills are then triggered by describing what is needed.

<Card title="Orq Skills" icon="wand-magic-sparkles" href="/ai-studio/integrations/code-assistants/orq-skills">
  The full catalogue of skills and slash commands.
</Card>

<Note>
  Slash commands (`/orq:quickstart`, `/orq:traces`, and others) are only available in Claude Code.
</Note>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Requests going to api.openai.com instead of Orq">
    The `"provider": "openai"` value is hardcoded to `api.openai.com` and ignores `base_url`. Change `provider` to `"generic-chat-completion-api"` for all Orq-routed OpenAI-compatible models.
  </Accordion>

  <Accordion title="Anthropic requests failing or bypassing Orq">
    Check for conflicting environment variables. If `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`, or `ANTHROPIC_API_KEY` are set, they take precedence over `config.json`. Run `unset ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL ANTHROPIC_API_KEY` and restart Droid.
  </Accordion>

  <Accordion title="Droid CLI inaccessible after install">
    Run `droid login` to authenticate with Factory.ai before using any model. Without a valid session the CLI will not start.
  </Accordion>

  <Accordion title="No Traces appearing in Orq.ai">
    Confirm the `api_key` value in `config.json` is a valid **Orq.ai** API key (not an OpenAI or Anthropic key), and that `base_url` points to the correct Orq endpoint for the chosen provider type.
  </Accordion>
</AccordionGroup>

## Verification

Start a **Droid** session, select a registered model with `/model`, and send a prompt. The response appears in the session and the trace appears in [**Orq.ai** Traces](/ai-studio/observability/traces) with the model identifier (e.g. `anthropic/claude-sonnet-5`).
