AI & MCP

MCP Streaming Chat

Server-Sent Events streaming chat completion with optional chart context.

post/mcp/streaming

Headers

X-Provider'openai' | 'anthropic' | 'google' | 'groq' | 'mistral' | 'openrouter' | 'deepseek' | 'together'

Bring your own model key: the LLM provider that should run this completion. Send together with X-Provider-Key or the request is refused: a key with no provider bills us for tokens you meant to pay for, and a provider with no key would look like it worked. The endpoint is fixed per provider on our side and is never taken from the request. There is no fallback to our own chain: if your key fails you get the provider's status and message.

X-Provider-Keystring

Your own credential for X-Provider. Never logged, stored or cached: it travels in a header because the request body is hashed into two cache keys, and a BYOK turn bypasses both caches in each direction. A provider error that quotes the key back is redacted before it reaches our logs or your response. Such a turn costs 5 credits instead of the endpoint price, and only when a completion actually ran on your key.

X-Provider-Modelstring

Optional model id, overriding the default for that provider. Defaults: openai → gpt-4o-mini, anthropic → claude-sonnet-4-5, google → gemini-2.5-flash, groq → llama-3.3-70b-versatile, mistral → mistral-large-latest, openrouter → meta-llama/llama-3.3-70b-instruct, deepseek → deepseek-chat, together → meta-llama/Llama-3.3-70B-Instruct-Turbo.

Request body

messagestring required
language'uk' | 'en' | 'de' | 'ru' | 'pl' | 'es' | 'pt' | 'hi' | 'fr' | 'ko' | 'it' | 'ja' | 'id' | 'tr' | 'nl' | 'ro' | 'cs' | 'vi' | 'ar' | 'el' | 'hu'

Response

Server-sent events. Each frame is data: followed by a JSON object: {"type":"token","text":"..."} for each chunk of the answer, then one {"type":"done","model":"...","elapsed_ms":n}. Errors arrive as {"type":"error","message":"..."}.

Changes

Changed in 4 of the 13 revisions of this API.567

  • 6828e560956411See the full diff
    • removed the media type application/json for the response with the status 200

      response-media-type-removed

    • added the media type text/event-stream for the response with the status 200

      response-media-type-added

    • added the new optional request property chart/ayanamsa

      new-optional-request-property

  • e637d1a9911b23See the full diff
    • the chart/timezoneOffset request property's max was set to 14.00

      request-property-max-set

    • the chart/timezoneOffset request property's min was set to -14.00

      request-property-min-set

    • added the new optional header request parameter X-Provider

      new-optional-request-parameter

    • added the new optional header request parameter X-Provider-Key

      new-optional-request-parameter

    • added the new optional header request parameter X-Provider-Model

      new-optional-request-parameter

  • b0533bcc12c0442See the full diff
    • the request property chart/latitude became not nullable

      request-property-became-not-nullable

    • the request property chart/longitude became not nullable

      request-property-became-not-nullable

    • the request property chart/latitude became required

      request-property-became-required

    • the request property chart/longitude became required

      request-property-became-required

    • the chart/latitude request property's max was set to 90.00

      request-property-max-set

    • the chart/longitude request property's max was set to 180.00

      request-property-max-set

    • the chart/latitude request property's min was set to -90.00

      request-property-min-set

    • the chart/longitude request property's min was set to -180.00

      request-property-min-set

    • the latitude request property default value 0 was removed

      request-property-default-value-removed

    • the longitude request property default value 0 was removed

      request-property-default-value-removed