---
title: "Chat Stream"
method: POST
path: "/v1/chat/stream"
tags: ["chat"]
---

# Chat Stream

`POST /v1/chat/stream`

## Request

- Base URL: `https://api.bitpoort.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.bitpoort.com/v1/chat/stream`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Stream chat response via Server-Sent Events.

Events:
- ``{type: "meta", chunks_used, rag_time_ms}`` — sent once after RAG search
- ``{type: "token", text}``                    — one per LLM token
- ``{type: "done", model, provider, llm_time_ms, total_time_ms}`` — final
- ``:keepalive``                               — comment heartbeat every 15 s
- ``[DONE]``                                   — stream terminator

## Request body

- ChatRequest
  - `message` string, required: The user's question
  - `chain` string, nullable: Filter context to a specific chain (e.g. 'ETH')
  - `history` ChatMessage[]: Previous conversation turns for multi-turn context
    - `role` string, required: 'user' or 'assistant'
    - `content` string, required
  - `conversation_id` string, nullable: Client-generated conversation id. On the bridge engine it maps to a live managed-agent session (true multi-turn: prior tool results stay in the agent's context). The legacy engine ignores it.
  - `max_chunks` integer: Max RAG chunks to retrieve
  - `provider` string, nullable: Force a provider: 'anthropic' or 'deepseek'. None = auto-detect.
  - `model` string, nullable: Per-request model override (e.g. 'claude-sonnet-4-20250514', 'gpt-4o'). If set, takes priority over server config.
  - `llm_api_key` string, nullable: Per-request LLM API key override — bring-your-own-key for hybrid RPC synthesis.

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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