---
title: "Send a message to the AI copilot (domain-specific)"
method: POST
path: "/copilot/chat"
tags: ["copilot"]
---

# Send a message to the AI copilot (domain-specific)

`POST /copilot/chat`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/copilot/chat`
- Auth: one of:
  - API key in cookie `session`
  - HTTP bearer

## Request body

- CopilotChatRequest
  - `messages` object[], required
    - `role` 'user' | 'assistant' | 'system', required
    - `content` string, required
  - `agentId` string: Domain agent identifier (e.g. vessels, terra, command)
  - `context` object: Additional context passed to the system prompt
  - `stream` boolean: If true, response is streamed as SSE; if false, returned as JSON

## Response `200`

AI response (JSON) or SSE stream when stream=true

- object
  - `content` string

## Other responses

- `400`: Bad Request
- `429`: Rate limit exceeded. Clients should back off until the time indicated by the `Retry-After` header (seconds) or the `X-RateLimit-Reset` header (Unix epoch seconds).

## Changes

- **2026-04-18** `b9a13681671f`: 1 info
  - added the media type `application/json` for the response with the status `429`
- **2026-04-18** `518dcf68679a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/szl-holdings/apis/szl-holdings-dreamstack-api/changes/copilot/chat/post.md)

---

[API](https://skmtc.dev/szl-holdings/apis/szl-holdings-dreamstack-api.md) - [All operations](https://skmtc.dev/szl-holdings/apis/szl-holdings-dreamstack-api/llms.txt) - [OpenAPI document](https://skmtc.dev/szl-holdings/apis/szl-holdings-dreamstack-api/revisions/6ad730b13e59?raw)
