Sign in with a wallet
Moth DocsReference
POSThttps://api.runmoth.ai/v1
/auth/verifySigns in with a wallet on Robinhood Chain and returns a session for the account endpoints. Moth Console does this for you.
curl https://api.runmoth.ai/v1/auth/verify \ -H "Content-Type: application/json" \ -d '{ "message": "chat.runmoth.ai wants you to sign in with your Ethereum account:\n0x5aE1…", "signature": "0x8b2f…" }'
Response
{
"token": "ses_…",
"expires_at": "2026-10-31T09:00:00.000Z",
"address": "0x5aE1…c09B",
"account_id": "acct_…"
}- Get a nonceGET/auth/nonce gives a nonce for ten minutes, the domain and chain 4663
- SignThe wallet signs a Sign-In with Ethereum message. No transaction, no gas
- VerifyPOST/auth/verify takes the message and its signature
- Session24 hA ses_ token, sent as Bearer to the account endpoints
domain, uri and chain. A nonce works once, and a new wallet gets a new account.Body
messagerequiredThe signed message, as signed.
signaturerequiredThe wallet's signature, as 0x hex.
Send the ses_ token as Authorization: Bearer to the account endpoints. A session lasts 24 hours, or less when the message says so, and POST /auth/logout ends it early.
Errors
400invalid_request_errorThe message or the signature is missing401authentication_errorThe signature, nonce, domain or chain didn't check out, so get a new nonce and sign again429rate_limit_errorToo many sign-in attempts from this address