> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# baseten auth

> Manage authentication

Log in, log out, and manage Baseten credentials.

Each set of credentials is stored as a named profile. Select a profile per command with `--profile` or the `BASETEN_PROFILE` environment variable, or set the default with `baseten auth switch`. To require a profile on every command instead of using a current profile, run [`baseten auth config update --require-explicit-profile`](#config). Credentials are stored in the system keyring when available, with a plaintext fallback in the config directory.

## login

```sh theme={"system"}
baseten auth login [OPTIONS]
```

Log in to Baseten through your browser (OAuth device flow) or API key, storing a named profile.

By default, opens a browser for interactive login. Use `--web` to skip prompts (suitable for non-TTY environments). Use `--with-api-key` to provide an API key (reads from stdin, or prompts interactively if TTY).

Browser logins name the profile after your email; API key logins require an explicit `--profile` name. The new profile becomes current unless you pass `--no-switch` or turn on explicit profile selection.

### Options

**--insecure-storage** `BOOL`

Store credentials in plain text instead of system keyring

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--no-switch** `BOOL`

Store the profile without making it the current profile

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Name to store the new profile under. This flag names a new profile; it doesn't select an existing one.

**--remote-url** `TEXT`

Baseten remote URL for this profile (default [https://app.baseten.co](https://app.baseten.co))

**--web** `BOOL`

Use browser login without interactive prompts

**--with-api-key** `BOOL`

Read API key from stdin

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Browser-based login (OAuth device flow)

```sh theme={"system"}
baseten auth login --web
```

Provide an API key on stdin under a named profile

```sh theme={"system"}
echo $API_KEY | baseten auth login --with-api-key --profile <profile>
```

### Filter output with `--jq`

Print just the new profile name

```sh theme={"system"}
baseten auth login --web --jq '.profile'
```

### Output

**Text mode (`--output text`):** Prints "Logged in as `email` (`workspace`) as profile `profile`" to stdout on success.

**JSON mode (`--output json`):** payload type `cmd.AuthLoginResult`.

## logout

```sh theme={"system"}
baseten auth logout [OPTIONS]
```

Remove a stored profile and its credentials. Defaults to the current profile; pass `--profile` to choose another. Logout prompts for a profile in a terminal when explicit profile selection is on. For OAuth credentials, also revokes the session.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Log out the current profile

```sh theme={"system"}
baseten auth logout
```

Log out a specific profile

```sh theme={"system"}
baseten auth logout --profile <profile>
```

### Filter output with `--jq`

Print just the logged-out profile name

```sh theme={"system"}
baseten auth logout --jq '.profile'
```

### Output

**Text mode (`--output text`):** Prints "Logged out `profile`" to stdout on success.

**JSON mode (`--output json`):** payload type `cmd.AuthLogoutResult`.

## switch

```sh theme={"system"}
baseten auth switch [OPTIONS]
```

Set the current profile used when no profile is selected with `--profile` or `BASETEN_PROFILE`. This command isn't available with explicit profile selection on.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Switch to a specific profile non-interactively

```sh theme={"system"}
baseten auth switch --profile <profile>
```

### Filter output with `--jq`

Print just the new current profile

```sh theme={"system"}
baseten auth switch --profile <profile> --jq '.profile'
```

### Output

**Text mode (`--output text`):** Prints "Switched to `profile`" to stdout on success.

**JSON mode (`--output json`):** payload type `cmd.AuthSwitchResult`.

## status

```sh theme={"system"}
baseten auth status [OPTIONS]
```

Show the resolved authentication state, including the profile, remote, and auth type.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Show the current auth status

```sh theme={"system"}
baseten auth status
```

### Filter output with `--jq`

Print just the auth type

```sh theme={"system"}
baseten auth status --jq '.auth_type'
```

### Output

**Text mode (`--output text`):** Summary of the resolved profile: profile name, remote URL, and auth type.

**JSON mode (`--output json`):** payload type `cmd.AuthStatusResult`.

## list

```sh theme={"system"}
baseten auth list [OPTIONS]
```

List stored profiles, marking the one currently in use.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

List all stored profiles

```sh theme={"system"}
baseten auth list
```

### Filter output with `--jq`

Print just the profile names

```sh theme={"system"}
baseten auth list --jq '.profiles[].profile'
```

### Output

**Text mode (`--output text`):** Table with columns: current marker (\*), PROFILE, REMOTE (only when a profile uses a remote other than [https://app.baseten.co](https://app.baseten.co)), AUTH TYPE. When no profiles exist, prints "No profiles found." to stderr.

**JSON mode (`--output json`):** payload type `cmd.AuthListResult`.

## config

### describe

```sh theme={"system"}
baseten auth config describe [OPTIONS]
```

Show auth settings that apply across all profiles.

#### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Show auth settings:

```sh theme={"system"}
baseten auth config describe
```

#### Filter output with `--jq`

Print whether explicit profile selection is on:

```sh theme={"system"}
baseten auth config describe --jq '.require_explicit_profile'
```

#### Output

**Text mode (`--output text`):** Each setting and its value.

**JSON mode (`--output json`):** Returns the auth settings, including `require_explicit_profile`.

### update

```sh theme={"system"}
baseten auth config update [OPTIONS]
```

Update auth settings that apply across all profiles.

With `--require-explicit-profile`, every command must select a profile with `--profile`, `BASETEN_PROFILE`, or `BASETEN_API_KEY`. Without one, the command prompts for a profile in a terminal and fails elsewhere. Turning the setting on clears the current profile.

#### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--require-explicit-profile** `BOOL`

Require every command to select a profile instead of using the current profile

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Require an explicit profile on every command:

```sh theme={"system"}
baseten auth config update --require-explicit-profile
```

Go back to using the current profile:

```sh theme={"system"}
baseten auth config update --require-explicit-profile=false
```

#### Filter output with `--jq`

Print whether explicit profile selection is on:

```sh theme={"system"}
baseten auth config update --require-explicit-profile --jq '.require_explicit_profile'
```

#### Output

**Text mode (`--output text`):** Each setting and its updated value.

**JSON mode (`--output json`):** Returns the updated auth settings, including `require_explicit_profile`.
