Skip to main content
This page takes you from zero to a streamed answer. It uses curl. Every step works the same way from a mobile client.

Before you start

You need three things:
  • The base URL. Production is https://client-api.lala.ist.
  • A Lala Supabase project. The client signs in against this project.
  • A Supabase access token for a signed-in user. Read Authentication for how to get one.
The token is a normal Supabase access token. Lala does not issue its own tokens, and there is no API key.

1. Check that the service is up

The response is {"ok":true}. This endpoint needs no token.

2. Create the student

The first call for a new user creates the student row. Call it once after every sign-in, before you show the chat screen.
If onboardingComplete is false, show the onboarding screen. Read Profile and onboarding.

3. Write the profile

The response holds the full profile after the update. onboardingComplete becomes true when grade and examType are set, and, for YKS, field too.

4. Stream an answer

The -N flag disables buffering, so you see each event when it arrives. The response is a text/event-stream:
Render the chunk events as they arrive. Replace the rendered text with the text field of the done event when the stream ends. Read Stream a chat answer for the full contract.

5. Read the history back

The endpoint returns the last 60 messages, oldest first. Call it when the chat screen opens, and after a push notification. Read Conversation history.

Next steps

Errors and limits

Status codes, body shapes, and the hard limits.

Push notifications

Lala writes first. Set the OneSignal alias.