Token Authentication

PropertyValue
Endpointgenerate_ai_token (Supabase edge function)
MethodPOST with user JWT
Token Lifetime10 minutes (600 seconds)
Refresh Threshold3 minutes remaining
StorageIn memory only (not persisted)

Credit System

Weekly CreditsReset periodically via weekly_reset_date
Bank CreditsPurchased credits, never expire
Deduction OrderWeekly first, then bank
Usage Trackingai_usage_in_seconds rounded up

Source: user_profile.jsonai_usage object

8 Data Payloads

Each voice chat request sends 8 multipart form data fields to worker1.ipnoelp.com:

1
audio_file
WAV 44.1kHz, max 2 min
2
course_progress
Audio usage per track
3
journal_responses
Workbook entries
4
user_context
Course + user name
5
conversation
Prior conversation JSON
6
voice
Preferred AI voice
7
session_id
UUID v4 per request
8
timestamp
ISO8601 timestamp
PropertyValue
AuthorizationBearer [AI Token] (not user JWT)
Content-Typemultipart/form-data
Timeout240 seconds (4 minutes)

Process Flow (15 Steps)

Pre-Recording

1Check internet connectivity
2Check available credits
3Validate AI token
4Check microphone permission

Recording

5Start recording WAV 44.1kHz
6User stops or 2 min max

Processing

7Save audio file
8Collect all 8 payloads
9POST to voice-chat endpoint
10Rotate status text every 7s

Response

11Receive audio_url + credits + conversation
12Update credits, save conversation
13Download AI response audio
14Play response via just_audio
15Mark as replayable, return to idle

UI States

idle
"Press record button" • Mic glows • Replay link if available
recording
"Listening..." • Timer MM:SS • Stop icon
processing
"Sending..." then rotating words • Loading dots
playback
"Replying..." • Waveform animation

Recording Modes

ModeActivationBehavior
Tap (Default)Tap mic buttonTap again to stop and send. Max 2 min.
HoldPress and hold 500ms+Release to stop and send immediately.

File Storage

PurposePath
Recording (temp)[temp]/voice_recording_[timestamp].wav
AI ResponseAppData/AI_Voice_Responses/response_[timestamp].wav
ConversationAppData/JSONs/Conversations/[CourseCode]_conversation.json
Audio UsageAppData/JSONs/User_Audio_Usage/[CourseCode]_Usage.json
JournalAppData/JSONs/User_Workbook_Responses/[CourseCode]1_response.json
User ProfileAppData/JSONs/user_profile.json
Token & Credits → Data Payloads → Process Flow → Response Handling →