UI completions are returned by the API when stream=false
is set in the request.
The API key to use for the request.
The content type of the request. Should be application/json
.
Request Body
An array of messages of the conversation so far.
The role of the message. Can be either user
, assistant
, or tool
.
The content of the message.
The ID of the tool call. Only present if the role is tool
.
The model to use for the UI completion. Should be one of the models listed in the Models page.
The temperature to use for the UI completion. Should be between 0 and 1.
The top-p value to use for the UI completion. Should be between 0 and 1.
The maximum number of tokens to use for the UI completion.
The number of completions to generate.
Should be unset or set to 1.
Whether to stream the response. Should be unset or false
.
All other request parameters are ignored.
curl -X POST \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{"model": "c1/anthropic/claude-sonnet-4/v-20250617", "messages": [{"role": "user", "content": "Hello, world!"}]}' \
https://api.thesys.dev/v1/embed/chat/completions
{
"id": "chatcmpl-1743157633416-cffw7tgswx",
"object": "chat.completion",
"created": 1743157633,
"model": "c1/anthropic/claude-sonnet-4/v-20250617",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": {
...
}
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 439,
"total_tokens": 447
}
}
Response
A unique identifier for the UI completion
An array of completions. Will always contain exactly one object.
The reason the generation stopped. Can be either stop
or tool_calls
.
Completion message generated by the model.
The role of the message. Will always be assistant
for generations.
A JSON object containing the UI completion.
The timestamp when the UI completion was created
The model used to generate the UI completion
The object type, which is always chat.completion
An object containing the usage statistics for the UI completion
Number of tokens in the prompt
Number of tokens in the generated UI completion
Total number of tokens: prompt_tokens + completion_tokens