Skip to main content
Together Link is currently in beta. Commands, routing behavior, and the available model list may change. Report issues or give feedback on GitHub.
Together Link connects your existing coding agents and desktop apps to models hosted by Together AI. Launch a tool through Together Link, and it configures the connection for you. By default, sessions use the auto router, which picks a Together AI model for each request and, in Claude sessions with an Anthropic API key, sends the most difficult requests to Claude Opus. When the session ends, your normal configuration is untouched.

Requirements

  • A Together API key.
  • macOS or Linux, with Bash and curl to run the installer. On Linux, installing Bun also requires unzip.
  • The coding agent or desktop app you want to use, already installed. Together Link supports Claude Code, Codex, OpenCode 2, Pi Code 0.80.8 or newer (which requires Node.js 22.19 or newer), Claude Desktop, and ChatGPT Desktop.
  • Optional: an Anthropic API key. In Claude Code and Claude Desktop sessions, 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 Together Link:
The installer also installs Bun if needed, adds the Together Link commands to ~/.local/bin, and opens the interactive launcher when it finishes. If the togetherlink command isn’t found in a new terminal, follow the PATH instructions printed at the end of installation. Open the interactive launcher at any time:
The tlink alias runs the same command. Choose the tool to launch: Claude Code, Codex, OpenCode, Pi Code, Claude Desktop, or ChatGPT Desktop. If no Together API key is configured, the launcher prompts you for one. Arguments after the tool name pass through to the agent. For example, togetherlink claude -p "hello" runs Claude Code in print mode. Every session starts with a banner that names the tool and the route serving it, such as Claude Code › Auto. You can also launch a tool directly:

Configure your API key

Save your Together API key:
Together Link validates the key before saving it. You can also provide the key through your shell environment:
Together Link reads the key from --api-key first, then from its saved configuration, then from the TOGETHER_API_KEY environment variable. It doesn’t read .env files in your project. Configuration optionally asks for an Anthropic API key for auto router sessions in Claude Code and Claude Desktop. Skip it to use Together AI models only.
To override the stored key for a single run, pass --api-key <YOUR_KEY> before the tool name.

How the auto router works

Sessions use the virtual auto model by default. For each request, Together Link’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: In Claude Code and Claude Desktop sessions with an Anthropic API key configured, served by Claude Opus through Anthropic and billed to the Anthropic account behind the key.
Codex, OpenCode, Pi Code, and ChatGPT Desktop sessions always stay on Together AI models, as do Claude sessions without an Anthropic API key.

Choose a model

List available models, context limits, and pricing:
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:
The same flag works for every tool, for example togetherlink --main zai-org/GLM-5.3-Flash opencode.
Always select a model with the full togetherlink command, with the flag before the tool name. Together Link refuses or ignores a --model flag placed after the tool name, because the model aliases in some agents don’t select gateway routes. The tclaude, tcodex, topencode, and tpi shortcuts expand with the tool name first, so they can’t be used to select a model.
Together Link currently offers these models: You can also switch models during a session with your agent’s /model command. In Claude Code, the menu maps Claude’s model tiers to Together AI models: Opus runs Kimi K3, Fable runs GLM 5.3, Sonnet runs GLM 5.3 Flash, and Haiku runs DeepSeek V4.1 Flash. Codex, OpenCode, and Pi Code list the Together AI models by name. 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 for current pricing.

How it works

Together Link configures each tool to connect directly to its hosted gateway, which serves each request from a Together AI model or from Anthropic based on the selected route. No local proxy or daemon runs, and your normal configuration files remain unchanged.
  • Claude Code, Codex, OpenCode, and Pi Code: Receive a temporary, per-launch configuration that is removed when the session ends.
  • Claude Desktop and Cowork: Use a persistent Together Link-owned third-party profile, with backups for reversible setup.
  • ChatGPT Desktop: Uses a dedicated profile at ~/.codex-togetherlink. Together Link reads but never rewrites your normal ~/.codex home.
Desktop profiles store your Together API key locally.

Codex CLI

Launch Codex in your terminal:
Native arguments pass through to Codex:
Together Link passes its gateway settings on the command line for that run only and never rewrites ~/.codex. Codex’s native web search works as usual.

OpenCode

Launch OpenCode in your terminal:
Together Link requires OpenCode 2 and stops with upgrade steps if OpenCode 1 is installed. Each launch runs OpenCode on a private server that exits with the session. Your own MCP servers, skills, plugins, and agents still load. Native arguments pass through to OpenCode:
OpenCode’s web search uses a search integration you connect inside OpenCode, not the gateway’s hosted search.

Pi Code

Launch Pi Code in your terminal:
Together Link registers a Together AI provider for the launch only. Your Pi extensions, including MCP servers, skills, prompt templates, themes, settings, and sessions, load as they do in plain pi. Native arguments pass through to Pi Code:

Claude Desktop and Cowork

Enable the integration:
This configures Claude Desktop, Cowork, and Code to use Together AI models. If Claude is running, Together Link asks before quitting and restarting it. On macOS, Claude Desktop must be installed in /Applications or ~/Applications. On Linux, the claude-desktop command must be on your PATH. Switch back to official Claude while keeping your Together Link profile available:
Remove the Together Link profile and its imported copies:
Reset requires confirmation.

ChatGPT Desktop

Launch ChatGPT Desktop with your Together Link profile:
Native web search is disabled in the Together Link profile. Switch back to your normal profile:
Delete the Together Link profile, including its local tasks and settings:
Reset requires confirmation. Your normal ~/.codex home remains untouched.

Run headless

Together Link works in non-interactive contexts, so scripts and agents can drive a coding agent. Each tool’s own headless flags pass through:
Always append < /dev/null to headless Claude Code runs. A headless process that inherits an open stdin blocks indefinitely waiting for additional input.

Generate images

Claude Code, Claude Desktop, and ChatGPT Desktop sessions launched through Together Link include an image generation skill. Ask for an image, and your agent generates or edits it with image models hosted by Together AI:
Image spend appears in togetherlink usage, tracked separately from token usage.

View usage

Each session prints a cost summary when it exits. In Claude Code, the status line also shows an estimated spend for the session alongside what the same tokens would cost on Claude Opus. To see spend tracked by the cloud gateway across sessions, run:
Together Link periodically checks for updates. You can also update manually:

Troubleshooting

  • togetherlink: command not found: Open a new terminal, or load the startup file the installer updated (source ~/.zshrc for Zsh, source ~/.bashrc for Bash).
  • No API key configured: Run togetherlink configure or export TOGETHER_API_KEY. Keys in a project .env file aren’t read.
  • A coding agent is not installed: Together Link doesn’t install Claude Code, Codex, OpenCode, or Pi Code. Install the tool with the command printed in the error, then retry.
  • OpenCode 1 is installed: Together Link supports only OpenCode 2. Remove OpenCode 1 (for example, npm uninstall -g opencode-ai), then install OpenCode 2 with npm install -g @opencode/cli@latest.
  • Pi Code is too old: Together Link needs Pi Code 0.80.8 or newer. Run pi update self, or reinstall with npm install -g --ignore-scripts @earendil-works/pi-coding-agent. Current Pi Code releases need Node.js 22.19 or newer. On an older Node.js, npm installs the legacy 0.74 release, which Together Link rejects.
  • A headless run hangs: Append < /dev/null to close stdin.
  • Restore your original setup: Stop using togetherlink and launch your tool directly. Together Link never modifies your normal configuration files.

Together Link on GitHub

Report issues and give feedback.

Together AI models

Browse every model hosted on Together AI.