> ## Documentation Index
> Fetch the complete documentation index at: https://vastai-80aa3a82-auto-cli-sdk-preview-pr-398.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# vastai tfa activate

Activate a new 2FA method by verifying the code

## Usage

```bash theme={null}
vastai tfa activate CODE --secret SECRET [--method-type METHOD_TYPE] [--phone-number PHONE_NUMBER] [--label LABEL]
```

## Arguments

<ParamField path="code" type="string" required>
  6-digit verification code from SMS or Authenticator app
</ParamField>

## Options

<ParamField path="--method-type" type="string" default="totp">
  New 2FA Method type to activate
  Allowed values: sms, totp
</ParamField>

<ParamField path="--secret" type="string">
  Secret token from setup process (required)
</ParamField>

<ParamField path="--phone-number" type="string">
  Phone number for SMS method (E.164 format)
</ParamField>

<ParamField path="--label" type="string">
  Label for the new 2FA method
</ParamField>

## Description

Complete the 2FA setup process by verifying your code.

***

NOTE: Prior to running this command, you must authorize your attempt to create a new 2FA method by following the instructions in the `vastai tfa auth-new` command.
This is required to ensure that only you can add new 2FA methods to your account.

***

For TOTP (Authenticator app):

1. Run 'vastai tfa totp-setup' to get the manual key/QR code and secret
2. Enter the manual key or scan the QR code with your Authenticator app
3. Run this command with the 6-digit code from your app and the secret token from step 1

For SMS:

1. Run 'vastai tfa send-sms --phone-number \<PHONE\_NUMBER>' to receive SMS and get secret token
2. Run this command with the code you received via SMS and the phone number it was sent to

If this is your first 2FA method, backup codes will be generated and displayed.
Save these backup codes in a secure location!

## Examples

```bash theme={null}
vastai tfa activate --method-type totp --secret abc123def456 123456
 vastai tfa activate --method-type sms --secret abc123def456 --phone-number +12345678901 123456
 vastai tfa activate --method-type sms --secret abc123def456 --phone-number +12345678901 --label "Work Phone" 123456
```

## Global Options

The following options are available for all commands:

| Option          | Description                                           |
| --------------- | ----------------------------------------------------- |
| `--url URL`     | Server REST API URL                                   |
| `--retry N`     | Retry limit                                           |
| `--raw`         | Output machine-readable JSON                          |
| `--explain`     | Verbose explanation of API calls                      |
| `--api-key KEY` | API key (defaults to `~/.config/vastai/vast_api_key`) |
