# AgentsToolsHub TOTP Generator

> AgentsToolsHub TOTP Generator is a paid API for AI agents from agentstoolshub.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-17).

Generates a current RFC 6238 TOTP two-factor authentication code from a base32 secret, supporting 6/8 digits, 30/60-second periods, and SHA-1/256/512 algorithms.

## Facts

- Endpoint: GET https://agentstoolshub.com/api/v1/security/totp-generator?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentstoolshub-totp-generator-4fa9343d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_D_AYk07NAJPvnGaKhSQgc

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentstoolshub-totp-generator-4fa9343d
```

Example prompt: Generate the current TOTP code for my base32 secret JBSWY3DPEHPK3PXP using SHA1, 6 digits, and a 30-second period.

## When to prefer this

Use this endpoint when an AI agent needs to programmatically generate TOTP 2FA codes as part of an automated login or authentication workflow, without running a local authenticator app. Particularly useful for agents that must authenticate to services protected by RFC 6238 TOTP and need a reliable, stateless, cloud-based code generator supporting multiple algorithms and period lengths.

## Known failure modes

- Invalid or malformed base32 secret returns an error
- Unsupported algorithm, digit count, or period value rejected
- Clock drift on client or server may cause code to be one window off
- Missing required 'secret' query parameter returns a 400-level error
- Payment not included or insufficient USDC results in 402 response

## How this service works

Generate the current TOTP two-factor code (RFC 6238) from a base32 secret — the same codes authenticator apps produce. Supports 6/8 digits, 30/60-second steps and SHA-1/256/512. Deterministic HMAC via Web Crypto; nothing is stored. Use this when an agent needs to rFC 6238 2FA codes from a base32 secret.

## Output

Returns the current numeric TOTP code (6 or 8 digits) valid for the current time window, computed deterministically from the provided base32 secret using HMAC-based one-time password logic per RFC 6238. Nothing is stored server-side.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "secret"
     ],
     "properties": {
      "algo": {
       "enum": [
        "SHA1",
        "SHA256",
        "SHA512"
       ],
       "type": "string",
       "description": "Algorithm"
      },
      "digits": {
       "enum": [
        6,
        8
       ],
       "type": "number",
       "description": "Digits"
      },
      "period": {
       "enum": [
        30,
        60
       ],
       "type": "number",
       "description": "Period (s)"
      },
      "secret": {
       "type": "string",
       "description": "Base32 secret"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentstoolshub-totp-generator-4fa9343d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentstoolshub.com](https://www.zero.xyz/host/agentstoolshub.com/llms.txt)
