Streaming message chunks are returned by the API when stream=true is set in the request.
Request Headers
string
required
The API key to use for the request.
string
required
The content type of the request. Should be application/json.
Request Body
array
required
An array of messages of the conversation so far.
Show Message Properties
string
The role of the message. Can be either user, assistant, or tool.
string
The content of the message.
string
The ID of the tool call. Only present if the role is tool.
string
required
The model to use for the UI completion. Should be one of the models listed in the Models page.
number
The temperature to use for the UI completion. Should be between 0 and 1.
number
The top-p value to use for the UI completion. Should be between 0 and 1.
integer
The maximum number of tokens to use for the UI completion.
integer
The number of completions to generate.
integer
Should be unset or set to 1.
boolean
Whether to stream the response. Should be true for streaming.
The parameters above are commonly used with the Messages API. For a
comprehensive list of all supported parameters and their compatibility across
different model providers (OpenAI vs Anthropic), see the Supported API
Parameters table.
A unique identifier for the UI completion. Will be the same in all events for a given completion.
string
required
The object type, which is always chat.completion.chunk
integer
required
Timestamp for when the chunk was created.
string
required
The model used to generate the UI completion.
object
An object containing the usage statistics for the UI completion
Only present if the generation is complete.
Show Properties
integer
Number of tokens in the prompt
integer
Number of tokens in the generated UI completion
integer
Total number of tokens: prompt_tokens + completion_tokens
array
An array of completions. Will always contain exactly one object.
Show Properties
string
The reason the generation stopped. Can be either stop or tool_calls.
Present only if the generation is complete.
object
A JSON object containing the UI completion.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Thesys Documentation","colors":{"primary":"#8B5CF6","light":"#8B5CF6","dark":"#8B5CF6"},"logo":{"light":"https://mintcdn.com/thesys/Ix1JbpbB1tWCO3US/logo/light.svg?fit=max\u0026auto=format\u0026n=Ix1JbpbB1tWCO3US\u0026q=85\u0026s=b402e9b4308b19551e2db284d332d42e","dark":"https://mintcdn.com/thesys/Ix1JbpbB1tWCO3US/logo/dark.svg?fit=max\u0026auto=format\u0026n=Ix1JbpbB1tWCO3US\u0026q=85\u0026s=1ef66089195e3e1d00dbe6cee8707418"},"favicon":"https://mintcdn.com/thesys/C1mGp0p_ygBsZ7UI/favicon.svg?fit=max\u0026auto=format\u0026n=C1mGp0p_ygBsZ7UI\u0026q=85\u0026s=5fe35350b85f0947e9a3c66a440ddbcb","api":{"playground":{"display":"simple"}},"navbar":{"links":[{"href":"https://www.openui.com/docs","label":"OpenUI Docs"},{"href":"https://zcal.co/zahle/30min","label":"Ask our Dev"}],"primary":{"type":"button","label":"Get API Key","href":"https://console.thesys.dev"}},"footer":{"socials":{"x":"https://x.com/thesysdev","github":"https://github.com/thesysdev","linkedin":"https://linkedin.com/company/thesysdev","youtube":"https://www.youtube.com/@thesysdev","discord":"https://discord.gg/Pbv5PsqUSv"}},"seo":{"metatags":{"canonical":"https://docs.thesys.dev"}},"banner":{"content":"You are reading the archived C1 by Thesys docs. New projects should use [the OpenUI docs](https://www.openui.com/docs).","dismissible":false},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"OpenUI Docs","icon":"arrow-right","href":"https://www.openui.com/docs"},{"anchor":"Developer Tools","icon":"wrench","href":"https://docs.thesys.dev/legacy/developer-tools"},{"anchor":"AI Coding IDE Setup","icon":"code","href":"https://docs.thesys.dev/legacy/guides/ide-setup"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/Pbv5PsqUSv"},{"anchor":"Get Support","icon":"headset","href":"mailto:support@thesys.dev"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"thesys","hasAudioNarration":false,"actualSubdomain":"thesys","customDomains":["docs.thesys.dev"],"gitSource":{"type":"github","owner":"thesysdev","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10b10d9ffae5051c3fecb3"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6af1c79712241f5ef5b8cf1f","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"Guide","count":67},{"language":"default","tag":"Reference","count":14},{"language":"default","tag":"Artifacts","count":13},{"language":"default","tag":"Ecosystem","count":13},{"language":"default","tag":"Advanced","count":12},{"language":"default","tag":"API","count":10},{"language":"default","tag":"legacy/Frameworks","count":10},{"language":"default","tag":"Agent Builder","count":9},{"language":"default","tag":"Conversational UI","count":9},{"language":"default","tag":"Library","count":9}]},"assistantConfig":{"enableStarterQuestions":false},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"styles/deprecated-models.css","content":".deprecated-models{text-decoration:line-through;color:rgb(248, 105, 86)!important}"},{"filePath":"styles/models-pricing.css","content":".model-details [data-component-part=\"update-tag\"]{color:rgb(44, 133, 104)}.dark .model-details [data-component-part=\"update-tag\"]{color:rgb(6, 197, 137)}"}]}
{"page":{"pagePath":"legacy/api-reference/objects/streaming","slug":"/legacy/api-reference/objects/streaming","pageMetadata":{"title":"Streaming Chunks","description":null,"href":"/legacy/api-reference/objects/streaming"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,ul:`ul`,..._provideComponents(),...props.components},{Expandable,Heading,Note,ParamField,ResponseField}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Streaming message chunks are returned by the API when `,_jsx(_components.code,{children:`stream=true`}),` is set in the request.`]}),`\n`,_jsx(Heading,{level:`2`,id:`request-headers`,children:`Request Headers`}),`\n`,_jsx(ParamField,{path:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:_jsx(_components.p,{children:`The API key to use for the request.`})}),`\n`,_jsx(ParamField,{path:`Content-Type`,type:`string`,required:true,id:`param-content-type`,children:_jsxs(_components.p,{children:[`The content type of the request. Should be `,_jsx(_components.code,{children:`application/json`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(ParamField,{path:`messages`,type:`array`,required:true,id:`param-messages`,children:[_jsx(_components.p,{children:`An array of messages of the conversation so far.`}),_jsxs(Expandable,{title:`Message Properties`,children:[_jsx(ParamField,{path:`message.role`,type:`string`,id:`param-message-role`,children:_jsxs(_components.p,{children:[`The role of the message. Can be either `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`assistant`}),`, or `,_jsx(_components.code,{children:`tool`}),`.`]})}),_jsx(ParamField,{path:`message.content`,type:`string`,id:`param-message-content`,children:_jsx(_components.p,{children:`The content of the message.`})}),_jsx(ParamField,{path:`message.tool_call_id`,type:`string`,id:`param-message-tool-call-id`,children:_jsxs(_components.p,{children:[`The ID of the tool call. Only present if the role is `,_jsx(_components.code,{children:`tool`}),`.`]})})]})]}),`\n`,_jsx(ParamField,{path:`model`,type:`string`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`The model to use for the UI completion. Should be one of the models listed in the `,_jsx(_components.a,{href:`/legacy/api-reference/models-and-compatibility`,children:`Models`}),` page.`]})}),`\n`,_jsx(ParamField,{path:`temperature`,type:`number`,id:`param-temperature`,children:_jsx(_components.p,{children:`The temperature to use for the UI completion. Should be between 0 and 1.`})}),`\n`,_jsx(ParamField,{path:`top_p`,type:`number`,id:`param-top-p`,children:_jsx(_components.p,{children:`The top-p value to use for the UI completion. Should be between 0 and 1.`})}),`\n`,_jsx(ParamField,{path:`max_tokens`,type:`integer`,id:`param-max-tokens`,children:_jsx(_components.p,{children:`The maximum number of tokens to use for the UI completion.`})}),`\n`,_jsx(ParamField,{path:`n`,type:`integer`,id:`param-n`,children:_jsx(_components.p,{children:`The number of completions to generate.`})}),`\n`,_jsx(ParamField,{path:`stop`,type:`integer`,id:`param-stop`,children:_jsx(_components.p,{children:`Should be unset or set to 1.`})}),`\n`,_jsx(ParamField,{path:`stream`,type:`boolean`,id:`param-stream`,children:_jsxs(_components.p,{children:[`Whether to stream the response. Should be `,_jsx(_components.code,{children:`true`}),` for streaming.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The parameters above are commonly used with the Messages API. For a\ncomprehensive list of all supported parameters and their compatibility across\ndifferent model providers (OpenAI vs Anthropic), see the `,_jsx(_components.a,{href:`/legacy/api-reference/getting-started#supported-api-parameters`,children:`Supported API\nParameters`}),` table.`]})}),`\n`,`\n`,`\n`,_jsx(Heading,{level:`2`,id:`sse-event-stream`,children:`SSE Event Stream`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`A identifier for this event.`})}),`\n`,_jsxs(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:[_jsx(_components.p,{children:`One of the following objects:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`#completion-chunk`,children:`Completion Chunk`})}),`\n`]}),_jsx(Heading,{level:`2`,id:`completion-chunk`,children:`Completion Chunk`}),_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id-1`,children:_jsx(_components.p,{children:`A unique identifier for the UI completion. Will be the same in all events for a given completion.`})}),_jsx(ResponseField,{name:`object`,type:`string`,required:true,id:`param-object`,children:_jsxs(_components.p,{children:[`The object type, which is always `,_jsx(_components.code,{children:`chat.completion.chunk`})]})}),_jsx(ResponseField,{name:`created`,type:`integer`,required:true,id:`param-created`,children:_jsx(_components.p,{children:`Timestamp for when the chunk was created.`})}),_jsx(ResponseField,{name:`model`,type:`string`,required:true,id:`param-model-1`,children:_jsx(_components.p,{children:`The model used to generate the UI completion.`})}),_jsxs(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:[_jsx(_components.p,{children:`An object containing the usage statistics for the UI completion\nOnly present if the generation is complete.`}),_jsxs(Expandable,{title:`Properties`,children:[_jsx(ResponseField,{name:`usage.prompt_tokens`,type:`integer`,id:`param-usage-prompt-tokens`,children:_jsx(_components.p,{children:`Number of tokens in the prompt`})}),_jsx(ResponseField,{name:`usage.completion_tokens`,type:`integer`,id:`param-usage-completion-tokens`,children:_jsx(_components.p,{children:`Number of tokens in the generated UI completion`})}),_jsx(ResponseField,{name:`usage.total_tokens`,type:`integer`,id:`param-usage-total-tokens`,children:_jsxs(_components.p,{children:[`Total number of tokens: `,_jsx(_components.code,{children:`prompt_tokens + completion_tokens`})]})})]})]}),_jsxs(ResponseField,{name:`choices`,type:`array`,id:`param-choices`,children:[_jsx(_components.p,{children:`An array of completions. Will always contain exactly one object.`}),_jsxs(Expandable,{title:`Properties`,children:[_jsx(ResponseField,{name:`finish_reason`,type:`string`,optional:true,id:`param-finish-reason`,children:_jsxs(_components.p,{children:[`The reason the generation stopped. Can be either `,_jsx(_components.code,{children:`stop`}),` or `,_jsx(_components.code,{children:`tool_calls`}),`.\nPresent only if the generation is complete.`]})}),_jsx(ResponseField,{name:`delta`,type:`object`,id:`param-delta`,children:_jsx(_components.p,{children:`A JSON object containing the UI completion.`})})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Streaming Chunks","description":null,"href":"/legacy/api-reference/objects/streaming"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[213,337,"pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expa"],[537,549,"questExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)"],[4062,4068,"_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:`curl`,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer \u003capi_key>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"model\": \"c1/anthropic/claude-sonnet-4/v-20251230\", \"stream\": true, \"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}]}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.thesys.dev/v1/embed/chat/completions`})}),`\n`]})})})}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`Response`,numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` id: 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` data: {\"id\":\"chatcmpl-1743157601318-pzx9ougakm\",\"object\":\"chat.completion.chunk\",\"created\":1743157601,\"model\":\"c1/anthropic/claude-sonnet-4/v-20251230\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":{...}}]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` id: 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` data: {\"id\":\"chatcmpl-1743157601318-pzx9ougakm\",\"object\":\"chat.completion.chunk\",\"created\":1743157601,\"model\":\"c1/anthropic/claude-sonnet-4/v-20251230\",\"choices\":[{\"index\":0,\"delta\":{\"content\":{...}}]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})}),`\n"]]},"mdxExtracts":{"tableOfContents":[{"title":"Request Headers","slug":"request-headers","depth":2,"children":[]},{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"SSE Event Stream","slug":"sse-event-stream","depth":2,"children":[]},{"title":"Completion Chunk","slug":"completion-chunk","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"curl","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer \u0026#x3C;api_key>\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\"model\": \"c1/anthropic/claude-sonnet-4/v-20251230\", \"stream\": true, \"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}]}'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api.thesys.dev/v1/embed/chat/completions\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"text\">\u003ccode language=\"text\" numberOfLines=\"6\">\u003cspan class=\"line\">\u003cspan> id: 1\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan> data: {\"id\":\"chatcmpl-1743157601318-pzx9ougakm\",\"object\":\"chat.completion.chunk\",\"created\":1743157601,\"model\":\"c1/anthropic/claude-sonnet-4/v-20251230\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":{...}}]}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan> id: 2\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan> data: {\"id\":\"chatcmpl-1743157601318-pzx9ougakm\",\"object\":\"chat.completion.chunk\",\"created\":1743157601,\"model\":\"c1/anthropic/claude-sonnet-4/v-20251230\",\"choices\":[{\"index\":0,\"delta\":{\"content\":{...}}]}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>\u003c/span>\u003c/span>\u003c/code>\u003c/pre>"}],"attributes":[]}}},"jsLinks":["/_mintlify/custom/thesys/c59d88e29a375e54/tracking.js"],"subdomain":"thesys","siteName":"Thesys Documentation","title":"Streaming Chunks - Thesys Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-06T07:15:29.186Z","originalFileLocation":"legacy/api-reference/objects/streaming.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Thesys Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Streaming Chunks - Thesys Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Thesys Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.thesys.dev/legacy/api-reference/objects/streaming\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://thesys.mintlify.site/_mintlify/api/og/v2?division=legacy%2FObjects\u0026amp;title=Streaming+Chunks\u0026amp;theme=8e36d645b20658078a84b2f9\u0026amp;signature=5eaba70e518620dd1fa325127f9961a6043040efe4c9fe967703de88a1c3850d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Streaming Chunks - Thesys Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://thesys.mintlify.site/_mintlify/api/og/v2?division=legacy%2FObjects\u0026amp;title=Streaming+Chunks\u0026amp;theme=8e36d645b20658078a84b2f9\u0026amp;signature=5eaba70e518620dd1fa325127f9961a6043040efe4c9fe967703de88a1c3850d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/thesys/xeMc67sqrKsQ_4dX/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Thesys Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#8B5CF6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.thesys.dev/legacy/api-reference/objects/streaming\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/legacy/api-reference/objects/streaming.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.thesys.dev/#organization\",\"name\":\"Thesys Documentation\",\"url\":\"https://docs.thesys.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/thesys/Ix1JbpbB1tWCO3US/logo/light.svg?fit=max\u0026auto=format\u0026n=Ix1JbpbB1tWCO3US\u0026q=85\u0026s=b402e9b4308b19551e2db284d332d42e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.thesys.dev#website\",\"name\":\"Thesys Documentation\",\"url\":\"https://docs.thesys.dev\",\"publisher\":{\"@id\":\"https://docs.thesys.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.thesys.dev/legacy/api-reference/objects/streaming#webpage\",\"url\":\"https://docs.thesys.dev/legacy/api-reference/objects/streaming\",\"name\":\"Streaming Chunks\",\"dateModified\":\"2026-09-06T07:15:29.186Z\",\"isPartOf\":{\"@id\":\"https://docs.thesys.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.thesys.dev/legacy/api-reference/objects/streaming#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.thesys.dev/legacy/api-reference/objects/streaming#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API\",\"item\":\"https://docs.thesys.dev/legacy/api-reference/getting-started\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"legacy/Objects\",\"item\":\"https://docs.thesys.dev/legacy/api-reference/objects/message\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Streaming Chunks\",\"item\":\"https://docs.thesys.dev/legacy/api-reference/objects/streaming\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.thesys.dev/legacy/api-reference/objects/streaming#article\",\"headline\":\"Streaming Chunks\",\"name\":\"Streaming Chunks\",\"url\":\"https://docs.thesys.dev/legacy/api-reference/objects/streaming\",\"mainEntityOfPage\":{\"@id\":\"https://docs.thesys.dev/legacy/api-reference/objects/streaming#webpage\"},\"dateModified\":\"2026-09-06T07:15:29.186Z\",\"publisher\":{\"@id\":\"https://docs.thesys.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.thesys.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Thesys Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Thesys Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/legacy/api-reference/objects/streaming.md","siteName":"Thesys Documentation","nav":{"global":{"anchors":[{"anchor":"OpenUI Docs","icon":"arrow-right","href":"https://www.openui.com/docs"},{"anchor":"Developer Tools","icon":"wrench","href":"https://docs.thesys.dev/legacy/developer-tools"},{"anchor":"AI Coding IDE Setup","icon":"code","href":"https://docs.thesys.dev/legacy/guides/ide-setup"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/Pbv5PsqUSv"},{"anchor":"Get Support","icon":"headset","href":"mailto:support@thesys.dev"}]},"tabs":[{"tab":"Guide","pages":[{"title":"Guide","href":"/legacy"}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/legacy/examples"}]},{"tab":"Reference","groups":[{"group":"API","pages":[{"title":"API Overview","href":"/legacy/api-reference/getting-started"},{"title":"Models \u0026 Compatibility","href":"/legacy/api-reference/models-and-compatibility"},{"title":"API Changelog","href":"/legacy/api-reference/model-changelog"},{"title":"Rate Limits","href":"/legacy/api-reference/rate-limits"},{"title":"Errors","href":"/legacy/api-reference/errors"},{"group":"legacy/Endpoints","pages":[{"title":"Embed","api":"POST /v1/embed/chat/completions","href":"/legacy/api-reference/endpoints/embed"},{"title":"Visualize","api":"POST /v1/visualize/chat/completions","href":"/legacy/api-reference/endpoints/visualize"}]},{"group":"legacy/Objects","pages":[{"title":"Messages","description":null,"href":"/legacy/api-reference/objects/message"},{"title":"Streaming Chunks","href":"/legacy/api-reference/objects/streaming"}]},{"title":"Security \u0026 Compliance","description":"C1 is a hosted service that is built to be secure and compliant.","href":"/legacy/guides/security"}]},{"group":"React","pages":[{"title":"C1 Component","href":"/legacy/react-reference/c1-component"},{"title":"Chat Component","href":"/legacy/react-reference/c1-chat"},{"title":"Theme Provider","href":"/legacy/react-reference/theme-provider"}]},{"group":"SDK","pages":[{"title":"C1 Response","href":"/legacy/sdk-reference/c1-response"}]}]},{"tab":"Agent Builder","pages":[{"title":"Agent Builder","href":"/legacy/agent-builder/introduction"}]},{"tab":"Library","pages":[{"title":"Library","href":"/legacy/library"}]}]},"basePath":"","title":"Streaming Chunks - Thesys Documentation","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":["10e4515597","2b790eda92"],"chunks":["BannerMarkdown-CrFSwoa1.js","dist-MIf_HGLZ.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","ApiExamples-sCe6z2hN.js","usePlaygroundInputsStore-cU_dFE5n.js","shallow-BwNCr__O.js","utils-D0Za9LU_.js","utils-BS41p-Nj.js","isEqual-Cnvzqd4L.js","_Uint8Array-B2-W7EM3.js","isObject-FP1Yky1u.js","CodeSnippets-CMIr49P8.js","CodeSnippet-BC-bKzyy.js","snippetPresets-alIv9Yoc.js","style-to-object-BY3JEAdk.js","use-playground-group-access-c3bgmn-x.js","cloneDeep-4e5CS5ZI.js","v4-DIgz8zy6.js"]}