Login
Log in with your browser. If you don’t have a Together AI account yet, you can create one during login.--json or --non-interactive, it can’t ask, so run tg switch after you log in.
Parameters
Switch
Scope the CLI to a different project. Commands you run afterward act in that project.tg login before you switch.
Logout
Remove your stored credentials and end your login sessions.TOGETHER_API_KEY if it’s set.
Credential storage
On macOS and Linux,tg login saves your credentials to ~/.config/together/credentials.json, or to $XDG_CONFIG_HOME/together/credentials.json when XDG_CONFIG_HOME is set. On Windows, it saves them to %APPDATA%\Together\credentials.json.
To keep your credentials in a different file, set the TOGETHER_CREDENTIALS_PATH environment variable to that file’s path.
Credential precedence
The CLI uses the first credential it finds, in this order:- The
--api-keyflag. - Your
tg loginsession. - The
TOGETHER_API_KEYenvironment variable.
TOGETHER_API_KEY. To use an API key instead, pass --api-key or run tg logout.
Only the CLI reads your login credentials. The Python and TypeScript SDKs, and the cURL examples in these docs, authenticate with an API key from TOGETHER_API_KEY.