대화에 OpenAI Chat Completions API를 사용합니다. 클래식 OpenAI 채팅 API 형식입니다.
/api/ai/v1/chat/completionsBearer YOUR_API_KEY| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
model | string | 필수 | 모델 이름, 예: deepseek-v4.1-flash, qwen3.8-max |
messages | array | 필수 | 다음 형식의 메시지 배열 |
max_tokens | integer | 선택 | 출력 토큰의 최대 개수 |
temperature | float | 선택 | 샘플링 온도, 무작위성 제어 (0-2) |
stream | boolean | 선택 | 스트리밍 응답 사용, SSE의 경우 true로 설정 |
| 파라미터 | 타입 | 설명 |
|---|---|---|
id | string | 고유 응답 식별자 |
model | string | 사용된 실제 모델 |
choices | array | 응답 선택 배열, 보통 첫 번째 선택 |
usage | object | 토큰 사용 통계 |
curl --location 'https://your-domain.com/api/ai/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"model": "deepseek-v4.1-flash",
"messages": [
{"role": "user", "content": "Hello, who are you?"}
],
"max_tokens": 1000,
"temperature": 0.7
}'import requests
response = requests.post(
"https://your-domain.com/api/ai/v1/chat/completions",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
json={
"model": "deepseek-v4.1-flash",
"messages": [
{"role": "user", "content": "Hello, who are you?"}
],
"max_tokens": 1000,
"temperature": 0.7
}
)
print(response.json())curl --location 'https://your-domain.com/api/ai/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"model": "deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 1000,
"stream": true
}'