# OpenVerbs TOTP Generator

> OpenVerbs TOTP Generator is a paid API for AI agents from otp.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Generates an RFC 6238 time-based one-time password (TOTP) from a base32 secret, returning the code, counter, and seconds remaining in the window.

## Facts

- Endpoint: POST https://otp.openverbs.com/v1/totp
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openverbs-totp-generator-08b4773a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MSKbyk_7ptIX8vufU-p_c

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 openverbs-totp-generator-08b4773a -d '<json body>'
```

Example prompt: Generate a 6-digit RFC 6238 TOTP code right now using my base32 secret JBSWY3DPEHPK3PXP with SHA1 and a 30-second window, and tell me how many seconds are left before it expires.

## When to prefer this

Use this endpoint when you need to programmatically generate a TOTP code from a known base32 secret — for example, to automate 2FA login flows, test authenticator integrations, or generate codes for a specific past or future timestamp. Prefer this over the verification endpoint when you need the raw code rather than a pass/fail check, and over HOTP when you need time-based (not counter-based) codes.

## Known failure modes

- Invalid or malformed base32 secret returns a 400 error
- Secret shorter than minimum length or exceeding 1024 characters is rejected
- Unsupported algorithm value (anything other than SHA1, SHA256, SHA512) returns a validation error
- Digits outside the 6-10 range returns a validation error
- Period outside 1-86400 seconds returns a validation error
- Negative or non-integer timestamp is rejected

## How this service works

Generate an RFC 6238 time-based one-time password from a base32 secret. Uses the current time by default, or an explicit unix timestamp (seconds); configurable period (default 30s), digits (default 6) and algorithm (default SHA1). Also returns the counter and seconds remaining in the window.

## Output

Returns the generated TOTP code (numeric string), the current HOTP counter value (derived from the timestamp and period), and the number of seconds remaining in the current time window.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "secret"
     ],
     "properties": {
      "t0": {
       "type": "integer",
       "minimum": 0,
       "description": "Epoch start offset in seconds. Default 0."
      },
      "digits": {
       "type": "integer",
       "maximum": 10,
       "minimum": 6,
       "description": "Number of code digits. Default 6."
      },
      "period": {
       "type": "integer",
       "maximum": 86400,
       "minimum": 1,
       "description": "Time step in seconds. Default 30."
      },
      "secret": {
       "type": "string",
       "maxLength": 1024,
       "minLength": 1,
       "description": "Base32-encoded shared secret."
      },
      "algorithm": {
       "enum": [
        "SHA1",
        "SHA256",
        "SHA512"
       ],
       "type": "string",
       "description": "HMAC algorithm. Default SHA1."
      },
      "timestamp": {
       "type": "integer",
       "minimum": 0,
       "description": "Unix time in seconds. Default: now."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

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