AI Integration Architecture (Mobile)
+----------------+ HTTPS/wss +----------------+
| Flutter UI | <----------------> | AI API Layer |
| (Chat, OCR, | (Dio/http) | (LLM, OCR, |
| STT, Image) | | STT, Vision) |
+----------------+ +----------------+
| |
| API Key (secure storage) | Response
v v
+----------------+ Optional +----------------+
| Local Cache | <----------------> | Backend |
| (Hive/SQLite) | (batching) | (auth, log) |
+----------------+ +----------------+
- API keys must never be stored directly in source code
- Use
flutter_secure_storage to store tokens and keys
- Consider cost per request and rate limits