# TOTP Code Verifier (otp.openverbs.com)

> TOTP Code Verifier (otp.openverbs.com) 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).

Verifies a submitted TOTP code against a base32 secret with configurable clock-drift tolerance, returning whether the code is valid and the matching time-step offset.

## Facts

- Endpoint: POST https://otp.openverbs.com/v1/verify
- 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/totp-code-verifier-otp-openverbs-com-ce8b63e0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jXuKMtEr6-biereID0usQ

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 totp-code-verifier-otp-openverbs-com-ce8b63e0 -d '<json body>'
```

Example prompt: The user just submitted the 6-digit code 847291 for two-factor authentication — can you verify it against the base32 secret JBSWY3DPEHPK3PXP using SHA1 with a drift window of 1 step?

## When to prefer this

Use this endpoint when you need to verify a user-submitted TOTP code server-side as part of an MFA or 2FA flow, especially when you require configurable clock-drift tolerance, support for non-default algorithms (SHA256, SHA512), custom time-step periods, or need to know the exact step offset where the match occurred. Prefer it over rolling your own TOTP logic or using a general-purpose auth library when you want a stateless, pay-per-call microservice without managing dependencies.

## Known failure modes

- Invalid or non-base32 secret returns an error
- Code field empty or missing triggers a validation error
- Window value out of range (>20) causes a schema rejection
- Malformed request body returns 400-level error
- Secret longer than 1024 characters rejected
- Digits value outside 6-10 range causes validation failure

## How this service works

Verify a submitted TOTP code against a base32 secret, scanning ±window time steps (default ±1) to tolerate clock drift. Returns valid plus the matching step offset (delta). A code that does not match is a successful result with valid=false — not an error.

## Output

Returns a JSON object with a boolean 'valid' field indicating whether the submitted code matched, and an integer 'delta' field indicating the time-step offset (e.g. -1, 0, or 1) at which the match was found. A non-matching code returns valid=false with no error — only genuine processing failures produce errors.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "secret": {
       "type": "string",
       "minLength": 1,
       "maxLength": 1024,
       "description": "Base32-encoded shared secret."
      },
      "code": {
       "type": "string",
       "minLength": 1,
       "maxLength": 12,
       "description": "The submitted OTP code."
      },
      "timestamp": {
       "type": "integer",
       "minimum": 0,
       "description": "Unix time in seconds. Default: now."
      },
      "period": {
       "type": "integer",
       "minimum": 1,
       "maximum": 86400,
       "description": "Time step in seconds. Default 30."
      },
      "digits": {
       "type": "integer",
       "minimum": 6,
       "maximum": 10,
       "description": "Number of code digits. Default 6."
      },
      "algorithm": {
       "type": "string",
       "enum": [
        "SHA1",
        "SHA256",
        "SHA512"
       ],
       "description": "HMAC algorithm. Default SHA1."
      },
      "window": {
       "type": "integer",
       "minimum": 0,
       "maximum": 20,
       "description": "Steps of drift tolerance each side. Default 1."
      },
      "t0": {
       "type": "integer",
       "minimum": 0,
       "description": "Epoch start offset in seconds. Default 0."
      }
     },
     "required": [
      "secret",
      "code"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/totp-code-verifier-otp-openverbs-com-ce8b63e0/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)
