Skip to main content

Overview

All cluster management operations are available through multiple interfaces for programmatic control and automation:
  • Together CLI: Command-line tool for cluster operations.
  • REST API: Full HTTP API for custom integrations. See the GPU Clusters API reference.
  • SkyPilot: Orchestrate AI workloads across clusters.

Together CLI

The Together CLI provides a command-line interface for managing clusters, storage, and scaling. It’s included with the Together Python SDK.

Installation

Authentication

The CLI authenticates with the TOGETHER_API_KEY environment variable. You can find your API token in your account settings:

Common commands

Create a cluster:
Specify billing type (reserved vs on-demand):
Delete a cluster:
List clusters:
Scale a cluster:
Download cluster credentials (kubeconfig):
Run tg beta clusters create with no flags to launch an interactive prompt that walks through the required fields. See the clusters CLI reference for the full command and flag list.

SkyPilot Integration

Orchestrate AI workloads on GPU Clusters using SkyPilot for simplified cluster management and job scheduling.

Installation

Setup

  1. Launch a Kubernetes cluster via Together Cloud
  2. Configure kubeconfig:
Download the cluster credentials with the Together CLI. This merges the cluster context into your local ~/.kube/config:
  1. Verify SkyPilot access:
Expected output:
  1. Check available GPUs:

Example: Launch a Workload

Create a SkyPilot task file (task.yaml):
Launch the task:

Example: Fine-tune GPT OSS

Download the gpt-oss-20b.yaml configuration. Launch fine-tuning:

Benefits

  • Simplified orchestration – Abstract away Kubernetes complexity.
  • Multi-cloud support – Same workflow across different clouds.
  • Cost optimization – Auto-select cheapest available resources.
  • Job management – Easy monitoring and cancellation.

Automation Patterns

CI/CD Integration

GitHub Actions example:

Scheduled Jobs

Cron-based cluster creation:

Auto-scaling Scripts

Scale a cluster up or down based on demand with the Together CLI:

Best Practices

API usage

  • Use environment variables for API keys (never hardcode).
  • Implement retry logic for transient failures.
  • Check cluster status before submitting jobs.
  • Clean up resources after completion.

CLI usage

  • Set TOGETHER_API_KEY in your environment so commands authenticate automatically.
  • Use cluster IDs for cluster references (more reliable than names).
  • Pass --non-interactive (or --json) to skip prompts in scripts and CI.
  • Script common operations for team consistency.

Troubleshooting

Authentication issues

  • Verify your API key is set: echo $TOGETHER_API_KEY
  • Confirm the key is valid in your account settings

API rate limits

  • Implement exponential backoff
  • Batch operations when possible
  • Contact support for higher limits

What’s Next?