---
title: "Streaming chat completion"
method: POST
path: "/chat/completions/stream"
tags: ["Chat"]
---

# Streaming chat completion

`POST /chat/completions/stream`

## Request

- Base URL: `https://studio.fintechstudios.com/api/v1`
- URL: `https://studio.fintechstudios.com/api/v1/chat/completions/stream`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Generate a streaming chat completion via Server-Sent Events. Same parameters as /chat/completions, including provider_params. Content chunks arrive as `choices[0].delta.content`. The final chunk includes `finish_reason: "stop"`, `usage`, and `provider_metadata` (if the upstream provider returns extra fields). Terminated by `data: [DONE]`.

## Request body

- object
  - `model` string, required
  - `messages` object[], required
    - `role` 'system' | 'user' | 'assistant'
    - `content` string
  - `max_tokens` integer
  - `temperature` number
  - `response_format` object
    - `type` 'text' | 'json_object'
  - `provider_params` object: Provider-specific request parameters forwarded to the upstream LLM via OpenRouter. Known Perplexity params: return_images (boolean), return_related_questions (boolean), search_recency_filter (string: 'month'|'week'|'day'|'hour'), search_domain_filter (string[]).
  - `enrich_citations` boolean: When true, the final SSE event includes a structured `citations` array resolved from provider metadata. See /chat/completions for full schema.
  - `normalize_images` boolean: When true, the final SSE event includes a normalized `images` array. See /chat/completions for full schema.
  - `include_reasoning` boolean: When true, reasoning models (e.g. perplexity/sonar-reasoning-pro) stream their step-by-step thinking live as extra chunks with `choices[0].delta.reasoning` (a string, no `content`), ahead of the answer's content chunks. Concatenate them in order for the full reasoning. Non-reasoning models send none. Streaming endpoint only.

## Response `200`

SSE stream of chat completion chunks. Final chunk includes provider_metadata, usage, and optionally citations and images (when enrichment flags are set). With include_reasoning, reasoning models also send delta.reasoning chunks before the content.

---

[API](https://skmtc.dev/fintechstudios/apis/fts-studio-api.md) · [All operations](https://skmtc.dev/fintechstudios/apis/fts-studio-api/llms.txt) · [OpenAPI document](https://skmtc.dev/fintechstudios/apis/fts-studio-api/revisions/4886597d1d96?raw)
