Chat

Streaming chat completion

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].

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

Request body

modelstring required
max_tokensinteger
temperaturenumber
provider_paramsobject

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_citationsboolean

When true, the final SSE event includes a structured citations array resolved from provider metadata. See /chat/completions for full schema.

normalize_imagesboolean

When true, the final SSE event includes a normalized images array. See /chat/completions for full schema.

include_reasoningboolean

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.

Example request

{
  "model": "perplexity/sonar-pro",
  "provider_params": {
    "return_images": true,
    "return_related_questions": true
  }
}

Response

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.

Changes

No recorded changes to this operation across all 1 revision of this API.