POST
/
chat
/
send-message
Handle New Chat Message
curl --request POST \
  --url https://cloud.onyx.app/api/chat/send-message \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "chunks_above": 123,
  "chunks_below": 123,
  "full_doc": false,
  "chat_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "parent_message_id": 123,
  "message": "<string>",
  "file_descriptors": [
    {
      "id": "<string>",
      "type": "image",
      "name": "<string>"
    }
  ],
  "user_file_ids": [],
  "user_folder_ids": [],
  "prompt_id": 123,
  "search_doc_ids": [
    123
  ],
  "retrieval_options": {
    "chunks_above": 123,
    "chunks_below": 123,
    "full_doc": false,
    "run_search": "always",
    "real_time": true,
    "filters": {
      "source_type": [
        "ingestion_api"
      ],
      "document_set": [
        "<string>"
      ],
      "time_cutoff": "2023-11-07T05:31:56Z",
      "tags": [
        {
          "tag_key": "<string>",
          "tag_value": "<string>"
        }
      ],
      "kg_entities": [
        "<string>"
      ],
      "kg_relationships": [
        "<string>"
      ],
      "kg_terms": [
        "<string>"
      ],
      "kg_sources": [
        "<string>"
      ],
      "kg_chunk_id_zero_only": true
    },
    "enable_auto_detect_filters": true,
    "offset": 123,
    "limit": 123,
    "dedupe_docs": false
  },
  "rerank_settings": {
    "rerank_model_name": "<string>",
    "rerank_api_url": "<string>",
    "rerank_provider_type": "cohere",
    "rerank_api_key": "<string>",
    "num_rerank": 123,
    "disable_rerank_for_streaming": false
  },
  "query_override": "<string>",
  "regenerate": true,
  "llm_override": {
    "model_provider": "<string>",
    "model_version": "<string>",
    "temperature": 123
  },
  "prompt_override": {
    "system_prompt": "<string>",
    "task_prompt": "<string>"
  },
  "temperature_override": 123,
  "alternate_assistant_id": 123,
  "persona_override_config": {
    "name": "<string>",
    "description": "<string>",
    "search_type": "keyword",
    "num_chunks": 123,
    "llm_relevance_filter": false,
    "llm_filter_extraction": false,
    "recency_bias": "favor_recent",
    "llm_model_provider_override": "<string>",
    "llm_model_version_override": "<string>",
    "prompts": [
      {
        "name": "<string>",
        "description": "",
        "system_prompt": "<string>",
        "task_prompt": "",
        "include_citations": true,
        "datetime_aware": true
      }
    ],
    "prompt_ids": [
      123
    ],
    "document_set_ids": [
      123
    ],
    "tools": [
      {
        "id": 123
      }
    ],
    "tool_ids": [
      123
    ],
    "custom_tools_openapi": [
      {}
    ]
  },
  "use_existing_user_message": false,
  "existing_assistant_message_id": 123,
  "structured_response_format": {},
  "use_agentic_search": false,
  "skip_gen_ai_answer_generation": false
}'
"<any>"

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Before creating messages, be sure to create a chat_session and get an id

Response

200
application/json

Successful Response

The response is of type any.