Send a tutor turn
API version 2026-10-affable-towhee
Sends one message to the tutor and streams the reply as delta events, ending with done. Nothing is stored: send the recent conversation in history, up to 20 entries. character and situation set the scene. Requires a paid plan.
Scopes tutor:converse
Parameters
Lingara-Versionheaderstringoptional- The API version to answer this request under. Without it, an access token gets the version its client is pinned to, and a request with no token gets the current version. The version still in development is reached only by naming it here. An unknown version answers
400with codeapi_version_unknown.GET /v1/versionslists the versions.
Request body application/json
messagestringrequiredhistoryarray of TurnEntryoptionalroleTurnRolerequiredcontentstringrequired
source_langstringrequiredtarget_langstringrequiredlevelinteger | nulloptionalcharacterstring | nulloptionalsituationstring | nulloptional
Responses
200 The tutor's reply, piece by piece
Stream events text/event-stream
Sends no keepalive comments.
-
deltaTurnDelta -
textstringrequired
-
noticeNotice -
codestringrequiredmessagestringrequired
-
doneDone Ends the stream -
errorStreamError Ends the stream -
Arrives inside the 200 response. The status line has already been sent, so a failure after the stream opens is reported as this event.
codestringrequiredmessagestringrequiredplan_idstring | nulloptional
Errors
402application/json- A metered client's call was refused before it spent anything.
spend_cap_reached: the client or its account has reached its monthly spending limit; raise the limit on the Integrations page.metered_billing_inactive: usage billing is not active for this account; set it up, or update the payment method, on the Integrations page. 410application/json- The API version this request is answered under has been discontinued. Send a supported version in
Lingara-Version, or re-pin the client. 4XXapplication/json- The request was refused.
codesays why, anderrorsays it in words. 503application/json · text/plain- The service is temporarily unavailable; retry after the number of seconds in
Retry-After. During maintenance the body is plain text rather than the error envelope. 5XXapplication/json- The request was refused.
codesays why, anderrorsays it in words.
codestringrequiredWhy the request was refused, as a stable code to branch on: for example
insufficient_scope(403),rate_limited(429) and, for a metered client,spend_cap_reached(402) andmetered_billing_inactive(402).errorstringrequired
Example
Prefer a library? See the Libraries section.
Example stream
event: delta
data: {"text":"两斤荔枝,"}
event: delta
data: {"text":"一共三十块。"}
event: done
data: {}