curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3.1-pro",
"max_tokens": 2048,
"messages": [
{
"role": "user",
"content": "컨텍스트 캐시를 한 문장으로 설명해 주세요."
}
]
}
'{
"id": "chatcmpl-6adc72c2b5847b4b2ccb39fd",
"type": "message",
"role": "assistant",
"model": "kimi-k3.1-pro",
"content": [
{
"type": "text",
"thinking": "<string>",
"signature": "<string>",
"text": "컨텍스트 캐시는 요청에서 반복되는 접두사 내용을 저장하여 이후 요청이 캐시에 적중하면 더 빠르고 저렴하게 처리할 수 있게 합니다."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 24,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0,
"output_tokens": 96
}
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}Kimi API(모든 모델) - Messages 빠른 시작
- Anthropic Messages 프로토콜로 Kimi 모델을 호출하고
model로 모델을 선택합니다 model,max_tokens,messages만 필요합니다(Anthropic 프로토콜에서max_tokens는 필수)- 세 모델 모두 컨텍스트 창은 1,048,576 tokens입니다
- 세 모델 모두 추론이 항상 활성화되며 강도는
output_config.effort로 설정합니다 - 도구 호출, 웹 검색, 이미지 입력, 구조화된 출력, 캐시 설정은 전체 참조를 확인하세요
curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3.1-pro",
"max_tokens": 2048,
"messages": [
{
"role": "user",
"content": "컨텍스트 캐시를 한 문장으로 설명해 주세요."
}
]
}
'{
"id": "chatcmpl-6adc72c2b5847b4b2ccb39fd",
"type": "message",
"role": "assistant",
"model": "kimi-k3.1-pro",
"content": [
{
"type": "text",
"thinking": "<string>",
"signature": "<string>",
"text": "컨텍스트 캐시는 요청에서 반복되는 접두사 내용을 저장하여 이후 요청이 캐시에 적중하면 더 빠르고 저렴하게 처리할 수 있게 합니다."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 24,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0,
"output_tokens": 96
}
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}https://direct.evolink.ai이며 텍스트 모델과 장시간 연결을 더 잘 지원합니다. https://api.evolink.ai는 멀티모달 서비스의 기본 엔드포인트이자 텍스트 모델의 대체 주소입니다.content에는 보통 type="thinking" 블록이 포함되며 출력 토큰에 반영됩니다. max_tokens를 너무 작게 설정하면 추론 중 출력 예산을 모두 사용하여 응답 본문이 없을 수 있습니다.인증
##모든 API에는 Bearer Token 인증이 필요합니다##
API Key 발급:
API Key 관리 페이지에서 API Key를 발급받으세요
요청 헤더에 추가:
Authorization: Bearer YOUR_API_KEY
본문
호출할 모델:
| 모델 ID | 특성 |
|---|---|
kimi-k3.1-pro | 최신 세대 모델(권장) |
kimi-k3.1-pro-highspeed | Pro와 동일한 매개변수, 더 빠른 생성 |
kimi-k3 | 이전 세대 모델 |
세 모델 모두 컨텍스트 창은 1,048,576 tokens이며 추론이 항상 활성화됩니다.
kimi-k3.1-pro, kimi-k3.1-pro-highspeed, kimi-k3 이번 생성에 허용된 최대 토큰 수. thinking과 최종 텍스트를 포함합니다. 값이 너무 작으면 추론 중 출력 예산을 모두 사용하여 본문이 없을 수 있습니다. 최소 1024를 권장하며 작업 복잡도에 따라 늘리세요.
1 <= x <= 1048576대화 메시지. 여러 턴의 대화에서는 이전 메시지를 순서대로 포함하세요. 추론과 도구 호출 기록을 다시 보내는 방법은 전체 참조를 확인하세요.
1Show child attributes
Show child attributes
system 프롬프트입니다. Messages 프로토콜은 system 역할 대신 최상위 system 필드를 사용합니다.
출력 설정.
Show child attributes
Show child attributes
Anthropic SSE 이벤트 스트림 반환 여부입니다.
응답
Message 응답입니다. 스트리밍 요청은 Anthropic SSE 이벤트 스트림을 반환합니다
응답 ID.
"chatcmpl-6adc72c2b5847b4b2ccb39fd"
message "message"
assistant "assistant"
이번 호출에 사용한 모델.
"kimi-k3.1-pro"
출력 콘텐츠 블록. 보통 thinking 다음에 text가 옵니다.
Show child attributes
Show child attributes
중지 사유: end_turn은 자연스러운 종료, max_tokens는 출력 한도 도달, tool_use는 모델의 도구 호출 요청입니다.
end_turn, max_tokens, tool_use, null "end_turn"
Show child attributes
Show child attributes