K-EXAONE 2.5
POST /v1/chat/completions
The K-EXAONE 2.5 model is available through the EXAONE API Platform. The EXAONE API is OpenAI-compatible.
K-EXAONE 2.5 is a text-only model.
The maximum context length is 524,288 tokens. If the number of input tokens plus max_tokens exceeds this limit, the API returns a 400 error.
Request
| Field | Type | Description | Required |
|---|---|---|---|
| model | string | k-exaone_v2.5 | mandatory |
| messages | array<object> | List of messages in the conversation | mandatory |
| messages[].role | string | system / user / assistant | mandatory |
| messages[].content | string | Content of the message: a prompt, query, or response | mandatory |
| max_tokens | int | Maximum number of tokens to generate, including the reasoning process. Input tokens + max_tokens โค 524,288 | optional |
| stream | boolean | Whether to stream the response (default: false) | optional |
| stream_options.include_usage | boolean | Whether to include a token usage chunk at the end of the stream. Available only when stream is true. (Default: false) | optional |
| temperature | float | Controls the randomness of the output by adjusting how sharp the probability distribution is. Higher values produce more random output. Range: 0.0 or higher. (Default: 1.0) | optional |
| top_p | float | Samples only from the smallest set of top tokens whose cumulative probability is within p. (Range: 0.0~1.0, Default: 0.95) | optional |
| top_k | int | Samples only from the k most likely tokens. Range: -1, or 1 or higher. Set to -1 to disable filtering. (Default: -1) | optional |
| presence_penalty | float | Penalizes tokens that have already appeared, which reduces repetition and encourages new topics. Positive values make repeated tokens less likely. (Range: -2.0~2.0. Default: 0.0) | optional |
| reasoning_effort | string | Reasoning (thinking) intensity: low / high / max. Higher values produce longer reasoning (default: max) | optional |
| chat_template_kwargs.preserve_thinking | boolean | Whether to keep the reasoning content of previous assistant turns in the input for multi-turn conversations. If false, only the reasoning after the last user message is kept (default: false) | optional |
Response(stream: false)
| Field | Type | Description |
|---|---|---|
| body | object | A chat completion object in the standard OpenAI format |
Response(stream: true)
| Field | Type | Description |
|---|---|---|
| data | string | An OpenAI chat completion chunk sent over SSE |
Example request(stream: false)
curl 'https://api.exaone.ai/v1/chat/completions' \
-H "Authorization: Bearer $EXAONE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "k-exaone_v2.5",
"max_tokens": 512,
"messages": [
{
"role": "user",
"content": "Hi, EXAONE"
}
],
"stream": false
}'import requests
url = "https://api.exaone.ai/v1/chat/completions"
headers = {
"Authorization": f"Bearer {EXAONE_API_KEY}",
"Content-Type": "application/json",
}
payload = {
"model": "k-exaone_v2.5",
"messages": [{"role": "user", "content": "Hi, EXAONE"}],
"stream": False,
}
response = requests.post(url=url, headers=headers, json=payload)
print(response.text)(async () => {
const url = 'https://api.exaone.ai/v1/chat/completions';
const headers = {
Authorization: `Bearer ${process.env.EXAONE_API_KEY}`,
'Content-Type': 'application/json',
};
const payload = {
model: 'k-exaone_v2.5',
max_tokens: 512,
messages: [{ role: 'user', content: 'Hi, EXAONE' }],
stream: false,
};
try {
const response = await fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload),
});
console.log(await response.text());
} catch (error) {
console.error('Error:', error);
}
})();Example response(stream: false)
{
"id": "1f30a3635ebd4e4cb57e4d41e2f18d55",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "\n\nHello! How can I help you today?",
"refusal": null,
"role": "assistant",
"annotations": null,
"audio": null,
"function_call": null,
"tool_calls": null,
"reasoning_content": "We need answer to user \"Hi, EXAONE\". We are AI assistant accessed via API. Need respond. We shouldn't claim EXAONE? We are likely not EXAONE, unless system? The system prompt is how am I supposed to behave, no identity. User says Hi, EXAONE. We can greet back, maybe clarify: I'm EXAONE? Need be honest. We are not necessarily called EXAONE. However no explicit model identity. In API, maybe they are addressing assistant. We can say \"Hi! I'm an AI assistant. How can I help?\" If this is a test? They said \"Hi, EXAONE\", maybe expect assistant to identify as EXAONE? We need not misrepresent. If team? There is no identity, so safest: \"Hi! I don't have a name, but happy to help.\" But user might be talking to EXAONE model (LG AI Research). We shouldn't claim if not. Maybe \"Hello! How can I assist you today?\" Simple. Could mention \"I can try.\" Since asked just hi, no need. Final answer.\n"
},
"matched_stop": 53
}
],
"created": 1793945790,
"model": "k-exaone_v2.5",
"object": "chat.completion",
"metadata": {
"weight_version": "default",
"weight_versions": [{ "version": "default", "start": 0, "end": 218 }]
},
"moderation": null,
"service_tier": null,
"system_fingerprint": null,
"usage": {
"completion_tokens": 218,
"prompt_tokens": 22,
"total_tokens": 240,
"completion_tokens_details": null,
"prompt_tokens_details": null,
"reasoning_tokens": 209
}
}Example request(stream: true)
curl 'https://api.exaone.ai/v1/chat/completions' \
-H "Authorization: Bearer $EXAONE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "k-exaone_v2.5",
"max_tokens": 512,
"messages": [
{
"role": "user",
"content": "Hi, EXAONE"
}
],
"stream": true
}'import requests
url = "https://api.exaone.ai/v1/chat/completions"
headers = {
"Authorization": f"Bearer {EXAONE_API_KEY}",
"Content-Type": "application/json",
}
payload = {
"model": "k-exaone_v2.5",
"max_tokens": 512,
"messages": [{"role": "user", "content": "Hi, EXAONE"}],
"stream": True,
}
with requests.post(url=url, headers=headers, json=payload, stream=True) as response:
for line in response.iter_lines(decode_unicode=True):
if line:
print(line)(async () => {
const url = 'https://api.exaone.ai/v1/chat/completions';
const headers = {
Authorization: `Bearer ${process.env.EXAONE_API_KEY}`,
'Content-Type': 'application/json',
};
const payload = {
model: 'k-exaone_v2.5',
max_tokens: 512,
messages: [{ role: 'user', content: 'Hi, EXAONE' }],
stream: true,
};
try {
const response = await fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload),
});
const decoder = new TextDecoder();
for await (const chunk of response.body) {
process.stdout.write(decoder.decode(chunk, { stream: true }));
}
} catch (error) {
console.error('Error:', error);
}
})();Example response(stream: true)
data: {"id": "2fa2bf0467cf4d758fe4c4dba28f2b18", "choices": [{"delta": {"content": "", "role": "assistant"}, "index": 0}], "created": 1793947427, "model": "k-exaone_v2.5", "object": "chat.completion.chunk"}
data: {"id": "2fa2bf0467cf4d758fe4c4dba28f2b18", "choices": [{"delta": {"reasoning_content": "We"}, "index": 0}], "created": 1793947427, "model": "k-exaone_v2.5", "object": "chat.completion.chunk"}
data: {"id": "2fa2bf0467cf4d758fe4c4dba28f2b18", "choices": [{"delta": {"reasoning_content": " need"}, "index": 0}], "created": 1793947427, "model": "k-exaone_v2.5", "object": "chat.completion.chunk"}
data: {"id": "2fa2bf0467cf4d758fe4c4dba28f2b18", "choices": [{"delta": {"reasoning_content": " answer to"}, "index": 0}], "created": 1793947427, "model": "k-exaone_v2.5", "object": "chat.completion.chunk"}
data: {"id": "2fa2bf0467cf4d758fe4c4dba28f2b18", "choices": [{"delta": {"reasoning_content": " user. They said \"Hi"}, "index": 0}], "created": 1793947427, "model": "k-exaone_v2.5", "object": "chat.completion.chunk"}
...
data: {"id": "2fa2bf0467cf4d758fe4c4dba28f2b18", "choices": [{"delta": {"content": "how"}, "index": 0}], "created": 1793947427, "model": "k-exaone_v2.5", "object": "chat.completion.chunk"}
data: {"id": "2fa2bf0467cf4d758fe4c4dba28f2b18", "choices": [{"delta": {"content": " can I help you today? ๐"}, "index": 0}], "created": 1793947427, "model": "k-exaone_v2.5", "object": "chat.completion.chunk"}
data: {"id": "2fa2bf0467cf4d758fe4c4dba28f2b18", "choices": [{"delta": {}, "finish_reason": "stop", "index": 0, "matched_stop": 53}], "created": 1793947427, "model": "k-exaone_v2.5", "object": "chat.completion.chunk"}
data: {"id": "2fa2bf0467cf4d758fe4c4dba28f2b18", "choices": [], "created": 1793947427, "model": "k-exaone_v2.5", "object": "chat.completion.chunk", "usage": {"completion_tokens": 234, "prompt_tokens": 22, "total_tokens": 256, "reasoning_tokens": 216}}
data: [DONE]