---
title: "Chat Query"
method: POST
path: "/api/v1/chat/query"
tags: ["Chat"]
---

# Chat Query

`POST /api/v1/chat/query`

## Request

- Base URL: `https://api.gemina.co` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gemina.co/api/v1/chat/query`
- Auth: one of:
  - API key in header `X-API-Key`
  - OAuth 2 (password, token URL `token`)

Ask a natural-language question about the tenant's indexed documents.

Returns a grounded answer with documentId citations; ``confident=false``
means the underlying data could not support a reliable answer. Send back
the returned ``sessionId`` to continue the conversation; omit it to start
a new one.

## Request body

- ChatQueryInDTO
  - `message` string, required
  - `sessionId` string, uuid, nullable: Continue an existing conversation. Omit to start a new one; the response returns the sessionId to send on follow-up turns.
  - `endUserId` string, nullable: Server-to-server (API key) path only: trusted within-tenant filter. On the token path the token's signed scope always wins.

## Response `200`

Successful Response

- ChatQueryOutDTO
  - `servedAt` string, date-time
  - `servedAtTimestamp` number
  - `createdAt` string, date-time, nullable
  - `createdAtTimestamp` number, nullable
  - `answer` string, required
  - `sessionId` string, uuid, required: Conversation id — send back to continue this chat
  - `citations` string[]: documentId values the answer relies on
  - `intent` string, nullable: structured | semantic | hybrid | aggregation
  - `confident` boolean: False when the data could not support a reliable answer

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/gemina/apis/gemina-api.md) · [All operations](https://skmtc.dev/gemina/apis/gemina-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gemina/apis/gemina-api/revisions/152fd3f6f6ec?raw)
