---
title: "Chat (POST)"
method: POST
path: "/v1/chat/completions"
tags: ["Chat"]
---

# Chat (POST)

`POST /v1/chat/completions`

## Request

- Base URL: `https://search.elixpo.com`
- URL: `https://search.elixpo.com/v1/chat/completions`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`
  - API key in query parameter `key`
- TypeScript: <https://skmtc.dev/elixpo/apis/lixsearch-api/docs/v1/chat/completions/post.ts> (a function with typed inputs; its response is checked against the schema)

Primary endpoint. OpenAI-compatible — works with any OpenAI SDK client.

- Last user message is used as the search query
- Earlier messages provide conversation context
- `stream` defaults to `false`
- Conversation history is supplied entirely through `messages`

## Request body

- ChatRequest
  - `messages` ChatMessage[], required: Conversation messages. Last user message = search query.
    - `role` 'system' | 'user' | 'assistant', required
    - `content` union, required
      - string
      - ContentPart[]: Vision format: array of text and image_url parts
        - `type` 'text' | 'image_url', required
        - `text` string: Text content (when type is "text")
        - `image_url` object: Image reference (when type is "image_url")
          - `url` string: HTTPS URL or base64 data URI (`data:image/jpeg;base64,...`). Base64 images are auto-hosted before processing.
  - `model` string: Ignored — always uses oreolook (legacy `lixsearch` accepted)
  - `stream` boolean: Enable SSE streaming
  - `temperature` number: Accepted for compatibility, not used
  - `max_tokens` integer: Accepted for compatibility, not used

## Response `200`

Chat response

- ChatResponse
  - `id` string
  - `object` 'chat.completion'
  - `created` integer
  - `model` string
  - `choices` object[]
    - `index` integer
    - `message` object
      - `role` 'assistant'
      - `content` string
    - `finish_reason` 'stop'
  - `usage` object
    - `prompt_tokens` integer
    - `completion_tokens` integer
    - `total_tokens` integer

## Other responses

- `400`: Invalid request
- `401`: API key required
- `403`: Invalid API key
- `503`: Server not ready

## Changes

- **2026-10-27** `dee7777b8958`: 1 info
  - the `model` request property default value changed from `lixsearch` to `oreolook`
- **2026-08-11** `0c601a16410f`: 1 warning
  - removed the request property `session_id`
- **2026-04-06** `1b4365f47b75`: 2 breaking, 8 info
  - the `error` response's property type changed from no type to `string` for status `400`
  - the `error` response's property type changed from no type to `string` for status `503`
  - api operation id `createChatCompletion` removed and replaced with `chat`
  - api tag `Chat` added
  - …6 more
- **2026-04-05** `7b79b2e349e9`: 1 info
  - the `messages/items/content/oneOf[subschema #2]/items/image_url/url` request property format was generalized from `uri` to no format
- **2026-03-19** `234b0198f5a8`: 1 warning
  - removed the request property `deep_search`

[Operation history](https://skmtc.dev/elixpo/apis/lixsearch-api/changes/v1/chat/completions/post.md)

---

[API](https://skmtc.dev/elixpo/apis/lixsearch-api.md) - [All operations](https://skmtc.dev/elixpo/apis/lixsearch-api/llms.txt) - [OpenAPI document](https://skmtc.dev/elixpo/apis/lixsearch-api/revisions/dee7777b8958?raw)
