curl --request POST \
--url https://api.example.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"model": "<string>",
"frequency_penalty": 0,
"logit_bias": {},
"logprobs": false,
"top_logprobs": 0,
"max_tokens": 123,
"max_completion_tokens": 123,
"n": 1,
"presence_penalty": 0,
"response_format": {
"type": "text",
"json_schema": {
"name": "<string>",
"description": "<string>",
"schema": {},
"strict": true
}
},
"seed": 0,
"stop": [],
"stream": false,
"stream_options": {
"include_usage": true,
"continuous_usage_stats": false
},
"temperature": 123,
"top_p": 123,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
},
"type": "function"
}
],
"tool_choice": "none",
"reasoning_effort": "low",
"include_reasoning": true,
"parallel_tool_calls": true,
"user": "<string>",
"use_beam_search": false,
"top_k": 123,
"min_p": 123,
"repetition_penalty": 123,
"length_penalty": 1,
"stop_token_ids": [],
"include_stop_str_in_output": false,
"ignore_eos": false,
"min_tokens": 0,
"skip_special_tokens": true,
"spaces_between_special_tokens": true,
"truncate_prompt_tokens": 0,
"prompt_logprobs": 123,
"allowed_token_ids": [
123
],
"bad_words": [
"<string>"
],
"echo": false,
"add_generation_prompt": true,
"continue_final_message": false,
"add_special_tokens": false,
"documents": [
{}
],
"chat_template": "<string>",
"chat_template_kwargs": {},
"mm_processor_kwargs": {},
"structured_outputs": {
"json": "<string>",
"regex": "<string>",
"choice": [
"<string>"
],
"grammar": "<string>",
"json_object": true,
"disable_fallback": false,
"disable_any_whitespace": false,
"disable_additional_properties": false,
"whitespace_pattern": "<string>",
"structural_tag": "<string>",
"_backend": "<string>",
"_backend_was_auto": false
},
"priority": 0,
"request_id": "<string>",
"logits_processors": [
"<string>"
],
"return_tokens_as_token_ids": true,
"return_token_ids": true,
"cache_salt": "<string>",
"kv_transfer_params": {},
"vllm_xargs": {}
}
'{
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"annotations": {
"type": "<string>",
"url_citation": {
"end_index": 123,
"start_index": 123,
"title": "<string>",
"url": "<string>"
}
},
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"function_call": {
"name": "<string>",
"arguments": "<string>"
},
"tool_calls": [
{
"function": {
"name": "<string>",
"arguments": "<string>"
},
"id": "<string>",
"type": "function"
}
],
"reasoning": "<string>",
"reasoning_content": "<string>"
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": -9999,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": -9999,
"bytes": [
123
]
}
]
}
]
},
"finish_reason": "stop",
"stop_reason": 123,
"token_ids": [
123
]
}
],
"usage": {
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 123
}
},
"id": "<string>",
"object": "chat.completion",
"created": 123,
"service_tier": "auto",
"system_fingerprint": "<string>",
"prompt_logprobs": [
{}
],
"prompt_token_ids": [
123
],
"kv_transfer_params": {}
}새 채팅 응답 생성
curl --request POST \
--url https://api.example.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"model": "<string>",
"frequency_penalty": 0,
"logit_bias": {},
"logprobs": false,
"top_logprobs": 0,
"max_tokens": 123,
"max_completion_tokens": 123,
"n": 1,
"presence_penalty": 0,
"response_format": {
"type": "text",
"json_schema": {
"name": "<string>",
"description": "<string>",
"schema": {},
"strict": true
}
},
"seed": 0,
"stop": [],
"stream": false,
"stream_options": {
"include_usage": true,
"continuous_usage_stats": false
},
"temperature": 123,
"top_p": 123,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
},
"type": "function"
}
],
"tool_choice": "none",
"reasoning_effort": "low",
"include_reasoning": true,
"parallel_tool_calls": true,
"user": "<string>",
"use_beam_search": false,
"top_k": 123,
"min_p": 123,
"repetition_penalty": 123,
"length_penalty": 1,
"stop_token_ids": [],
"include_stop_str_in_output": false,
"ignore_eos": false,
"min_tokens": 0,
"skip_special_tokens": true,
"spaces_between_special_tokens": true,
"truncate_prompt_tokens": 0,
"prompt_logprobs": 123,
"allowed_token_ids": [
123
],
"bad_words": [
"<string>"
],
"echo": false,
"add_generation_prompt": true,
"continue_final_message": false,
"add_special_tokens": false,
"documents": [
{}
],
"chat_template": "<string>",
"chat_template_kwargs": {},
"mm_processor_kwargs": {},
"structured_outputs": {
"json": "<string>",
"regex": "<string>",
"choice": [
"<string>"
],
"grammar": "<string>",
"json_object": true,
"disable_fallback": false,
"disable_any_whitespace": false,
"disable_additional_properties": false,
"whitespace_pattern": "<string>",
"structural_tag": "<string>",
"_backend": "<string>",
"_backend_was_auto": false
},
"priority": 0,
"request_id": "<string>",
"logits_processors": [
"<string>"
],
"return_tokens_as_token_ids": true,
"return_token_ids": true,
"cache_salt": "<string>",
"kv_transfer_params": {},
"vllm_xargs": {}
}
'{
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"annotations": {
"type": "<string>",
"url_citation": {
"end_index": 123,
"start_index": 123,
"title": "<string>",
"url": "<string>"
}
},
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"function_call": {
"name": "<string>",
"arguments": "<string>"
},
"tool_calls": [
{
"function": {
"name": "<string>",
"arguments": "<string>"
},
"id": "<string>",
"type": "function"
}
],
"reasoning": "<string>",
"reasoning_content": "<string>"
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": -9999,
"bytes": [
123
],
"top_logprobs": [
{
"token": "<string>",
"logprob": -9999,
"bytes": [
123
]
}
]
}
]
},
"finish_reason": "stop",
"stop_reason": 123,
"token_ids": [
123
]
}
],
"usage": {
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 123
}
},
"id": "<string>",
"object": "chat.completion",
"created": 123,
"service_tier": "auto",
"system_fingerprint": "<string>",
"prompt_logprobs": [
{}
],
"prompt_token_ids": [
123
],
"kv_transfer_params": {}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
사용자가 보낸 메시지와 관계없이 모델이 따라야 하는, 개발자가 제공한 지침입니다. o1 모델 및 이후 버전에서는 developer 메시지가 기존의 system 메시지를 대체합니다.
표시 하위 속성
표시 하위 속성
표시 하위 속성
-9223372036854776000 <= x <= 9223372036854776000표시 하위 속성
표시 하위 속성
"none"low, medium, high x >= -1true인 경우, 새 메시지가 이전 메시지와 같은 역할(role)을 가지면 새로운 메시지를 따로 추가하는 대신 이전 메시지에 이어 붙습니다.
true인 경우, 생성 프롬프트가 채팅 템플릿에 추가됩니다. 이는 모델의 토크나이저 설정(tokenizer config)에서 채팅 템플릿이 사용하는 파라미터입니다.
이 값을 설정하면, 채팅의 마지막 메시지가 EOS 토큰 없이 열린(open) 형태가 되도록 채팅이 포맷됩니다. 모델은 새 메시지를 시작하는 대신 이 마지막 메시지를 이어서 생성합니다. 이를 통해 모델이 생성할 응답의 일부를 미리 "prefill"할 수 있습니다. add_generation_prompt와 동시에 사용할 수 없습니다.
true인 경우, 특별 토큰(예: BOS)이 채팅 템플릿이 추가하는 내용에 더해 프롬프트에 추가됩니다. 대부분의 모델에서는 채팅 템플릿이 특별 토큰을 알아서 추가하므로, 이 옵션은 false(기본값)로 두는 것이 좋습니다.
RAG(retrieval‑augmented generation)을 수행하는 경우, 모델이 접근할 수 있는 문서들을 나타내는 dict 목록입니다. 템플릿이 RAG를 지원하지 않으면 이 인자는 아무 효과도 없습니다. 각 문서는 "title"과 "text" 키를 포함하는 dict로 구성하는 것을 권장합니다.
표시 하위 속성
이 변환에 사용할 Jinja 템플릿입니다. transformers v4.44 이상에서는 기본 채팅 템플릿이 더 이상 허용되지 않으므로, 토크나이저에 채팅 템플릿이 정의되어 있지 않다면 반드시 채팅 템플릿을 제공해야 합니다.
템플릿 렌더러에 전달할 추가 키워드 인자입니다. 채팅 템플릿에서 이 인자들에 접근할 수 있습니다.
HF 프로세서에 전달할 추가 kwargs입니다.
구조화된 출력에 사용할 추가 kwargs입니다.
표시 하위 속성
요청의 우선순위입니다(값이 낮을수록 더 빨리 처리됨; 기본값: 0). 사용 중인 모델이 우선순위 스케줄링을 지원하지 않는 경우 0 이외의 우선순위를 설정하면 오류가 발생합니다.
이 요청과 연결된 request_id입니다. 호출자가 값을 지정하지 않으면 random_uuid가 생성됩니다. 이 ID는 추론(inference) 전체 과정에서 사용되며, 응답에도 함께 반환됩니다.
샘플링 시 적용할 logits processor의 정규화된 이름(qualified name) 목록 또는 생성자(constructor) 객체 목록입니다. 생성자는 JSON 객체이며, processor 클래스/팩토리의 정규화된 이름을 지정하는 필수 필드인 'qualname'과, 위치 인자와 키워드 인자를 담는 선택적 필드인 'args'와 'kwargs'를 포함합니다. 예: {'qualname': 'my_module.MyLogitsProcessor', 'args': [1, 2], 'kwargs': {'param': 'value'}}.
'logprobs'와 함께 지정된 경우, 토큰은 JSON으로 인코딩할 수 없는 토큰을 식별할 수 있도록 'token_id:{token_id}' 형식의 문자열로 표현됩니다.
지정하면 결과에 생성된 텍스트와 함께 토큰 ID가 포함됩니다. 스트리밍 모드에서는 prompt_token_ids 가 첫 번째 청크에만 포함되며, token_ids 는 각 청크에 대한 변경분(델타) 토큰을 포함합니다. 이는 디버깅을 하거나 생성된 텍스트를 입력 토큰으로 다시 매핑해야 할 때 유용합니다.
지정하면, 다중 사용자 환경에서 공격자가 프롬프트를 추측하지 못하도록 제공된 문자열로 프리픽스 캐시에 솔트(salt)를 적용합니다. 솔트는 무작위여야 하고, 제3자가 접근하지 못하도록 보호되어야 하며, 예측이 불가능할 정도로 충분히 길어야 합니다(예: 256비트에 해당하는 43자 길이의 base64 인코딩 문자열).
분리형 서빙(disaggregated serving) 구성에서 사용되는 KVTransfer 파라미터입니다.
커스텀 확장에서 사용하는, 문자열 또는 숫자 값(또는 그 리스트)을 받을 수 있는 추가 요청 파라미터입니다.
표시 하위 속성
성공 응답
표시 하위 속성
표시 하위 속성
"chat.completion"auto, default, flex, scale, priority 표시 하위 속성
KVTransfer 파라미터입니다.