Skip to main content
POST
/
v1
/
boards
/
{boardId}
/
chats
/
{chatId}
/
messages
curl -X POST "https://api.chatgrid.ai/v1/boards/a1b2c3d4-e5f6-7890-abcd-ef1234567890/chats/b2c3d4e5-f6a7-8901-bcde-f12345678901/messages" \
  -H "Authorization: Bearer cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
  -H "Content-Type: application/json" \
  -d '{"content": "What are the top SaaS marketing channels?", "stream": false}'
{
  "object": "chat_message",
  "data": {
    "id": "e5f6a7b8-c9d0-1234-efab-345678901234",
    "role": "assistant",
    "content": "Here are the top 3 SaaS marketing channels:\n\n1. **Content Marketing & SEO** ...",
    "model": "anthropic/claude-sonnet-4",
    "created_at": "2026-03-15T12:50:05.000Z",
    "metadata": {
      "usage": {
        "prompt_tokens": 245,
        "completion_tokens": 312,
        "total_tokens": 557
      },
      "finish_reason": "stop"
    }
  }
}
boardId
string
required
Board UUID.
chatId
string
required
Chat thread UUID.
content
string
required
The user’s message text. 1-100,000 characters.
stream
boolean
default:false
When true, the response is streamed as Server-Sent Events (SSE).

Streaming

When stream: true, the response is a text/event-stream with three event types:
EventDescription
message.deltaIncremental content fragment: {"content": "..."}
message.completeFull message and token usage after streaming finishes
errorError during streaming: {"code": "stream_error", "message": "..."}
The conversation history (last 50 messages) and thread memory are automatically included in the AI context.
curl -X POST "https://api.chatgrid.ai/v1/boards/a1b2c3d4-e5f6-7890-abcd-ef1234567890/chats/b2c3d4e5-f6a7-8901-bcde-f12345678901/messages" \
  -H "Authorization: Bearer cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
  -H "Content-Type: application/json" \
  -d '{"content": "What are the top SaaS marketing channels?", "stream": false}'
{
  "object": "chat_message",
  "data": {
    "id": "e5f6a7b8-c9d0-1234-efab-345678901234",
    "role": "assistant",
    "content": "Here are the top 3 SaaS marketing channels:\n\n1. **Content Marketing & SEO** ...",
    "model": "anthropic/claude-sonnet-4",
    "created_at": "2026-03-15T12:50:05.000Z",
    "metadata": {
      "usage": {
        "prompt_tokens": 245,
        "completion_tokens": 312,
        "total_tokens": 557
      },
      "finish_reason": "stop"
    }
  }
}