EXAONE API Platform

K-EXAONE 2.5

POST /v1/chat/completions

EXAONE API Platform을 통해 K-EXAONE 2.5 모델을 호출할 수 있습니다. EXAONE API는 OpenAI Compatible API를 지원합니다.

K-EXAONE 2.5는 텍스트 전용 모델입니다.

최대 Context length는 524,288 토큰입니다. 입력 토큰 수와 max_tokens 의 합이 이 값을 넘으면 400 에러를 반환합니다.


요청 정보

FieldTypeDescriptionRequired
modelstringk-exaone_v2.5mandatory
messagesarray<object>대화 메시지 목록mandatory
messages[].rolestringsystem / user / assistantmandatory
messages[].contentstring프롬프트 / 질의 / 답변mandatory
max_tokensint생성할 최대 토큰 수 (추론 과정 포함). 입력 토큰 수 + max_tokens ≤ 524,288optional
streamboolean답변의 스트리밍 여부 (default: false)optional
stream_options.include_usageboolean스트리밍 응답의 마지막에 토큰 사용량(usage) 청크 포함 여부. stream: true 일 때만 사용 가능 (default: false)optional
temperaturefloat확률 분포의 '뾰족함'을 조절하여 답변의 무작위성을 결정. 범위: 0.0 ~ inf, 클수록 무작위성 커짐 (default: 1.0)optional
top_pfloat누적 확률 합이 p 이하인 상위 토큰 후보만 채택. 범위: 0.0 ~ 1.0 (default: 0.95)optional
top_kint가장 확률이 높은 상위 k개 토큰 후보만 채택. 범위: -1 또는 1 ~ N, -1 설정 시 필터링 비활성화 (default: -1)optional
presence_penaltyfloat이미 출현한 단어에 감점을 주어 반복 방지 및 새로운 주제 도입 유도. 범위: -2.0 ~ 2.0, 양수면 동일 토큰 발생 확률을 낮춤 (default: 0.0)optional
reasoning_effortstring추론(thinking) 강도. low / high / max , 높을수록 추론을 길게 수행 (default: max)optional
chat_template_kwargs.preserve_thinkingboolean멀티턴 대화에서 이전 assistant 턴의 추론 과정을 입력에 남길지 여부. false 면 마지막 유저 메시지 이후의 추론만 유지 (default: false)optional

응답 정보(stream: false)

FieldTypeDescription
bodyobjectOpenAI 표준 출력 방식의 Chat Completion Object

응답 정보(stream: true)

FieldTypeDescription
datastringSSE 기반 OpenAI Chat Completion Chunk

요청 예제(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
}'

응답 예제(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
  }
}

요청 예제(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
}'

응답 예제(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]