Create a message

Create a new message.

Request

POST https://superinterface.ai/api/cloud/messages

Request Body

ParameterTypeRequiredDescription
assistantIdstringYesID of the assistant
publicApiKeystringYesPublic API key
threadIdstringNoID of thread. New thread created if not provided
contentstring or array of ContentPartYesContent of the message
attachmentsarray of AttachmentNoAttachments included in the message
Request body can also include additional parameters which will be added to the thread metadata.

Example request

curl -X POST "https://superinterface.ai/api/cloud/messages" \ -H "Content-Type: application/json" -d '{ "assistantId": "00cfe680-fee5-49b9-b386-6a7097eb8497", "publicApiKey": "40cfe680-fee5-49b9-b386-6a7097eb8497", "threadId": "70cfe680-fee5-49b9-b386-6a7097eb8497", "content": "Hello, how can I help you?", "attachments": [] }'

Response

Response is a stream of newline separated JSON events. Each event has an event field and optional data payload. Typical events include thread.created, thread.message.created, thread.message.delta, and finally done when the run finishes.

Errors

The endpoint may return the following errors:

401 Unauthorized

This error occurs if the API key is invalid or missing.
{ "error": "Unauthorized", "message": "Invalid or missing API key" }