curl --request POST \
--url 'https://api.elkapi.com/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요"
}
],
"temperature": 1,
"stream": false,
"max_tokens": 1024,
"response_format": "json"
}'
import requests
url = "https://api.elkapi.com/v1/chat/completions"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요"
}
],
"temperature": 1,
"stream": False,
"max_tokens": 1024,
"response_format": "json"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/chat/completions";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요"
}
],
"temperature": 1,
"stream": false,
"max_tokens": 1024,
"response_format": "json"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"object": "chat.completion",
"created": 1,
"model": "gpt-5.5",
"choices": [
{
"index": 1,
"message": {
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요",
"name": "name",
"tool_calls": [
{
"id": {},
"type": {},
"function": {}
}
],
"tool_call_id": "tool_call_id",
"reasoning_content": "reasoning_content"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"text_tokens": 1,
"audio_tokens": 1,
"image_tokens": 1
},
"completion_tokens_details": {
"text_tokens": 1,
"audio_tokens": 1,
"reasoning_tokens": 1
}
},
"system_fingerprint": "system_fingerprint"
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
네이티브 OpenAI 형식
Chat Completions
- 대화 기록을 기반으로 모델 응답을 생성합니다. 스트리밍 및 비스트리밍 응답을 지원합니다.
- OpenAI Chat Completions API와 호환됩니다.
POST
/
v1
/
chat
/
completions
curl --request POST \
--url 'https://api.elkapi.com/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요"
}
],
"temperature": 1,
"stream": false,
"max_tokens": 1024,
"response_format": "json"
}'
import requests
url = "https://api.elkapi.com/v1/chat/completions"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요"
}
],
"temperature": 1,
"stream": False,
"max_tokens": 1024,
"response_format": "json"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/chat/completions";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요"
}
],
"temperature": 1,
"stream": false,
"max_tokens": 1024,
"response_format": "json"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"object": "chat.completion",
"created": 1,
"model": "gpt-5.5",
"choices": [
{
"index": 1,
"message": {
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요",
"name": "name",
"tool_calls": [
{
"id": {},
"type": {},
"function": {}
}
],
"tool_call_id": "tool_call_id",
"reasoning_content": "reasoning_content"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"text_tokens": 1,
"audio_tokens": 1,
"image_tokens": 1
},
"completion_tokens_details": {
"text_tokens": 1,
"audio_tokens": 1,
"reasoning_tokens": 1
}
},
"system_fingerprint": "system_fingerprint"
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
curl --request POST \
--url 'https://api.elkapi.com/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요"
}
],
"temperature": 1,
"stream": false,
"max_tokens": 1024,
"response_format": "json"
}'
import requests
url = "https://api.elkapi.com/v1/chat/completions"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요"
}
],
"temperature": 1,
"stream": False,
"max_tokens": 1024,
"response_format": "json"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/chat/completions";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요"
}
],
"temperature": 1,
"stream": false,
"max_tokens": 1024,
"response_format": "json"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"object": "chat.completion",
"created": 1,
"model": "gpt-5.5",
"choices": [
{
"index": 1,
"message": {
"role": "user",
"content": "안녕하세요, 자기소개를 해 주세요",
"name": "name",
"tool_calls": [
{
"id": {},
"type": {},
"function": {}
}
],
"tool_call_id": "tool_call_id",
"reasoning_content": "reasoning_content"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"text_tokens": 1,
"audio_tokens": 1,
"image_tokens": 1
},
"completion_tokens_details": {
"text_tokens": 1,
"audio_tokens": 1,
"reasoning_tokens": 1
}
},
"system_fingerprint": "system_fingerprint"
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
{
"error": {
"message": "message",
"type": "type",
"param": "param",
"code": "code"
}
}
Authorizations
string
필수
모든 엔드포인트는 Bearer Token 인증이 필요합니다.요청 헤더에 추가하세요:
Authorization: Bearer YOUR_API_KEY
Body
string
기본값:"gpt-5.5"
필수
모델 ID예시:
gpt-5.5array<object>
필수
number
기본값:"1"
샘플링 온도
number
기본값:"1"
뉴클리어스 샘플링 파라미터
integer
기본값:"1"
생성 수
boolean
기본값:"false"
스트리밍 응답 여부
string or array<string>
중지 시퀀스
integer
최대 생성 토큰 수
integer
최대 완성 토큰 수
number
기본값:"0"
number
기본값:"0"
object
string
integer
string
추론 강도(추론 지원 모델용)허용 값:
low, medium, higharray<string>
Response
string
string
예시:
chat.completioninteger
string
기본값:"gpt-5.5"
예시:
gpt-5.5array<object>
object
string