{"uid":"cap_MSKbyk_7ptIX8vufU-p_c","slug":"openverbs-totp-generator-08b4773a","name":"OpenVerbs TOTP Generator","description":"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.","url":"https://otp.openverbs.com/v1/totp","method":"POST","headers":{},"bodySchema":{"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}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","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.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_v9tA-YpLbrG2OFryHVhK7","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates an RFC 6238 time-based one-time password (TOTP) from a base32 secret, returning the code, counter, and seconds remaining in the window.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Automate 2FA login flow","prompt":"I need to log into a service programmatically that requires TOTP two-factor auth — can you generate the current TOTP code using my base32 secret KRUGKIDROVUWG2ZAMJZG653OEBTG66BANJ2W24DTEBXXMZLSEB2GQZJANRQXU6JAMRXWO with SHA1 and a 30-second period?"},{"title":"Backfill OTP for past timestamp","prompt":"Generate an 8-digit TOTP code for the unix timestamp 1700000000 using my base32 secret JBSWY3DPEHPK3PXP and the SHA256 algorithm with a 30-second step — I need to verify what code would have been valid at that moment."},{"title":"Custom period OTP for enterprise system","prompt":"My company's internal system uses a 60-second TOTP window with SHA512 and 6 digits — can you generate the current code using base32 secret MFRA22LENFQWK3TFNVSSA5DIMUQHIZLS?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:41:21.642Z","isFirstParty":false}