Skip to main content
POST
/
api
/
chats
/
{chat_id}
/
messages
/
stream
Stream a message
curl --request POST \
  --url https://api.morphic.io/api/chats/{chat_id}/messages/stream \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "role": "<string>",
  "content": "<string>",
  "attachments": {},
  "metadata": {}
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

X-API-Key
string
header
required

API key (sk_xxx) from Developer Settings. No X-Account-ID needed.

Headers

x-account-id
string | null

Path Parameters

chat_id
string<uuid>
required

Body

application/json
role
string
required

Message role: 'user', 'assistant', or 'system'

content
string
required

Message content

Minimum string length: 1
attachments
Attachments · object

File attachments metadata

metadata
Metadata · object

Response

Successful Response