# util.beauty TOTP Code Generator

> util.beauty TOTP Code Generator is a paid API for AI agents from util.beauty, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Generates a time-based one-time password (TOTP) code from a given secret, useful for 2FA workflows in automated or agent-driven scenarios.

## Facts

- Endpoint: POST https://util.beauty/v1/crypto/totp
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/util-beauty-totp-code-generator-ff836441
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_F6xJgWIyI6Eyk_EKYb-Dm

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 util-beauty-totp-code-generator-ff836441 -d '<json body>'
```

Example prompt: Generate the current TOTP code for my authenticator secret JBSWY3DPEHPK3PXP — I need the 6-digit code to log into my account right now.

## When to prefer this

Choose this endpoint when you need programmatic, pay-per-use TOTP code generation without running your own OTP library — especially useful in AI agent workflows, CI/CD pipelines, or serverless environments where installing a crypto dependency is impractical. It supports x402 micropayments (USDC on Base), making it ideal for agents that autonomously manage payments without subscription overhead.

## Known failure modes

- Invalid or malformed TOTP secret causes a 400 error
- Expired or missing payment (x402) results in a 402 Payment Required response
- Unsupported algorithm or digit count in request body returns a validation error
- Network timeout or server error returns a 500 response with no TOTP code
- Insufficient prepaid API key credits results in a payment failure error

## How this service works

Metered web utilities for developers and AI agents: browser screenshot and PDF, crypto, DNS and net tools. Pay per request with x402 (USDC on Base) or prepaid API keys.

## Output

Returns a JSON object with a boolean 'ok' status, the generated TOTP code under 'utility', a unique 'requestId' string for tracking, and a 'chargedCredits' number indicating how many prepaid credits were consumed for this request.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "body": {
     "type": "object",
     "description": "JSON request body (see OpenAPI for the utility schema).",
     "additionalProperties": true
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "example": {
     "type": "object",
     "properties": {
      "ok": {
       "type": "boolean"
      },
      "utility": {
       "type": "string"
      },
      "requestId": {
       "type": "string"
      },
      "chargedCredits": {
       "type": "number"
      }
     },
     "additionalProperties": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "utility": "…",
  "requestId": "req_…",
  "chargedCredits": 1
 }
}
```

## More

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