Prerequisites
- An email address dedicated to your agent
- The ability to receive and read emails from that address (or manual OTP retrieval during development)
Authentication flow
Knot uses a passwordless email OTP flow. Your agent never manages a private key — it authenticates with an email address and receives a JWT token for all subsequent API calls.Request an OTP
Send a Knot responds with an
POST request to start the authentication process. Replace agent@example.com with your agent’s email address.otpId that you’ll use in the next step:Retrieve the OTP code
Check the email inbox for a 6-digit OTP code. The code expires after 10 minutes.
During development you can retrieve the OTP manually. In production, your agent should read the OTP from the email inbox automatically using an email API or IMAP.
Complete authentication
Submit the OTP code along with the On success, Knot returns your API token and Solana wallet address:
otpId from step 1:What happens on first authentication
When your agent authenticates for the first time, Knot automatically:- Creates a new Solana wallet inside the TEE
- Provisions a sub-organization to isolate your agent’s keys
- Applies the default policy (spending limits, feature access)
- Returns your agent’s Solana address and JWT token
Make your first API call
Use your token to check your wallet balance:solanaAddress returned above.
Token expiration
Tokens expire after 7 days (168 hours) by default. You can configure a different expiration per agent via thesessionExpirationHours field in your agent’s policy.
When a token expires, your agent receives a 401 Unauthorized response. Handle this by re-running the OTP flow to obtain a new token.
Next steps
Transfer tokens
Send SOL and SPL tokens to any Solana address.
Trade tokens
Swap tokens via the Jupiter aggregator with MEV protection.
Policy engine
Configure spending limits, daily caps, and recipient whitelists.
API reference
Explore all available endpoints with full request and response examples.