Skip to main content
You can use the Together CLI to manage your Together AI resources from your terminal, or using automated systems. Use the Together CLI to deploy endpoints, fine-tune models, manage your GPU clusters, and more.

Install the Together CLI

Requires Python 3.10+.
Run the following command to install the CLI:
# Install
uv tool install together[cli]

# List commands
tg --help
The [cli] extra target includes additional dependencies used by the CLI exclusively. The extra target prevents the Python SDK from being bloated with dependencies it does not use.

Update the CLI

# Upgrade
uv tool upgrade together[cli]

# run
tg --help

Authenticate

The CLI relies on the TOGETHER_API_KEY environment variable being set to your account’s API token to authenticate requests. You can find your API token in your account settings. To create an environment variable in the current shell, run:
Shell
export TOGETHER_API_KEY=xxxxx
You can also add it to your shell’s global configuration so all new sessions can access it. Different shells have different semantics for setting global environment variables, so see your preferred shell’s documentation to learn more.

Use the CLI in a CI/CD Environment

uvx is a helper utility from uv that downloads and runs a Python binary without a separate install step. In a CI/CD environment, invoke the CLI directly with uvx:
uvx together[cli] COMMAND [ARGS]...
To authenticate requests the environment variable is recommended for CI/CD because it avoids exposing the token in command-line arguments, which can be visible in process lists and logs. If both are provided, the —api-key flag takes precedence over the environment variable.

Available Commands

models

View Together models and upload your own.
tg models list
tg models upload
Learn more about the models command.

endpoints

Manage your models on your own custom endpoints for improved reliability at scale.
tg endpoints create
tg endpoints start endpoint-id
tg endpoints stop endpoint-id
tg endpoints hardware --available --model my-uploaded-model
Learn more about the endpoints command.

files

Upload and manage datasets for use in fine-tuning, evals, and batch inference.
tg files check ./dataset.jsonl
tg files upload ./eval-data.jsonl --purpose eval
tg files list
Learn more about the files command.

fine-tuning

Fine tune custom models.
tg fine-tuning create 
tg fine-tuning list-checkpoints
tg fine-tuning download
Learn more about the fine-tuning command.

evals

Manage model evaluation jobs.
tg evals create 
tg evals status [EVAL_ID]
Learn more about the evals command.

clusters (beta)

Reserve, manage, and interact with gpu clusters.
tg beta clusters create
tg beta clusters get-credentials [CLUSTER_ID]
tg beta clusters list-regions
Learn more about the clusters command.

jig (beta)

Build, deploy and manage dedicated containers.
tg beta jig init
tg beta jig deploy
tg beta jig secrets set HF_TOKEN $HF_TOKEN
Learn more about the jig command.

Global parameters

The following parameters are available on every command:
FlagDescription
--helpPrint help docs for the prefixed command.
--jsonForces the command into returning json response. Useful for scripting.
--non-interactiveDisables any prompting and manual input. In CI/Agent runners this is disabled by default.
--api-key [string]Your Together API key. Defaults to reading environment variable TOGETHER_API_KEY.
--timeout [number]Request timeout, defaults to 5 seconds.
--max-retries [number]Maximum number of HTTP retries.
--versionPrint CLI version.
--debugTurns on debug mode to log diagnostic information.