channelstringRequired- Where the interaction is happening: email, chat, ticket, voice or custom. It sets the length and formatting budget, so the same thread returns a three-line chat reply or a structured email.
context.threadarray of message objectsRequired- The conversation so far, oldest first. Each message takes a role of customer, agent or system, the text itself and an optional sent_at timestamp. Send the whole thread rather than the last message, since intent usually lives in what came before.
context.customerobjectOptional- Who you are talking to. Any of id, plan, segment, locale, lifetime value or signup date. Nothing here is mandatory, and every field you add sharpens the intent prediction.
context.account_factsobjectOptional- Free-form key and value pairs that are true about this account right now: an open invoice, a failed payment, seats in use, a shipment that is late. Humoniq treats these as ground truth and will not contradict them.
draftstringOptional- An agent draft to work from. Include it and the reply comes back as an augmented version of what your person wrote, holding their intent and fixing the gaps. Leave it out and the response is generated from scratch.
localestringOptional- Force an output language as a BCP 47 tag such as fr-CA. Defaults to auto, which detects the customer language from the thread and answers in it.
optimize_forarray of stringsOptional- Which of style, accuracy and solution to weight hardest when several drafts score closely. All three are always evaluated. Defaults to a balance of the three.
returnarray of stringsOptional- What you want back: response, next_actions, intent or scores. Defaults to response and intent. Ask only for what you use, since next_actions costs a little more latency.