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

# Connect Agent Providers

> Authenticate Codex, Claude Code, Cursor, and OpenCode so the agent can run under your provider account.

Every agent runs under your own provider account, so you must connect a provider before running a task with it — including the default agent, Codex. Each provider has its own connect flow — a device OAuth, an API key, a setup token, or an uploaded auth file. Connections live at the account level and apply to every project.

Connect from the web app under **Settings → Connections**, or with the CLI. Each provider's CLI commands share the same shape: `connect`, `status`, and a disconnect command.

## Codex

Codex supports two methods: a ChatGPT-subscription device login, or an API key.

<Tabs>
  <Tab title="Web">
    In **Settings → Connections**, choose **Codex** and either start the device login or paste an API key.
  </Tab>

  <Tab title="CLI">
    Connect with your ChatGPT subscription using the device flow. The command prints a verification URL and a code, opens your browser, and polls until you authorize:

    ```bash theme={null}
    aether codex connect
    ```

    Or store an API key instead (prompted if you omit `--api-key`):

    ```bash theme={null}
    aether codex api-key --api-key sk-...
    ```

    Check or remove the connection:

    ```bash theme={null}
    aether codex status
    aether codex logout
    ```
  </Tab>
</Tabs>

The device flow stores subscription tokens that Aether refreshes as needed. The underlying endpoints are `POST /codex/device-auth/start`, `POST /codex/device-auth/poll`, `PUT /codex/auth/api-key`, and `GET`/`DELETE /codex/auth` — see the [Codex auth API](/api-reference/account/codex-auth/get-codex-auth).

## Claude Code

Claude Code authenticates with a setup token generated by the Claude CLI.

<Tabs>
  <Tab title="Web">
    In **Settings → Connections**, choose **Claude Code** and paste the setup token printed by `claude setup-token`.
  </Tab>

  <Tab title="CLI">
    `aether claude-code connect` runs `claude setup-token` for you, captures the resulting token, and stores it:

    ```bash theme={null}
    aether claude-code connect
    ```

    This requires the Claude Code CLI. If it's missing, install it with `npm install -g @anthropic-ai/claude-code` and rerun the command.

    Check or remove the connection:

    ```bash theme={null}
    aether claude-code status
    aether claude-code disconnect
    ```
  </Tab>
</Tabs>

The token is sent to `PUT /claude-code/auth/setup-token` — see the [Claude Code auth API](/api-reference/account/claude-code-auth/get-claude-code-auth).

## Cursor

Cursor imports the OAuth subscription tokens written by your local Cursor login (`cursor-agent login`).

<Tabs>
  <Tab title="Web">
    In **Settings → Connections**, choose **Cursor** and provide your Cursor subscription tokens.
  </Tab>

  <Tab title="CLI">
    Log in locally with `cursor-agent login` first, then import the tokens:

    ```bash theme={null}
    aether cursor connect
    ```

    On macOS this reads the access and refresh tokens from the login keychain (`cursor-access-token` / `cursor-refresh-token`). On Linux it reads `${XDG_CONFIG_HOME:-~/.config}/cursor/auth.json`.

    Check or remove the connection:

    ```bash theme={null}
    aether cursor status
    aether cursor disconnect
    ```
  </Tab>
</Tabs>

Aether stores both tokens and rotates them as Cursor refreshes them. The import posts to `PUT /cursor/auth/subscription` — see the [Cursor auth API](/api-reference/account/cursor-auth/get-cursor-auth).

## OpenCode

OpenCode authenticates with the `auth.json` file written by your local OpenCode login (`opencode auth login`). The file is uploaded verbatim and materialized into each task's config directory at session start.

<Tabs>
  <Tab title="Web">
    In **Settings → Connections**, choose **OpenCode** and upload your `auth.json`.
  </Tab>

  <Tab title="CLI">
    Log in locally with `opencode auth login` first, then upload the file:

    ```bash theme={null}
    aether opencode connect
    ```

    This reads `${XDG_DATA_HOME:-~/.local/share}/opencode/auth.json`.

    Check or remove the connection:

    ```bash theme={null}
    aether opencode status
    aether opencode disconnect
    ```
  </Tab>
</Tabs>

The file is sent to `PUT /opencode/auth/file` — see the [OpenCode auth API](/api-reference/account/opencode-auth/get-opencode-auth).

<Note>
  OpenCode models routed through OpenRouter can additionally use your own OpenRouter API key (`aether apikey add --provider openrouter`). See [Agents and models](/guides/agents-and-models#openrouter-byok-for-opencode).
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="Agents and Models" icon="robot" href="/guides/agents-and-models">
    Pick the agent, model, and reasoning effort per task.
  </Card>

  <Card title="Tasks" icon="list-check" href="/guides/tasks">
    Run a task with your connected provider.
  </Card>
</CardGroup>
