UI completions are returned by the API when stream=false 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 unset or false.
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.
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.
object
Completion message generated by the model.
Show Properties
string
The role of the message. Will always be assistant for generations.
string
A JSON object containing the UI completion.
string
The timestamp when the UI completion was created
string
The model used to generate the UI completion
string
The object type, which is always chat.completion
object
An object containing the usage statistics for the UI completion
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
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/message","slug":"/legacy/api-reference/objects/message","pageMetadata":{"title":"Messages","description":null,"href":"/legacy/api-reference/objects/message"},"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`,p:`p`,..._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:[`UI completions are returned by the API when `,_jsx(_components.code,{children:`stream=false`}),` 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 unset or `,_jsx(_components.code,{children:`false`}),`.`]})}),`\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:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`A unique identifier for the UI completion`})}),`\n`,_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`,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`}),`.`]})}),_jsxs(ResponseField,{name:`message`,type:`object`,id:`param-message`,children:[_jsx(_components.p,{children:`Completion message generated by the model.`}),_jsxs(Expandable,{title:`Properties`,children:[_jsx(ResponseField,{name:`message.role`,type:`string`,id:`param-message-role-1`,children:_jsxs(_components.p,{children:[`The role of the message. Will always be `,_jsx(_components.code,{children:`assistant`}),` for generations.`]})}),_jsx(ResponseField,{name:`message.content`,type:`string`,id:`param-message-content-1`,children:_jsx(_components.p,{children:`A JSON object containing the UI completion.`})})]})]})]})]}),`\n`,_jsx(ResponseField,{name:`created`,type:`string`,id:`param-created`,children:_jsx(_components.p,{children:`The timestamp when the UI completion was created`})}),`\n`,_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model-1`,children:_jsx(_components.p,{children:`The model used to generate the UI completion`})}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object`,children:_jsxs(_components.p,{children:[`The object type, which is always `,_jsx(_components.code,{children:`chat.completion`})]})}),`\n`,_jsxs(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:[_jsx(_components.p,{children:`An object containing the usage statistics for the UI completion`}),_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`})]})})]})]})]})}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":"Messages","description":null,"href":"/legacy/api-reference/objects/message"}}},"mdxSourceWithNoJs":{"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`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`UI completions are returned by the API when `,_jsx(_components.code,{children:`stream=false`}),` 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 unset or `,_jsx(_components.code,{children:`false`}),`.`]})}),`\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`,_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\", \"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:``,numberOfLines:`23`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`23`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chatcmpl-1743157633416-cffw7tgswx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat.completion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1743157633`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"c1/anthropic/claude-sonnet-4/v-20251230\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"choices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:` ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finish_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`439`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`447`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`A unique identifier for the UI completion`})}),`\n`,_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`,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`}),`.`]})}),_jsxs(ResponseField,{name:`message`,type:`object`,id:`param-message`,children:[_jsx(_components.p,{children:`Completion message generated by the model.`}),_jsxs(Expandable,{title:`Properties`,children:[_jsx(ResponseField,{name:`message.role`,type:`string`,id:`param-message-role-1`,children:_jsxs(_components.p,{children:[`The role of the message. Will always be `,_jsx(_components.code,{children:`assistant`}),` for generations.`]})}),_jsx(ResponseField,{name:`message.content`,type:`string`,id:`param-message-content-1`,children:_jsx(_components.p,{children:`A JSON object containing the UI completion.`})})]})]})]})]}),`\n`,_jsx(ResponseField,{name:`created`,type:`string`,id:`param-created`,children:_jsx(_components.p,{children:`The timestamp when the UI completion was created`})}),`\n`,_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model-1`,children:_jsx(_components.p,{children:`The model used to generate the UI completion`})}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object`,children:_jsxs(_components.p,{children:[`The object type, which is always `,_jsx(_components.code,{children:`chat.completion`})]})}),`\n`,_jsxs(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:[_jsx(_components.p,{children:`An object containing the usage statistics for the UI completion`}),_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`})]})})]})]})]})}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":"Messages","description":null,"href":"/legacy/api-reference/objects/message"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Request Headers","slug":"request-headers","depth":2,"children":[]},{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","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\", \"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":"","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=\"json\">\u003ccode language=\"json\" numberOfLines=\"23\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"chatcmpl-1743157633416-cffw7tgswx\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"object\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"chat.completion\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"created\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1743157633\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"c1/anthropic/claude-sonnet-4/v-20251230\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"choices\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"index\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"role\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"assistant\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#82071E;--shiki-light-font-style:italic;--shiki-dark:#F44747;--shiki-dark-font-style:inherit\"> ...\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"finish_reason\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"stop\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"usage\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"prompt_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">8\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"completion_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">439\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"total_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">447\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}}},"jsLinks":["/_mintlify/custom/thesys/c59d88e29a375e54/tracking.js"],"subdomain":"thesys","siteName":"Thesys Documentation","title":"Messages - Thesys Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-06T07:15:29.184Z","originalFileLocation":"legacy/api-reference/objects/message.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=\"Messages - 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/message\">\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=Messages\u0026amp;theme=8e36d645b20658078a84b2f9\u0026amp;signature=b611f3033b21c4166d3b5f06033cf11c51fa24adcb7cb1be150efc96acfc8007\">\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=\"Messages - Thesys Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://thesys.mintlify.site/_mintlify/api/og/v2?division=legacy%2FObjects\u0026amp;title=Messages\u0026amp;theme=8e36d645b20658078a84b2f9\u0026amp;signature=b611f3033b21c4166d3b5f06033cf11c51fa24adcb7cb1be150efc96acfc8007\">\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/message\">\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/message.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/message#webpage\",\"url\":\"https://docs.thesys.dev/legacy/api-reference/objects/message\",\"name\":\"Messages\",\"dateModified\":\"2026-09-06T07:15:29.184Z\",\"isPartOf\":{\"@id\":\"https://docs.thesys.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.thesys.dev/legacy/api-reference/objects/message#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.thesys.dev/legacy/api-reference/objects/message#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API\",\"item\":\"https://docs.thesys.dev/legacy/api-reference/getting-started\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Messages\",\"item\":\"https://docs.thesys.dev/legacy/api-reference/objects/message\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.thesys.dev/legacy/api-reference/objects/message#article\",\"headline\":\"Messages\",\"name\":\"Messages\",\"url\":\"https://docs.thesys.dev/legacy/api-reference/objects/message\",\"mainEntityOfPage\":{\"@id\":\"https://docs.thesys.dev/legacy/api-reference/objects/message#webpage\"},\"dateModified\":\"2026-09-06T07:15:29.184Z\",\"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/message.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","description":"Generates a UI for the given data.","api":"POST /v1/visualize/chat/completions","href":"/legacy/api-reference/endpoints/visualize"}]},{"group":"legacy/Objects","pages":[{"title":"Messages","href":"/legacy/api-reference/objects/message"},{"title":"Streaming Chunks","description":null,"href":"/legacy/api-reference/objects/streaming"}]},{"title":"Security \u0026 Compliance","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":"Messages - 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"]}