Request
Headers: Authorization: Bearer <key> and Content-Type: application/json.
| Field | Type | |
|---|---|---|
text |
string, required | What to say to Lumi, up to 4,000 characters. |
Other fields are ignored. There is no conversation id, model, language or streaming option.
curl https://ai.avenpa.com/api/v1/chat \
-H "Authorization: Bearer $LUMI_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Put milk and eggs on my to-dos"}'
Response
200 with a JSON object:
| Field | When | |
|---|---|---|
reply |
always | Lumi’s answer as written text. It may contain Markdown. |
mood |
always | The face Lumi has now, such as smile, or "". |
choices |
when Lumi asks the person to pick | 2 to 6 short options, each up to 80 characters. |
busy, id |
still working after about 25 s | Ask for the answer later with the id. See Long jobs. |
wait, id, need |
waiting on the person | They need to approve something, type a password or do a step by hand. See Long jobs. |
{ "reply": "Added milk and eggs to your to-dos.", "mood": "happy" }
Choices
When Lumi asks the person to pick, the answer carries choices:
{
"reply": "Which one should I set?",
"mood": "think",
"choices": ["7:00 AM", "7:30 AM", "8:00 AM"]
}
Send the pick back as the next text: its words ("7:30 AM") or its place ("the second one", "2").
What Lumi can do here
The same as in the Lumi app: answer from what it remembers, add to and read the lists, calendar, memos and alarms, look things up on the web, and start longer tasks. What you send, and Lumi’s answer, appear in the person’s Lumi chat.
Language and time zone
- Language: Lumi answers in the language saved on the account. The request’s
Accept-Languageisn’t read. - Time zone: “tomorrow”, “at 7” and alarms use the zone saved on the account. It is saved when the person opens Lumi on the web, or tells Lumi where they are. An account with no saved zone uses Korea time (UTC+9), so have the person open Lumi once before you rely on times.
One conversation
There are no sessions. Every ask is a message in the account’s one Lumi conversation, next to what the person typed on the web or said to a device. Lumi works on one ask at a time for an account: send the next one after the last answer.