# Inference setup

import { Steps, Aside } from "@astrojs/starlight/components"

Ren inference connects local coding tools to your organization's Claude and ChatGPT subscriptions. Setup requires a
connected provider, an inference key, and the Ren CLI.

## Connect a provider

An organization admin connects the subscriptions Ren routes requests through.

<Steps>

1. Open **Settings → Providers** and select **Connect**.
2. Choose **Claude** or **ChatGPT**. Follow the provider-specific authorization steps below.
3. **Claude:** Authorize access in the new tab. Paste the complete authorization code into Ren, including `#`.

   **ChatGPT:** First enable **Enable device code authorization for Codex** in ChatGPT's security settings. Enter the
   one-time code Ren displays.

</Steps>

The subscription appears on the Providers page once it is connected.

## Create an inference key

<Steps>

1. Open **Settings → Access keys** and select the **Inference keys** tab.
2. Select **Create key** and name it after the machine or tool that will use it.
3. Copy the key before closing the dialog. Ren shows it only once.

</Steps>

Keep the key out of repositories. If it is exposed, revoke it on the same page and create another.

## Install the CLI

The installer needs Node.js 18 or later.

```bash
curl -fsSL https://useren.ai/install | bash
```

See [CLI installation](/docs/surfaces/cli/#install) for other options.

## Set up your coding tool

Install your coding tool. Run its setup command below. Setup requests your inference key, previews changes, and creates
a backup of each affected file.

### Claude Code

```bash
ren inference setup claude-code
```

Setup writes Ren models to `~/.claude/settings.json`. Send a test request with `claude -p 'which model are you?'`.

### Codex

```bash
ren inference setup codex
```

Setup adds a `ren` profile under `~/.codex/`. Start Ren inference with `codex --profile ren`. Plain `codex` continues
using your OpenAI account.

### OpenCode

```bash
ren inference setup opencode
```

Setup adds a Ren provider to `~/.config/opencode/opencode.jsonc`. Use `/models` to see Ren models.

### Pi

```bash
ren inference setup pi
```

Setup adds a `ren` provider to `~/.pi/agent/models.json`. Start Pi with `pi --provider ren`.

### Hermes

```bash
ren inference setup hermes
```

Setup writes `~/.hermes/config.yaml` and `~/.hermes/.env`. Send a test request with `hermes -z 'hello'`.

<Aside>
  Add `--dry-run` to preview changes without writing files. Run `ren inference setup --undo` to restore files from the
  latest setup. Repeat setup after connecting another provider to refresh the model list.
</Aside>