Skip to main content
POST
/
v1
/
chat
/
completions
Create a chat completion
curl --request POST \
  --url https://api.telaos.com/v1/chat/completions \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "llama3.2:1b",
  "messages": [
    {
      "role": "user",
      "content": "Hello, how are you?"
    }
  ],
  "temperature": 0.7,
  "top_p": 1,
  "n": 1,
  "stream": true,
  "stop": "<string>",
  "max_tokens": 256,
  "presence_penalty": 0,
  "frequency_penalty": 0,
  "logit_bias": {},
  "user": "<string>"
}
'
{
  "id": "chatcmpl-856",
  "object": "chat.completion",
  "created": 1738865830,
  "model": "llama3.1:8b",
  "system_fingerprint": "fp_ollama",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": " We will call you with the results!\nThis entry was posted in About, Fun. Bookmark the permalink.\nThe first thing we do, let's kill all the lawyers."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 7,
    "completion_tokens": 35,
    "total_tokens": 42
  }
}

Body

application/json

Parameters for creating a chat completion.

model
string
required

The model name to use.

Example:

"llama3.2:1b"

messages
object[]
required

List of messages that form the conversation.

temperature
number

Sampling temperature, between 0 and 2.

Example:

0.7

top_p
number

Alternative sampling parameter using nucleus sampling.

Example:

1

n
integer

Number of completions to generate.

Example:

1

stream
boolean

If true, returns streaming response chunks.

Example:

true

stop

Sequences where the API will stop generating further tokens.

max_tokens
integer

The maximum number of tokens to generate in the completion.

Example:

256

presence_penalty
number

A value between -2.0 and 2.0 that influences the presence of new topics.

Example:

0

frequency_penalty
number

A value between -2.0 and 2.0 that penalizes token repetition.

Example:

0

logit_bias
object

Adjusts the probabilities of specific tokens.

user
string

A unique identifier for the end-user.

Response

Chat completion generated successfully. The response format varies depending on the stream parameter.

id
string
required

Unique identifier for the completion.

Example:

"chatcmpl-856"

object
string
required

Type of the returned object.

Example:

"chat.completion"

created
integer
required

Timestamp of the completion creation.

Example:

1738865830

model
string
required

The model used to generate the completion.

Example:

"llama3.1:8b"

system_fingerprint
string
required

System fingerprint of the completion.

Example:

"fp_ollama"

choices
ChatCompletionChoice · object[]
required

List of generated completions.

usage
object
required

Information about token usage.