Lesson Player

Ask the assistant and stream its answer back. Both turns are stored once the answer is complete, with the answer's token usage.

Asking is doing the lesson, so it starts the lesson when the learner has not yet (409 beyond the gate, exactly as starting would). 429 once today's questions are used up — decided before anything streams.

post/api/ai/lessons/{lessonId}/messages

Request

  • The document declares no server URL.
  • Auth: API key in cookie JWT and API key in header X-XSRF-TOKEN

Path parameters

lessonIdinteger required

Request body

messagestring required
outputstring nullable required
userCodestring nullable required

Response

The assistant's answer, streamed as plain text while the model produces it.

ogen generates a text/plain string body as an io.Reader the encoder copies straight to the socket, which is what lets tokens reach the learner as they arrive. (bytes would not do: TypeSpec emits it as format: byte for a text content type, and ogen then base64-encodes the stream.) SSE is out of reach — ogen cannot serve it yet (ogen#1742) — and the client does not need it: the AI SDK reads a plain text stream directly.

Changes

    • breaking

      removed the success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the success response with the status

    • info

      endpoint added