Authenticate with the Sinch API and manage stored credentials.
Authenticate with the Sinch API. With no flags in a terminal, it asks How do you want to log in?: Sinch account (browser, preview), the default, or API key. The browser route opens the Sinch dashboard, where you approve the login. The API key route asks for Key ID, Key Secret and Project ID. Either way the CLI verifies the key by obtaining an OAuth 2.0 access token and stores credentials securely (key secrets in OS keychain, session tokens in local config).
If SINCH_KEY_ID, SINCH_KEY_SECRET and SINCH_PROJECT_ID are all set, login uses them without asking. sinch login is a shortcut for sinch auth login, and sinch logout for sinch auth logout; both take the same options.
That project key pair is all Voice v2 needs — login never asks for anything else. The legacy Voice v1 application key and secret are a separate pair, supplied only where a v1 API still requires them: -a, --app-key on a sinch voice v1 command, the SINCH_APPLICATION_KEY / SINCH_APPLICATION_SECRET environment variables, or sinch secrets for a deployed function's own environment.
After a successful login, the CLI offers to install the Sinch developer skills for AI assistants (Claude Code, Copilot, Cursor). The choices are This project only (.) for the current folder, Globally (all projects) and Skip. The project choice shows only when the current folder has a sinch.json. Skip is remembered (skipSkillsPrompt in ~/.sinch/config.json), so the offer does not come back. With --json, or without a terminal, the CLI never asks. The prompt is also skipped automatically when the skills are already present: a sinch-* directory under ~/.claude/skills/ or ~/.cursor/skills/, or, in a folder with a sinch.json, under its .agents/skills/ or .claude/skills/. So if you re-run sinch auth login and don't see the prompt, the skills are already installed or you picked Skip before, not an error. To install them any time, run sinch skills install. --skills installs them without asking (for the current project when it has a sinch.json, otherwise globally) and --no-skills skips the offer.
When you run login through npx (npx @sinch/cli auth login) and the CLI is not installed globally, it then offers to run npm install -g @sinch/cli so sinch works from any terminal afterwards. --install installs without asking and --no-install skips the offer. With --json neither offer runs.
Syntax
sinch auth login [options]Options
| Option | Description |
|---|---|
-f, --credentials-file <path> | Load credentials from a JSON file instead of prompting |
--browser | Log in through the Sinch dashboard in your browser |
--skills / --no-skills | Install the developer skills without asking, or skip |
--install / --no-install | Under npx: install the CLI globally without asking, or skip |
--json | Output result as JSON |
Without a terminal, or with --json, the command never prompts, so pass --browser or --credentials-file (unless the three SINCH_* variables are set and --json is off). It prints { authenticated, projectId, keyId, storage } and never the key secret. storage is keychain or plaintext. A rejected key prints { error } and exits 101.
Credentials file format
{
"projectId": "your-project-id",
"keyId": "your-key-id",
"keySecret": "your-key-secret"
}All three fields are required. Any other key in the file is ignored — an older file still carrying applicationKey and applicationSecret logs in fine, but that pair is neither read nor stored.
Example
$ sinch auth login
? How do you want to log in? API key
Key ID (from Project > Access Keys): key_live_abcdef
Key Secret: ********
Project ID (from Sinch Dashboard): abc123de-f456-...
Verifying credentials...
Authentication successful!Show the current authentication state: which credentials are stored and whether the OAuth token is valid.
sinch auth status [--json]--json prints { authenticated, projectId, keyId, source, storage, tokenValid }. storage is left out when the credentials come from environment variables. When there are no credentials it prints { "authenticated": false }.
Exit code change. When not authenticated, auth status now exits 101 (AUTH_FAILED), with and without --json. It used to exit 0. Scripts that ran it and ignored the result need to handle the non-zero exit. See the 0.7.0 entry in the changelog.
Remove all stored credentials (keychain secrets and local session tokens). Prompts for confirmation before clearing.
sinch auth logout [-f, --force] [--json]sinch logout runs the same command.
-f, --force skips the prompt. --json prints { "cleared": true } and requires --force; without it the command fails with an error document naming --force and clears nothing.



