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

# Configure Claude Code, Claude Desktop, Codex, and ChatGPT with Together AI models

> Use TogetherLink to run Claude Code, Claude Desktop and Cowork, Codex CLI, and ChatGPT Desktop with models hosted by Together AI.

<Note>
  TogetherLink is currently in beta. Commands, routing behavior, and the
  available model list may change. Report issues or give feedback on
  [GitHub](https://github.com/Nutlope/togetherlink/issues).
</Note>

TogetherLink connects your existing coding tools and desktop apps to models hosted by Together AI. Launch an app through TogetherLink, and it configures the connection for you. By default, sessions use the auto router, which sends straightforward requests to Together AI models and more difficult requests to Claude Opus. When the session ends, your normal configuration is untouched.

## Requirements

* A [Together AI API key](https://api.together.ai/settings/projects/~current/api-keys).
* The coding tool or desktop app you want to use, already installed.
* Bash and curl to run the installer. On Linux, installing Bun also requires unzip.
* macOS for the Claude Desktop and ChatGPT Desktop integrations.
* Optional: an Anthropic API key. The auto router uses it to send difficult requests to Claude Opus, billed to the Anthropic account behind the key. Without one, every request is served by a Together AI model.

## Get started

Install TogetherLink:

```bash theme={null}
curl -fsSL https://link.together.ai/install | bash
```

The installer also installs [Bun](https://bun.sh) if needed. Follow any PATH instructions printed at the end of installation.

Open the interactive launcher:

```bash theme={null}
togetherlink
```

The `tlink` alias runs the same command.

Choose the tool to launch: Claude Code, Claude Desktop, ChatGPT Desktop, or Codex. If no Together API key is configured, the launcher prompts you for one.

Arguments after the tool name pass through to the harness. For example, `togetherlink claude -p "hello"` runs Claude Code in print mode.

Every session starts with a routing banner, such as `togetherlink ▸ Claude Code → Auto router.`, so you can confirm which route is serving the session.

You can also launch an app directly:

| Command                       | Shortcut          | Notes                                        |
| ----------------------------- | ----------------- | -------------------------------------------- |
| `togetherlink claude`         | `tclaude`         | Claude Code                                  |
| `togetherlink claude-desktop` | `tclaude-desktop` | Claude Desktop, Cowork, and Code; macOS beta |
| `togetherlink codex`          | `tcodex`          | Codex CLI                                    |
| `togetherlink chatgpt`        | None              | ChatGPT Desktop; macOS beta                  |

## Configure your API key

Save your Together API key:

```bash theme={null}
togetherlink configure
```

TogetherLink validates the key before saving it.

You can also provide the key through your shell environment:

```bash theme={null}
export TOGETHER_API_KEY="your_together_api_key"
```

Configuration optionally asks for an Anthropic API key for auto router sessions. Skip it to use Together AI models only.

<Tip>
  To override the stored key for a single run, pass `--api-key <YOUR_KEY>` before the tool name.
</Tip>

## How the auto router works

Sessions use the virtual `auto` model by default. For each request, TogetherLink's cloud gateway classifies the prompt and routes it to the model best suited to handle it:

* **Straightforward requests:** Served by Together AI models such as GLM 5.3, billed at standard serverless rates.
* **More difficult requests:** Served by Claude Opus through Anthropic, billed to the Anthropic account behind your `ANTHROPIC_API_KEY`.

Without an Anthropic API key configured, every request is served by a Together AI model.

## Choose a model

List available models, context limits, and pricing:

```bash theme={null}
togetherlink models
```

To pin a session to a single model instead of the auto router, use the full `togetherlink` command and pass `--main` with the model ID before the tool name:

```bash theme={null}
togetherlink --main zai-org/GLM-5.3 claude
```

<Warning>
  Always select a model with the full `togetherlink` command, with the flag
  before the tool name. TogetherLink refuses a `--model` flag placed after the
  tool name, because the model aliases in some harnesses don't select gateway
  routes. The `tclaude` shortcut expands with the tool name first, so it can't
  be used to select a model.
</Warning>

TogetherLink currently offers these models:

| Model               | Model ID                          | Context length | Capabilities                                                          |
| ------------------- | --------------------------------- | -------------- | --------------------------------------------------------------------- |
| Auto (default)      | `auto`                            | 1M             | Vision, reasoning. Routes between Together AI models and Claude Opus. |
| Kimi K3             | `moonshotai/Kimi-K3`              | 1M             | Vision, reasoning.                                                    |
| GLM 5.3             | `zai-org/GLM-5.3`                 | 1M             | Reasoning.                                                            |
| GLM 5.3 Flash       | `zai-org/GLM-5.3-Flash`           | 1M             | Vision, reasoning.                                                    |
| DeepSeek V4.1 Flash | `deepseek-ai/DeepSeek-V4.1-Flash` | 1M             | Vision, reasoning.                                                    |

You can also switch models during a session with your harness's `/model` command. The menu maps the harness's model tiers to Together AI models. In Claude Code, Opus runs Kimi K3, Fable runs GLM 5.3, Sonnet runs GLM 5.3 Flash, and Haiku runs DeepSeek V4.1 Flash.

Desktop apps expose their own model menus, which can differ from the terminal tools.

Usage on Together AI models is billed at standard serverless rates for the model that serves each request. See [serverless models](/docs/serverless/models) for current pricing.

## How it works

TogetherLink configures each app to connect directly to its hosted gateway, which serves each request from a Together AI model or from Anthropic based on the selected route. Your normal configuration files remain unchanged.

* **Claude Code and Codex CLI:** Receive launch-specific configuration for each session.
* **Claude Desktop and Cowork:** Use a persistent TogetherLink-owned third-party profile, with backups for reversible setup.
* **ChatGPT Desktop:** Uses a dedicated profile at `~/.codex-togetherlink`. TogetherLink reads but never rewrites your normal `~/.codex` home.

Desktop profiles store your Together API key locally.

### Claude Desktop and Cowork

Enable the integration:

```bash theme={null}
togetherlink claude-desktop
```

This configures Claude Desktop, Cowork, and Code to use Together AI models. If Claude is running, TogetherLink asks before quitting and restarting it.

Switch back to official Claude while keeping your TogetherLink profile available:

```bash theme={null}
togetherlink claude-desktop off
```

Remove the TogetherLink profile and its imported copies:

```bash theme={null}
togetherlink claude-desktop reset
```

Reset requires confirmation.

### ChatGPT Desktop

Launch ChatGPT Desktop with your TogetherLink profile:

```bash theme={null}
togetherlink chatgpt
```

Native web search is disabled in the TogetherLink profile.

Switch back to your normal profile:

```bash theme={null}
togetherlink chatgpt off
```

Delete the TogetherLink profile, including its local tasks and settings:

```bash theme={null}
togetherlink chatgpt reset
```

Reset requires confirmation. Your normal `~/.codex` home remains untouched.

### Codex CLI

Launch Codex in your terminal:

```bash theme={null}
togetherlink codex
```

Native arguments pass through to Codex:

```bash theme={null}
togetherlink codex exec "Explain this project"
```

## Run headless

TogetherLink works in non-interactive contexts, so scripts and agents can drive a harness. Run it in print mode:

```bash theme={null}
togetherlink claude -p "<TASK>" --output-format json < /dev/null
```

<Warning>
  Always append `< /dev/null` to headless runs. A headless process that inherits an open stdin blocks indefinitely waiting for additional input.
</Warning>

## Generate images

Sessions launched through TogetherLink include an image generation skill. Ask for an image, and your agent generates or edits it with image models hosted by Together AI:

```text theme={null}
> Generate an image of a red circle on a white background and save it to logo.png
```

Image spend appears in `togetherlink usage`, tracked separately from token usage.

## View usage

Each session prints a cost summary when it exits. To see spend tracked by the cloud gateway across sessions, run:

```bash theme={null}
togetherlink usage --last 7d
```

## Update TogetherLink

TogetherLink periodically checks for updates. You can also update manually:

```bash theme={null}
togetherlink update
```

## Troubleshooting

* **No API key configured:** Run `togetherlink configure` or export `TOGETHER_API_KEY`.
* **Claude Code is not installed:** TogetherLink does not install Claude Code. Install it with the command printed in the error, then retry.
* **A headless run hangs:** Append `< /dev/null` to close stdin.
* **Restore your original setup:** Stop using `togetherlink` and launch your tool directly. TogetherLink never modifies your normal configuration files.

## Related resources

<CardGroup cols={2}>
  <Card title="TogetherLink on GitHub" icon="brand-github" href="https://github.com/Nutlope/togetherlink">
    Source code, issues, and release history.
  </Card>

  <Card title="Together AI models" icon="stack-2" href="https://www.together.ai/models">
    Browse every model hosted on Together AI.
  </Card>
</CardGroup>
