---
title: "Handle Send Chat Message"
method: POST
path: "/chat/send-chat-message"
tags: ["public"]
---

# Handle Send Chat Message

`POST /chat/send-chat-message`

This endpoint is used to send a new chat message.

Args:
    chat_message_req (SendMessageRequest): Details about the new chat message.
        - When stream=True (default): Returns StreamingResponse with SSE
        - When stream=False: Returns ChatFullResponse with complete data
    request (Request): The current HTTP request context.
    user (User | None): The current user, obtained via dependency injection.
    _ (None): Rate limit check is run if user/group/global rate limits are enabled.

Returns:
    StreamingResponse | ChatFullResponse: Either streams or returns complete response.

## Request body

- SendMessageRequest
  - `message` string, required
  - `llm_override` LLMOverride
    - `model_provider` string, nullable
    - `model_version` string, nullable
    - `temperature` number, nullable
  - `allowed_tool_ids` integer[], nullable
  - `forced_tool_id` integer, nullable
  - `file_descriptors` FileDescriptor[]
    - `id` string, required
    - `type` 'image' | 'document' | 'plain_text' | 'csv', required
    - `name` string, nullable
    - `user_file_id` string, nullable
  - `internal_search_filters` BaseFilters
    - `source_type` DocumentSource[], nullable
    - `document_set` string[], nullable
    - `time_cutoff` string, date-time, nullable
    - `tags` Tag[], nullable
      - `tag_key` string, required
      - `tag_value` string, required
  - `deep_research` boolean
  - `origin` 'webapp' | 'chrome_extension' | 'api' | 'slackbot' | 'widget' | 'unknown' | 'unset' — Origin of a chat message for telemetry tracking.
  - `parent_message_id` integer, nullable
  - `chat_session_id` string, uuid, nullable
  - `chat_session_info` ChatSessionCreationRequest
    - `persona_id` integer
    - `description` string, nullable
    - `project_id` integer, nullable
  - `stream` boolean
  - `include_citations` boolean
  - `additional_context` string, nullable — A string of extra context injected into the LLM call for this request. The context is passed to the model but is not stored in the database and will not appear in the chat history. Use this to supply ephemeral, request-scoped information (e.g. the user's current page URL, session metadata, or any runtime context) without polluting the persistent conversation history. Pass null or omit the field to use no additional context.

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/onyx-dot-app/apis/agents-api.md) · [All operations](https://skmtc.net/onyx-dot-app/apis/agents-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/onyx-dot-app/agents-api/versions/ea131344b29e/schema)
