{"uid":"cap_D_AYk07NAJPvnGaKhSQgc","slug":"agentstoolshub-totp-generator-4fa9343d","name":"AgentsToolsHub TOTP Generator","description":"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.","url":"https://agentstoolshub.com/api/v1/security/totp-generator?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_pVjeojsNkeY5zgAlFi66T","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"Generate the current TOTP code for my base32 secret JBSWY3DPEHPK3PXP using SHA1, 6 digits, and a 30-second period.","exampleUseCases":[{"title":"Automate 2FA login flow","prompt":"I need to log into a service that requires a TOTP code — my base32 secret is JBSWY3DPEHPK3PXP. Can you generate the current 6-digit SHA1 TOTP code with a 30-second window so I can authenticate?"},{"title":"High-security 8-digit TOTP for enterprise system","prompt":"Generate an 8-digit TOTP code from my base32 secret NB2HI4DTHIXS6Y3PNVSS4Y3PNY using SHA512 and a 60-second period — it's for an enterprise system that requires stronger TOTP settings."},{"title":"Verify TOTP secret is correctly configured","prompt":"I just set up a new authenticator secret MFRGGZDFMZTWQ2LK — can you generate the current 6-digit SHA1 TOTP code with a 30-second period so I can confirm it matches what my authenticator app shows?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T12:38:48.163Z","isFirstParty":false,"canonicalSlug":"agentstoolshub-totp-generator-4fa9343d"}