cURL
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>" } ] }
Stream an AI-generated response using Server-Sent Events.
API key (sk_xxx) from Developer Settings. No X-Account-ID needed.
Message role: 'user', 'assistant', or 'system'
Message content
1
File attachments metadata
Successful Response