> ## 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 regen-codes

Regenerate backup codes for 2FA

## Usage

```bash theme={null}
vastai tfa regen-codes [--code CODE] [--method-type METHOD_TYPE] [--secret SECRET] [--backup-code BACKUP_CODE] [--method-id ID]
```

## Options

<ParamField path="--code" type="string">
  2FA code from Authenticator app, SMS, or Email
</ParamField>

<ParamField path="--method-type" type="string">
  2FA Method type. Only use when you only have one method of this type
  Allowed values: email, sms, totp
</ParamField>

<ParamField path="--secret" type="string">
  Secret token from previous login step (required for SMS or Email 2FA)
</ParamField>

<ParamField path="--backup-code" type="string">
  One-time backup code (alternative to regular 2FA code)
</ParamField>

<ParamField path="--method-id" type="string">
  2FA Method ID if you have more than one of the same type ('id' from `tfa status`)
</ParamField>

## Description

Generate a new set of backup codes for your account.

This action requires 2FA verification to prevent unauthorized regeneration.

WARNING: This will invalidate all existing backup codes!
Any previously generated codes will no longer work.

Backup codes are one-time use codes that allow you to log in
if you lose access to your primary 2FA method (lost phone, etc).

You should regenerate your backup codes if:
• You've used several codes and are running low
• You think your codes may have been compromised
• You lost your saved codes and need new ones

Important: Save the new codes in a secure location immediately!
They will not be shown again.

## Examples

```bash theme={null}
vastai tfa regen-codes --code --method-type totp 123456
 vastai tfa regen-codes -c 123456 -t sms --secret abc123def456
 vastai tfa regen-codes --backup-code ABCD-EFGH-IJKL
```

## 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`) |
