Skip to main content
POST
/
chat
/
completions
curl --request POST \
  --url https://http.llm.model-cluster.on-prem.clusters.yotta-uat.cluster.s9t.link/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'id: <id>' \
  --data '
{
  "model": "gemma-it",
  "messages": [
    {
      "role": "user",
      "content": "what is 2+2?"
    }
  ],
  "stream": false,
  "max_tokens": 1024
}
'
{
"id": "chatcmpl-gemma-it-abc123",
"object": "chat.completion",
"created": 1699014493,
"model": "gemma-it",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "2 + 2 equals 4. This is a basic arithmetic operation where we add two numbers together to get their sum."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 24,
"total_tokens": 32
},
"system_fingerprint": "gemma-2-instruct-v1.0"
}

Authorizations

Authorization
string
header
required

JWT token for authentication - Use your API token as the Bearer token

Headers

id
string
default:54e4c0bb-11fc-40f6-94d0-5a6eca081345
required

Model UUID for the request (Gemma-IT model identifier)

Body

application/json
messages
object[]
required

Array of messages in the conversation

model
enum<string>
default:gemma-it
required

Model identifier for Gemma-IT

Available options:
gemma-it
stream
boolean
default:false

Whether to stream the response

temperature
number
default:0.7

Sampling temperature (0.0 to 2.0). Controls randomness in generation

Required range: 0 <= x <= 2
max_tokens
integer
default:1024

Maximum number of tokens to generate

Required range: 1 <= x <= 4096
top_p
number
default:0.9

Nucleus sampling parameter for controlling response diversity

Required range: 0 <= x <= 1
top_k
integer
default:40

Top-k sampling parameter for vocabulary selection

Required range: 1 <= x <= 100
stop
string[] | null

Sequences where the API will stop generating further tokens

Maximum array length: 4
frequency_penalty
number
default:0

Penalty for frequent tokens to reduce repetition

Required range: -2 <= x <= 2
presence_penalty
number
default:0

Penalty for new tokens to encourage topic diversity

Required range: -2 <= x <= 2
repetition_penalty
number
default:1

Penalty for repeating tokens (Gemma-specific parameter)

Required range: 0.1 <= x <= 2
do_sample
boolean
default:true

Whether to use sampling for generation

seed
integer | null

Random seed for reproducible outputs

system_prompt
string | null

System prompt to set model behavior (alternative to system message)

Response

Successful chat completion

  • Option 1
  • Option 2

Response for non-streaming chat completion

id
string

Unique identifier for the completion

Example:

"chatcmpl-gemma-it-abc123"

object
enum<string>

Object type

Available options:
chat.completion
Example:

"chat.completion"

created
integer

Unix timestamp of when the completion was created

Example:

1699014493

model
string

The model used for completion

Example:

"gemma-it"

choices
object[]
usage
object
system_fingerprint
string | null

System fingerprint for the model version

Example:

"gemma-2-instruct-v1.0"