Chat

Send a customer message and get the reply

Sends what the customer typed and returns the assistant's reply in the same response. With Accept: text/event-stream the reply streams as Server-Sent Events: delta events with pieces of text, then one done event with the same body as the JSON response (or an error event with a problem+json). The text in done.reply is the reply as stored; display that text. The customer's text is never treated as an instruction to the assistant, and the assistant never shares its instructions or keys. In a chat the assistant cannot book, transfer or send anything: it takes a message, which ends up in the summary. At most 2000 characters per message, 30 turns per conversation (then it closes) and 12 messages per minute per conversation. In live mode, every assistant reply is billed per use, usually about one cent a reply: first from the AI credit in your plan, then from your prepaid balance (the greeting is free; a reply that fails costs nothing). The summary of a conversation is charged the same way when it closes. In test mode the first replies of the day are free, after that they are deducted from the balance of your live project. Send an Idempotency-Key (one per customer message) so a retry returns the same reply instead of a second turn.

post/conversations/{id}/messages

Request

  • Base URL: https://api.hypamoon.com/api/v1
  • URL: https://api.hypamoon.com/api/v1/conversations/{id}/messages
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.hypamoon.com/oauth/authorize, token URL https://api.hypamoon.com/oauth/token, scopes: chat:write)

Path parameters

idstring uuid required

The id of the conversation.

Headers

Idempotency-Keystring

Optional but recommended: 1 to 255 visible ASCII characters without spaces, a new one per customer message. A retry with the same key within 24 hours returns the same reply.

Accept'application/json' | 'text/event-stream'

text/event-stream streams the reply as Server-Sent Events; anything else returns a single JSON response.

Request body

textstring required

What the customer typed, at most 2000 characters. Send it as is; it is never treated as an instruction to the assistant.

Response

The customer's message and the assistant's reply.

Changes

No recorded changes to this operation across all 1 revision of this API.