Skip to main content
Use this example only when agent signup is enabled. It sends one signup request per run, saves its response in a private local file, and prints only the inbox address. Existing credentials are reused. It does not send email or claim the account for the human. A secrets manager is preferable in deployed agents. This local example uses a private directory and a file readable only by the current user. Keep this file out of repositories and shared folders. Do not enable HTTP request/response logging.
On success, read response.claim_url from the private saved state and give it to your actual operator in your existing chat. The claim link contains a secret; do not print it into general logs or send it by email. The human signs in, verifies their own primary email outside SentFromAI-managed inboxes and confirms the claim. Poll GET /account with the saved API key to check whether sending is enabled. If a request’s outcome is unknown, run the example again within the configured signup replay window (60 minutes by default). It reuses exactly the saved idempotency_key and request, without creating a new identity or rotating the key. Respect Retry-After on 429. After the replay window, it stops: recover the original key or use the claimed console account. The server is authoritative and returns 410 signup_replay_expired once replay has expired, even if the client’s configured window is longer. If a claim link expires while the unclaimed account remains active, authenticated POST /account/claim-link returns a fresh one. Store its response privately. Refreshing the link does not extend the unclaimed account’s lifetime.