Quick Start
Get started with EXAONE API Platform and seamlessly integrate LG AI Research's EXAONE foundation models into your applications. Follow the sample code to make your first API call in just a few steps. For detailed API specifications and usage instructions, refer to the Endpoint page.
Make your first API call
The base URL for all API requests is https://api.exaone.ai. The API follows RESTful conventions and supports GET, POST, PATCH, and DELETE requests. Include your API key as a Bearer token in the Authorization header of every request.
API Request Format
application/json: The request body is sent as JSON.
API Response Format
text/event-stream: Streaming response. JSON chunks are sent sequentially.application/json: Standard response. The full response is sent as a single JSON object.
Example of API Request
JSON request (Content-Type: application/json)
Include your API key and request ID in the HTTP headers. Send a request body in the format defined for each API.
curl 'https://api.exaone.ai/v1/resource' \
-H "Authorization: Bearer $EXAONE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"param1": "value1",
"param2": "value2"
}'import requests
url = "https://api.exaone.ai/v1/resource"
headers = {
"Authorization": f"Bearer {EXAONE_API_KEY}",
"Content-Type": "application/json",
}
payload = {
"param1": "value1",
"param2": "value2",
}
response = requests.post(url=url, headers=headers, json=payload)
print(response.text)(async () => {
const url = 'https://api.exaone.ai/v1/resource';
const headers = {
Authorization: `Bearer ${EXAONE_API_KEY}`,
'Content-Type': 'application/json',
};
const payload = {
param1: 'value1',
param2: 'value2',
};
try {
const response = await fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload),
});
console.log(await response.json());
} catch (error) {
console.error('Error:', error);
}
})();The Authorization header must contain the API key issued by LG AI Research, in Bearer token format.
Write the request body in JSON format, following the API specification.
Example of API Response
Streaming response (Content-Type: text/event-stream)
With a streaming response, the server sends data to the client incrementally. A stream can be split at any point, so the client must read and process the data in complete JSON units.
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]JSON response (Content-Type: application/json)
The response is encoded in JSON. Depending on the API, it may include additional fields such as result_code and description.
{
"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
}
}Examples of API Request Failure
API requests can fail for a variety of reasons. For details, see the Error Codes page.
{
"result_code": 500,
"description": "The service is currently experiencing a temporary issue and cannot process your request. Please try again shortly."
}