Documentation Index
Fetch the complete documentation index at: https://mintlify.com/SmartEatAI/smart-eat-ai/llms.txt
Use this file to discover all available pages before exploring further.
How Authentication Works
SmartEat AI uses JWT (JSON Web Token) based authentication to secure API endpoints. When you register or login, you receive an access token that must be included in subsequent requests to protected endpoints.Authentication Flow
- Register or Login to receive an access token
- Include the token in the
Authorizationheader of your requests - The token is validated on each request to protected endpoints
- Tokens expire after a configured period and must be refreshed
JWT Tokens
JSON Web Tokens (JWT) are used to authenticate users. Each token contains:- Subject (sub): The user’s email address
- Expiration (exp): Token expiration timestamp
- Algorithm: HS256 (HMAC with SHA-256)
Bearer Token Format
All authenticated requests must include the access token in theAuthorization header using the Bearer scheme:
Example Request
Including Tokens in Requests
cURL Example
JavaScript/Fetch Example
Python Example
Token Expiration
Access tokens expire after 3000 minutes (50 hours) by default. When a token expires, you will receive a401 Unauthorized response:
Security Best Practices
- Store tokens securely (e.g., secure HTTP-only cookies, encrypted storage)
- Use HTTPS for all API requests
- Implement token refresh mechanisms in production applications
- Never commit tokens to version control
- Rotate your SECRET_KEY regularly in production
Protected Endpoints
The following endpoints require authentication:/auth/me- Get current user information/profiles/*- All profile management endpoints/plans/*- All meal plan endpoints/daily-menus/*- All daily menu endpoints
