> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://platform.bctrl.ai/_mcp/server.

# Generate TOTP

> Generate the current TOTP for one authorized Vault login.

Generate the current one-time password for a Vault login secret with a stored
TOTP seed. The seed itself is never returned.

## Generate a code

```ts
const result = await bctrl.tools.call("vault.totp.generate", {
  name: "production/github/login",
});

console.log(result.code);
```

The caller must be authorized to use the secret, and the Space Vault policy
must allow the operation. Do not log the generated code.

## Request parameters

| Parameter | Type              | Required | Description                          |
| --------- | ----------------- | -------- | ------------------------------------ |
| `name`    | `VaultSecretName` | Yes      | Login secret containing a TOTP seed. |

## Response

| Field  | Type     | Always present | Description                |
| ------ | -------- | -------------- | -------------------------- |
| `code` | `string` | Yes            | Current one-time password. |

## Next

* [Get secret metadata](/sdk/tools/vault/vault-secrets-get) — check whether TOTP is configured
* [Read secret value](/sdk/tools/vault/vault-secrets-value) — read an authorized login
* [Spaces](/sdk/spaces) — configure Vault access