> ## 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_login

Complete 2FA login by verifying code.

## Signature

```python theme={null}
VastAI.tfa_login(
    code: Optional[str] = None,
    method_type: Optional[str] = None,
    secret: Optional[str] = None,
    backup_code: Optional[str] = None,
    method_id: Optional[str] = None
) -> dict
```

## Parameters

<ParamField path="code" type="Optional[str]">
  2FA code from Authenticator app, SMS, or Email
</ParamField>

<ParamField path="method_type" type="Optional[str]">
  2FA Method type. Only use when you only have one method of this type
</ParamField>

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

<ParamField path="backup_code" type="Optional[str]">
  One-time backup code (alternative to regular 2FA code)
</ParamField>

<ParamField path="method_id" type="Optional[str]">
  2FA Method ID if you have more than one of the same type ('id' from `tfa status`)
</ParamField>

## Returns

`dict`

## Example

```python theme={null}
from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.tfa_login()
print(result)
```
