curl -X POST \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{"model": "c1-embed-latest", "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-embed-latest",
      "choices": [
          {
          "index": 0,
          "message": {
              "role": "assistant",
              "content": {
                  ...
              }
          },
          "finish_reason": "stop"
          }
      ],
      "usage": {
          "prompt_tokens": 8,
          "completion_tokens": 439,
          "total_tokens": 447
      }
}

UI completions are returned by the API when stream=false is set in the request.

Request Headers

Authorization
string
required

The API key to use for the request.

Content-Type
string
required

The content type of the request. Should be application/json.

Request Body

messages
array
required

An array of messages of the conversation so far.

model
string
required

The model to use for the UI completion. Should be one of the models listed in the Models page.

temperature
number

The temperature to use for the UI completion. Should be between 0 and 1.

top_p
number

The top-p value to use for the UI completion. Should be between 0 and 1.

max_tokens
integer

The maximum number of tokens to use for the UI completion.

n
integer

The number of completions to generate.

stop
integer

Should be unset or set to 1.

stream
boolean

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-embed-latest", "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-embed-latest",
      "choices": [
          {
          "index": 0,
          "message": {
              "role": "assistant",
              "content": {
                  ...
              }
          },
          "finish_reason": "stop"
          }
      ],
      "usage": {
          "prompt_tokens": 8,
          "completion_tokens": 439,
          "total_tokens": 447
      }
}

Response

id
string

A unique identifier for the UI completion

choices
array

An array of completions. Will always contain exactly one object.

created
string

The timestamp when the UI completion was created

model
string

The model used to generate the UI completion

object
string

The object type, which is always chat.completion

usage
object

An object containing the usage statistics for the UI completion