Skip to main content
POST
/
v1
/
chat
/
completions
curl https://kymaapi.com/v1/chat/completions \
  -H "Authorization: Bearer kyma-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama-3.3-70b",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

Request body

model
string
required
Model ID to use. See available models.
messages
array
required
Array of message objects with role and content.
  • role: "system", "user", or "assistant"
  • content: The message text
temperature
number
default:"1"
Sampling temperature (0-2). Lower = more focused, higher = more creative.
max_tokens
number
Maximum tokens to generate in the response.
stream
boolean
default:"false"
Stream response tokens as server-sent events.
top_p
number
default:"1"
Nucleus sampling parameter (0-1).

Response

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1700000000,
  "model": "llama-3.3-70b-versatile",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 10,
    "total_tokens": 30
  }
}
curl https://kymaapi.com/v1/chat/completions \
  -H "Authorization: Bearer kyma-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama-3.3-70b",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'