API Reference
API Reference 개요
Simple AI Inference에서 지원하는 API Reference는 다음과 같습니다.
| API명 | API | 상세 설명 |
|---|
| Chat Completions API | POST /v1/chat/completions | OpenAI의 Completions API와 호환되며 OpenAI Python client에서 사용할 수 있습니다. |
| Completions API | POST /v1/completions | OpenAI의 Completions API와 호환되며 OpenAI Python client에서 사용할 수 있습니다. |
| Embedding API | POST /v1/embeddings | 텍스트를 고차원 벡터(임베딩)로 변환하여, 텍스트 간 유사도 계산, 클러스터링, 검색 등 다양한 자연어 처리(NLP) 작업에 활용할 수 있습니다. |
| Rerank API | POST /v2/rerank | 임베딩 모델이나 크로스 인코더 모델을 적용하여 단일 쿼리와 문서 목록의 각 항목 간 관련성을 예측합니다. |
| Responses API | POST /v1/responses | OpenAI의 Responses API와 호환되며 텍스트, 이미지, 파일 입력으로 텍스트 또는 JSON 출력을 생성할 수 있으며, 함수 호출 및 빌트인 도구를 지원합니다. |
| Tokenize API | POST /tokenize | 텍스트를 토큰 ID로 변환합니다. Completion 방식과 Chat 방식을 지원합니다. |
| Models API | GET /v1/models | 배포된 모델의 목록을 반환합니다. OpenAI의 Models API와 호환됩니다. |
표. Simple AI Inference 지원 API 목록
Chat Completions API
POST /v1/chat/completions
개요
Chat Completions API는 OpenAI의 Completions API와 호환되며 OpenAI Python client에서 사용할 수 있습니다.
Request
Context
| Key | Type | Description | Example |
|---|
| Base URL | string | API 요청을 위한 Simple AI Inference URL | Simple AI Inference 엔드포인트 |
| Request Method | string | API 요청에 사용되는 HTTP 메서드 | POST |
| Headers | object | 요청 시 필요한 헤더 정보 | { “Content-Type”: “application/json”, “Authorization”: “bearer sai-xxxxxxx…” } |
| Body Parameters | object | 요청 본문에 포함되는 파라미터 | {“model”: “google/gemma-4-31B-it”, “messages”: [{“role”: “user”, “content”: “hello”}], “stream”: true } |
표. Chat Completions API - Context
Path Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Chat Completions API - Path Parameters
Query Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Chat Completions API - Query Parameters
Body Parameters
| Name | Name Sub | type | Required | Description | Default value | Boundary value | Example |
|---|
| model | - | string | ✅ | 응답 생성에 사용할 모델을 지정 | | | “google/gemma-4-31B-it” |
| messages | role | string | ✅ | 대화 내역을 포함하는 메시지 리스트 | | | [ { “role” : “user” , “content” : “message” }] |
| frequency_penalty | - | number | ❌ | 반복되는 토큰에 대한 패널티를 조정 | 0 | -2.0 ~ 2.0 | 0.5 |
| logit_bias | - | object | ❌ | 특정 토큰의 확률을 조정(예시: { “100”: 2.0 }) | null | Key: 토큰 ID, Value: -100 ~ 100 | { “100”: 2.0 } |
| logprobs | - | boolean | ❌ | 상위 logprobs 개수의 토큰 확률을 반환 | false | true, false | true |
| max_completion_tokens | - | integer | ❌ | 최대 생성 토큰 수를 제한 | None | 0 ~ 모델 최대값 | 100 |
| max_tokens (Deprecated) | - | integer | ❌ | 최대 생성 토큰 수를 제한 | None | 0 ~ 모델 최대값 | 100 |
| n | - | integer | ❌ | 생성할 응답 개수를 지정 | 1 | | 3 |
| presence_penalty | - | number | ❌ | 기존 텍스트에 포함된 토큰에 대한 패널티를 조정 | 0 | -2.0 ~ 2.0 | 1.0 |
| seed | - | integer | ❌ | 랜덤성 제어를 위한 시드 값을 지정 | None | | |
| stop | - | string / array / null | ❌ | 특정 문자열이 나타나면 생성을 중단 | null | | "\n" |
| stream | - | boolean | ❌ | 스트리밍 방식으로 결과를 반환할지 여부 | false | true/false | true |
| stream_options | include_usage, continuous_usage_stats | object | ❌ | 스트리밍 옵션을 제어(예시: 사용량 통계 포함 여부) | null | | { “include_usage”: true } |
| temperature | - | number | ❌ | 생성 결과의 창의성을 조절(높을수록 무작위) | 1 | 0.0 ~ 1.0 | 0.7 |
| tool_choice | - | string | ❌ | 어떤 Tool이 모델에 의해 호출될지 조정- auto: 모델이 메시지를 생성할지 Tool을 호출할지 선택
- required: 모델이 1개 이상의 Tool을 호출
| | | |
| tools | - | array | ❌ | 모델이 호출할 수 있는 Tool의 리스트 | None | | |
| top_logprobs | - | integer | ❌ | 0과 20사이의 정수 가장 확률이 높은 토큰의 수를 지정- completions에 대한 top k에 대한 확률값을 보여 줌
| None | 0 ~ 20 | 3 |
| top_p | - | number | ❌ | 토큰의 샘플링 확률을 제한(높을수록 더 많은 토큰 고려) | 1 | 0.0 ~ 1.0 | 0.9 |
| prompt_safety_model | - | string | ❌ | Prompt 검사를 위한 guard 모델 지정. 설정 시 guard 모델로 prompt를 먼저 검사하며, unsafe로 판단되면 guard 결과를 반환하고 safe이면 model 파라미터에 지정된 모델로 요청을 처리 | | | “meta-llama/Llama-Guard-4-12B” |
| chat_template_kwargs | - | object | ❌ | 템플릿 렌더러에 전달할 추가 키워드 인자. 모델별 reasoning 설정을 위해 사용(자세한 내용은 Reasoning 설정 참고) | null | | { “enable_thinking”: true } |
표. Chat Completions API - Body Parameters
Example
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/chat/completions \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "google/gemma-4-31B-it",
"messages": [
{
"role": "assistant",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "한국의 수도는 어디입니까?"
}
]
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/chat/completions \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "google/gemma-4-31B-it",
"messages": [
{
"role": "assistant",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "한국의 수도는 어디입니까?"
}
]
}'
코드 블럭. Chat Completions API Request ExampleResponse
200 OK
| Name | Type | Description |
|---|
| id | string | 응답의 고유 식별자 |
| object | string | 응답 객체의 타입(예시: “chat.completion”) |
| created | integer | 생성 시각(Unix timestamp, 초 단위) |
| model | string | 사용된 모델의 이름 |
| choices | array | 생성된 응답 선택지 목록 |
| choices[].index | integer | 해당 choice의 인덱스 |
| choices[].message | object | 생성된 메시지 객체 |
| choices[].message.role | string | 메시지 작성자의 역할(예시: “assistant”) |
| choices[].message.content | string | 생성된 메시지의 실제 내용 |
| choices[].message.reasoning | string | 생성된 추론 메시지의 실제 내용 |
| choices[].message.tool_calls | array (optional) | 도구 호출 정보(모델/설정에 따라 포함될 수 있음) |
| choices[].finish_reason | string or null | 응답이 종료된 이유(예시: “stop”, “length” 등) |
| choices[].stop_reason | object or null | 추가 중단 이유 세부 정보 |
| choices[].logprobs | object or null | 토큰 별 로그 확률 정보(설정에 따라 포함) |
| usage | object | 토큰 사용량 통계 |
| usage.prompt_tokens | integer | 입력 프롬프트에 사용된 토큰 수 |
| usage.completion_tokens | integer | 생성된 응답에 사용된 토큰 수 |
| usage.total_tokens | integer | 전체 토큰 수(입력 + 출력) |
표. Chat Completions API - 200 OK
Error Code
| HTTP status code | ErrorCode 설명 |
|---|
| 400 | Bad Request |
| 422 | Prompt Guard 등 정책에 의해 요청이 거절된 경우 |
| 500 | Internal Server Error |
표. Chat Completions API - Error Code
Example
{
"id": "chatcmpl-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"object": "chat.completion",
"created": 1749702816,
"model": "google/gemma-4-31B-it",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"reasoning": null,
"content": "한국의 수도는 서울입니다.",
"tool_calls": []
},
"logprobs": null,
"finish_reason": "stop",
"stop_reason": null
}
],
"usage": {
"prompt_tokens": 54,
"total_tokens": 62,
"completion_tokens": 8,
"prompt_tokens_details": null
},
"prompt_logprobs": null
}
{
"id": "chatcmpl-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"object": "chat.completion",
"created": 1749702816,
"model": "google/gemma-4-31B-it",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"reasoning": null,
"content": "한국의 수도는 서울입니다.",
"tool_calls": []
},
"logprobs": null,
"finish_reason": "stop",
"stop_reason": null
}
],
"usage": {
"prompt_tokens": 54,
"total_tokens": 62,
"completion_tokens": 8,
"prompt_tokens_details": null
},
"prompt_logprobs": null
}
코드 블럭. Chat Completions API Response ExamplePrompt Guard 응답
prompt_safety_model 파라미터를 설정한 경우, guard 모델이 prompt를 먼저 검사합니다.
- safe:
model 파라미터에 지정된 모델로 요청이 그대로 처리됩니다. - unsafe: 아래와 같은 형태의 guard 결과를 반환하며 요청이 중단됩니다.
{
"guard_result": "unsafe",
"categories": ["S1", "S2"],
"categories_description": ["Violent Crimes", "Non-Violent Crimes"],
"messages": [
"Cannot fulfill the request due to violent content.",
"Cannot respond as it may promote illegal activities."
]
}
{
"guard_result": "unsafe",
"categories": ["S1", "S2"],
"categories_description": ["Violent Crimes", "Non-Violent Crimes"],
"messages": [
"Cannot fulfill the request due to violent content.",
"Cannot respond as it may promote illegal activities."
]
}
코드 블럭. Chat Completions API Prompt Guard 응답 Example (unsafe)Reasoning 설정
chat_template_kwargs 파라미터를 통해 모델별 reasoning(추론 모드) 설정을 제어할 수 있습니다. 모델마다 기본 동작과 지원하는 옵션이 다릅니다.
| 모델 | 기본 reasoning | chat_template_kwargs 설정 | 설명 |
|---|
| zai-org/GLM-5.2 | 켜짐 (Think Max) | - Think Max(기본):
{“reasoning_effort”: “max”} 또는 생략 — 가장 깊은 추론 - Think High:
{“reasoning_effort”: “high”} — 균형된 깊이와 지연 - Non-think:
{“enable_thinking”: false} — 빠른 응답, 추론 없음
| reasoning_effort로 추론 깊이 조절, enable_thinking=false로 비활성화 |
| Qwen/Qwen3.6-27B | 켜짐 | - 비활성화:
{“enable_thinking”: false}
| 기본적으로 reasoning이 활성화되어 있으며, 필요시 비활성화 가능 |
| google/gemma-4-31B-it | 꺼짐 | - 활성화:
{“enable_thinking”: true}
| 기본적으로 reasoning이 비활성화되어 있으며, 필요시 활성화 가능 |
| openai/gpt-oss-120b | medium | {“reasoning_effort”: “low”}{“reasoning_effort”: “medium”} (기본){“reasoning_effort”: “high”}
| reasoning_effort로 추론 깊이 조절 (기본값: medium) |
표. Chat Completions API - 모델별 Reasoning 설정
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/chat/completions \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "zai-org/GLM-5.2",
"messages": [
{
"role": "user",
"content": "복잡한 수학 문제를 풀어주세요."
}
],
"chat_template_kwargs": {
"reasoning_effort": "high"
}
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/chat/completions \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "zai-org/GLM-5.2",
"messages": [
{
"role": "user",
"content": "복잡한 수학 문제를 풀어주세요."
}
],
"chat_template_kwargs": {
"reasoning_effort": "high"
}
}'
코드 블럭. Chat Completions API Reasoning 설정 Example참고
Completions API
개요
Completions API는 OpenAI의 Completions API와 호환되며 OpenAI Python client에서 사용할 수 있습니다.
Request
Context
| Key | Type | Description | Example |
|---|
| Base URL | string | API 요청을 위한 Simple AI Inference URL | Simple AI Inference 엔드포인트 |
| Request Method | string | API 요청에 사용되는 HTTP 메서드 | POST |
| Headers | object | 요청 시 필요한 헤더 정보 | { “Content-Type”: “application/json”, “Authorization”: “bearer sai-xxxxxxx…” } |
| Body Parameters | object | 요청 본문에 포함되는 파라미터 | {“model”: “google/gemma-4-31B-it”, “prompt” : “hello”, “stream”: true } |
표. Completions API - Context
Path Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Completions API - Path Parameters
Query Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Completions API - Query Parameters
Body Parameters
| Name | Name Sub | type | Required | Description | Default value | Boundary value | Example |
|---|
| model | - | string | ✅ | 응답 생성에 사용할 모델을 지정 | | | “google/gemma-4-31B-it” |
| prompt | - | array, string | ✅ | 사용자 입력 텍스트 | | | "" |
| echo | - | boolean | ❌ | 입력 텍스트를 출력에 포함시킬지 여부 | false | true/false | true |
| frequency_penalty | - | number | ❌ | 반복되는 토큰에 대한 패널티를 조정 | 0 | -2.0 ~ 2.0 | 0.5 |
| logit_bias | - | object | ❌ | 특정 토큰의 확률을 조정 (예시: { “100”: 2.0 }) | null | Key: 토큰 ID, Value: -100~100 | { “100”: 2.0 } |
| logprobs | - | integer | ❌ | 상위 logprobs 개수의 토큰 확률을 반환 | null | 1 ~ 5 | 5 |
| max_completion_tokens | - | integer | ❌ | 최대 생성 토큰 수를 제한 | None | 0~모델 최대 값 | 100 |
| max_tokens (Deprecated) | - | integer | ❌ | 최대 생성 토큰 수를 제한 | None | 0~모델 최대 값 | 100 |
| n | - | integer | ❌ | 생성할 응답 개수를 지정 | 1 | | 3 |
| presence_penalty | - | number | ❌ | 기존 텍스트에 포함된 토큰에 대한 패널티를 조정 | 0 | -2.0 ~ 2.0 | 1.0 |
| seed | - | integer | ❌ | 랜덤성 제어를 위한 시드값을 지정 | None | | |
| stop | - | string / array / null | ❌ | 특정 문자열이 나타나면 생성을 중단 | null | | "\n" |
| stream | - | boolean | ❌ | 스트리밍 방식으로 결과를 반환할지 여부 | false | true/false | true |
| stream_options | include_usage, continuous_usage_stats | object | ❌ | 스트리밍 옵션을 제어 (예시: 사용량 통계 포함 여부) | null | | { “include_usage”: true } |
| temperature | - | number | ❌ | 생성 결과의 창의성을 조절 (높을수록 무작위) | 1 | 0.0 ~ 1.0 | 0.7 |
| top_p | - | number | ❌ | 토큰의 샘플링 확률을 제한 (높을수록 더 많은 토큰 고려) | 1 | 0.0 ~ 1.0 | 0.9 |
표. Completions API - Body Parameters
Example
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/completions \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "google/gemma-4-31B-it",
"prompt": "한국의 수도는 어디입니까?",
"temperature": 0.7
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/completions \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "google/gemma-4-31B-it",
"prompt": "한국의 수도는 어디입니까?",
"temperature": 0.7
}'
코드 블럭. Completions API Request ExampleResponse
200 OK
| Name | Type | Description |
|---|
| id | string | 응답의 고유 식별자 |
| object | string | 응답 객체의 타입(예시: “text_completion”) |
| created | integer | 생성 시각(Unix timestamp, 초 단위) |
| model | string | 사용된 모델의 이름 |
| choices | array | 생성된 응답 선택지 목록 |
| choices[].index | number | 해당 choice의 인덱스 |
| choices[].text | string | 생성된 텍스트 객체 |
| choices[].logprobs | object | 토큰 별 로그 확률 정보(설정에 따라 포함) |
| choices[].finish_reason | string or null | 응답이 종료된 이유(예시: “stop”, “length” 등) |
| choices[].stop_reason | object or null | 추가 중단 이유 세부 정보 |
| choices[].prompt_logprobs | object or null | 입력 프롬프트 토큰별 로그 확률(널 가능) |
| usage | object | 토큰 사용량 통계 |
| usage.prompt_tokens | number | 입력 프롬프트에 사용된 토큰 수 |
| usage.total_tokens | number | 전체 토큰 수(입력 + 출력) |
| usage.completion_tokens | number | 생성된 응답에 사용된 토큰 수 |
| usage.prompt_tokens_details | object | 프롬프트 토큰 사용 세부 정보 |
표. Completions API - 200 OK
Error Code
| HTTP status code | ErrorCode 설명 |
|---|
| 400 | Bad Request |
| 422 | Prompt Guard 등 정책에 의해 요청이 거절된 경우 |
| 500 | Internal Server Error |
표. Completions API - Error Code
Example
{
"id": "cmpl-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"object": "text_completion",
"created": 1749702612,
"model": "google/gemma-4-31B-it",
"choices": [
{
"index": 0,
"text": " \nOur capital city is Seoul. \n\nA. 1\nB. ",
"logprobs": null,
"finish_reason": "length",
"stop_reason": null,
"prompt_logprobs": null
}
],
"usage": {
"prompt_tokens": 9,
"total_tokens": 25,
"completion_tokens": 16,
"prompt_tokens_details": null
}
}
{
"id": "cmpl-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"object": "text_completion",
"created": 1749702612,
"model": "google/gemma-4-31B-it",
"choices": [
{
"index": 0,
"text": " \nOur capital city is Seoul. \n\nA. 1\nB. ",
"logprobs": null,
"finish_reason": "length",
"stop_reason": null,
"prompt_logprobs": null
}
],
"usage": {
"prompt_tokens": 9,
"total_tokens": 25,
"completion_tokens": 16,
"prompt_tokens_details": null
}
}
코드 블럭. Completions API Response Example참고
Embedding API
개요
Embedding API는 주어진 텍스트를 고차원 벡터(임베딩)로 변환하여, 텍스트 간 유사도 계산, 클러스터링, 검색 등 다양한 자연어 처리(NLP) 작업에 활용할 수 있도록 지원합니다.
Request
Context
| Key | Type | Description | Example |
|---|
| Base URL | string | API 요청을 위한 Simple AI Inference URL | Simple AI Inference 엔드포인트 |
| Request Method | string | API 요청에 사용되는 HTTP 메서드 | POST |
| Headers | object | 요청 시 필요한 헤더 정보 | { “Content-Type”: “application/json”, “Authorization”: “bearer sai-xxxxxxx…” } |
| Body Parameters | object | 요청 본문에 포함되는 파라미터 | { “model”: “Qwen/Qwen3-VL-Embedding-8B”, “input”: “What is the capital of France?”} |
표. Embedding API - Context
Path Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Embedding API - Path Parameters
Query Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Embedding API - Query Parameters
Body Parameters
| Name | Name Sub | type | Required | Description | Default value | Boundary value | Example |
|---|
| model | - | string | ✅ | 응답 생성에 사용할 모델을 지정 | | | “Qwen/Qwen3-VL-Embedding-8B” |
| input | - | array | ✅ | 사용자의 검색 질의 또는 질문 | | | “What is the capital of France?" |
| encoding_format | - | string | ❌ | 임베딩을 반환할 형식을 지정 | “float” | “float”, “base64” | [0.01319122314453125,0.057220458984375, … (생략) |
| truncate_prompt_tokens | - | integer | ❌ | 입력 토큰 수를 제한 | | > 0 | 100 |
표. Embedding API - Body Parameters
Example
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/embeddings \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "Qwen/Qwen3-VL-Embedding-8B",
"input": "What is the capital of France?",
"encoding_format": "float"
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/embeddings \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "Qwen/Qwen3-VL-Embedding-8B",
"input": "What is the capital of France?",
"encoding_format": "float"
}'
코드 블럭. Embedding API Request ExampleResponse
200 OK
| Name | Type | Description |
|---|
| id | string | 응답의 고유 식별자 |
| object | string | 응답 객체의 타입(예시: “list” ) |
| created | number | 생성 시각(Unix timestamp, 초 단위) |
| model | string | 사용된 모델의 이름 |
| data | array | 임베딩 결과를 담은 객체 배열 |
| data.index | number | 입력 텍스트의 순서 인덱스 (예시: 입력 텍스트가 여러 개일 경우 순서를 나타냄) |
| data.object | string | 데이터 항목 타입 |
| data.embedding | array | 입력 텍스트의 임베딩 벡터 값 (모델의 임베딩 차원에 따른 float 배열로 구성) |
| usage | object | 토큰 사용량 통계 |
| usage.prompt_tokens | number | 입력 프롬프트에 사용된 토큰 수 |
| usage.total_tokens | number | 전체 토큰 수(입력 + 출력) |
| usage.completion_tokens | number | 생성된 응답에 사용된 토큰 수 |
| usage.prompt_tokens_details | object | 프롬프트 토큰의 세부 정보 |
표. Embedding API - 200 OK
Error Code
| HTTP status code | ErrorCode 설명 |
|---|
| 400 | Bad Request |
| 422 | Prompt Guard 등 정책에 의해 요청이 거절된 경우 |
| 500 | Internal Server Error |
표. Embedding API - Error Code
Example
{
"id":"embd-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"object":"list",
"created":1749035024,
"model":"Qwen/Qwen3-VL-Embedding-8B",
"data":[
{
"index":0,
"object":"embedding",
"embedding":
[0.01319122314453125,0.057220458984375,-0.028533935546875,-0.0008697509765625,-0.01422119140625,0.033416748046875,-0.0062408447265625,-0.04364013671875,-0.004497528076171875,0.0008072853088378906,-0.0193328857421875,0.041168212890625,-0.019317626953125,-0.0188751220703125,-0.047088623046875,
-0 ....(생략)
-0.05706787109375,-0.0147705078125]
}
],
"usage":
{
"prompt_tokens":9,
"total_tokens":9,
"completion_tokens":0,
"prompt_tokens_details":null
}
}
{
"id":"embd-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"object":"list",
"created":1749035024,
"model":"Qwen/Qwen3-VL-Embedding-8B",
"data":[
{
"index":0,
"object":"embedding",
"embedding":
[0.01319122314453125,0.057220458984375,-0.028533935546875,-0.0008697509765625,-0.01422119140625,0.033416748046875,-0.0062408447265625,-0.04364013671875,-0.004497528076171875,0.0008072853088378906,-0.0193328857421875,0.041168212890625,-0.019317626953125,-0.0188751220703125,-0.047088623046875,
-0 ....(생략)
-0.05706787109375,-0.0147705078125]
}
],
"usage":
{
"prompt_tokens":9,
"total_tokens":9,
"completion_tokens":0,
"prompt_tokens_details":null
}
}
코드 블럭. Embedding API Response Example참고
Rerank API
개요
Rerank API는 임베딩 모델이나 크로스 인코더 모델을 적용하여 단일 쿼리와 문서 목록의 각 항목 간 관련성을 예측할 수 있습니다.
일반적으로 문장 쌍의 점수는 두 문장 간 유사도를 0에서 1 사이의 범위로 나타냅니다.
- Embedding 기반 모델: Query와 문서를 각각 벡터로 바꾼 뒤, 벡터간의 유사도(예시: 코사인 유사도)를 측정하여 점수를 계산합니다.
- Reranker(Cross-Encoder) 기반 모델: Query와 문서를 한쌍으로 모델에 넣어서 평가합니다.
Request
Context
| Key | Type | Description | Example |
|---|
| Base URL | string | API 요청을 위한 Simple AI Inference URL | Simple AI Inference 엔드포인트 |
| Request Method | string | API 요청에 사용되는 HTTP 메서드 | POST |
| Headers | object | 요청 시 필요한 헤더 정보 | { “Content-Type”: “application/json”, “Authorization”: “bearer sai-xxxxxxx…” } |
| Body Parameters | object | 요청 본문에 포함되는 파라미터 | { “model”: “Qwen/Qwen3-VL-Reranker-8B”, “query”: …, “documents”: […] } |
표. Rerank API - Context
Path Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Rerank API - Path Parameters
Query Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Rerank API - Query Parameters
Body Parameters
| Name | Name Sub | type | Required | Description | Default value | Boundary value | Example |
|---|
| model | - | string | ✅ | 응답 생성에 사용할 모델을 지정 | | | “Qwen/Qwen3-VL-Reranker-8B” |
| query | - | string | ✅ | 사용자의 검색 질의 또는 질문 | | | “What is the capital of France?" |
| documents | - | array | ✅ | 재정렬 대상인 문서 목록 | | 최대 모델 입력 길이 제한 | [“The capital of France is Paris.”] |
| top_n | - | integer | ❌ | 반환할 상위 문서 개수를 지정(0이면 전체 반환) | 0 | > 0 | 5 |
| truncate_prompt_tokens | - | integer | ❌ | 입력 토큰 수를 제한 | | > 0 | 100 |
표. Rerank API - Body Parameters
Example
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v2/rerank \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "Qwen/Qwen3-VL-Reranker-8B",
"query": "What is the capital of France?",
"documents": [
"The capital of France is Paris.",
"France capital city is known for the Eiffel Tower.",
"Paris is located in the north-central part of France."
],
"top_n": 2,
"truncate_prompt_tokens": 512
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v2/rerank \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "Qwen/Qwen3-VL-Reranker-8B",
"query": "What is the capital of France?",
"documents": [
"The capital of France is Paris.",
"France capital city is known for the Eiffel Tower.",
"Paris is located in the north-central part of France."
],
"top_n": 2,
"truncate_prompt_tokens": 512
}'
코드 블럭. Rerank API Request ExampleResponse
200 OK
| Name | Type | Description |
|---|
| id | string | API 응답의 고유 식별자(UUID 형식) |
| model | string | 결과를 생성한 모델의 이름 |
| usage | object | 요청에 사용된 리소스 정보를 담은 객체 |
| usage.prompt_tokens | integer | 입력 프롬프트에 사용된 토큰 수 |
| usage.total_tokens | integer | 요청 처리에 사용된 총 토큰 수 |
| results | array | 쿼리와 관련된 문서들의 결과를 담은 배열 |
| results[].index | integer | 결과 배열 내의 순서 번호 |
| results[].document | object | 검색된 문서의 내용을 담은 객체 |
| results[].document.text | string | 검색된 문서의 실제 텍스트 내용 |
| results[].document.multi_modal | object or null | 멀티모달 문서 정보 |
| results[].relevance_score | float | 쿼리와 문서 간의 관련성을 나타내는 점수(0 ~ 1) |
표. Rerank API - 200 OK
Error Code
| HTTP status code | ErrorCode 설명 |
|---|
| 400 | Bad Request |
| 422 | Prompt Guard 등 정책에 의해 요청이 거절된 경우 |
| 500 | Internal Server Error |
표. Rerank API - Error Code
Example
{
"id": "score-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"model": "Qwen/Qwen3-VL-Reranker-8B",
"usage": {
"prompt_tokens": 54,
"total_tokens": 54
},
"results": [
{
"index": 0,
"document": {
"text": "The capital of France is Paris.",
"multi_modal": null
},
"relevance_score": 0.9237253665924072
},
{
"index": 2,
"document": {
"text": "Paris is located in the north-central part of France.",
"multi_modal": null
},
"relevance_score": 0.9181006550788879
}
]
}
{
"id": "score-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"model": "Qwen/Qwen3-VL-Reranker-8B",
"usage": {
"prompt_tokens": 54,
"total_tokens": 54
},
"results": [
{
"index": 0,
"document": {
"text": "The capital of France is Paris.",
"multi_modal": null
},
"relevance_score": 0.9237253665924072
},
{
"index": 2,
"document": {
"text": "Paris is located in the north-central part of France.",
"multi_modal": null
},
"relevance_score": 0.9181006550788879
}
]
}
코드 블럭. Rerank API Response Example참고
Responses API
개요
Responses API는 OpenAI의 Responses API와 호환되며 OpenAI Python client에서 사용할 수 있습니다. 텍스트, 이미지, 파일 입력으로 텍스트 또는 JSON 출력을 생성할 수 있으며, 함수 호출 및 빌트인 도구(web search, file search 등)를 지원합니다.
Request
Context
| Key | Type | Description | Example |
|---|
| Base URL | string | API 요청을 위한 Simple AI Inference URL | Simple AI Inference 엔드포인트 |
| Request Method | string | API 요청에 사용되는 HTTP 메서드 | POST |
| Headers | object | 요청 시 필요한 헤더 정보 | { “Content-Type”: “application/json”, “Authorization”: “bearer sai-xxxxxxx…” } |
| Body Parameters | object | 요청 본문에 포함되는 파라미터 | {“model”: “openai/gpt-oss-120b”, “input”: “한국의 수도는 어디입니까?” } |
표. Responses API - Context
Path Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Responses API - Path Parameters
Query Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Responses API - Query Parameters
Body Parameters
| Name | Name Sub | type | Required | Description | Default value | Boundary value | Example |
|---|
| model | - | string | ✅ | 응답 생성에 사용할 모델 ID | | | “openai/gpt-oss-120b” |
| input | - | string / array | ✅ | 모델에 대한 텍스트/이미지/파일 입력. 문자열 또는 InputItem 배열 | | | “Tell me a story” 또는 [{ “role” : “user”, “content” : “message” }] |
| instructions | - | string | ❌ | 모델 컨텍스트에 삽입되는 시스템(개발자) 메시지 | null | | “You are a helpful assistant." |
| temperature | - | number | ❌ | 샘플링 온도. 높을수록 무작위, 낮을수록 결정적 | 1 | 0 ~ 2 | 0.7 |
| top_p | - | number | ❌ | nucleus 샘플링 확률 제한. temperature와 함께 변경 권장하지 않음 | 1 | 0 ~ 1 | 0.9 |
| top_logprobs | - | integer | ❌ | 각 토큰 위치에서 반환할 최대 로그 확률 토큰 수 | null | 0 ~ 20 | 3 |
| stream | - | boolean | ❌ | 스트리밍 방식으로 결과를 반환할지 여부 | false | true/false | true |
| stream_options | include_usage | object | ❌ | 스트리밍 옵션을 제어(예시: 사용량 통계 포함 여부) | null | | { “include_usage”: true } |
| tools | - | array | ❌ | 모델이 호출할 수 있는 도구 목록(빌트인 도구 + function)- 빌트인 도구: web_search, file_search, code_interpreter 등
| [] | | |
| tool_choice | - | string / object | ❌ | 모델이 도구를 선택하는 방식- auto: 모델이 메시지를 생성할지 도구를 호출할지 선택
- required: 모델이 1개 이상의 도구를 호출
| | | |
| prompt_safety_model | - | string | ❌ | Prompt 검사를 위한 guard 모델 지정. 설정 시 guard 모델로 prompt를 먼저 검사하며, unsafe로 판단되면 guard 결과를 반환하고 safe이면 model 파라미터에 지정된 모델로 요청을 처리 | | | “meta-llama/Llama-Guard-4-12B” |
| chat_template_kwargs | - | object | ❌ | 템플릿 렌더러에 전달할 추가 키워드 인자. 모델별 reasoning 설정을 위해 사용(gpt-oss-120b는 reasoning 파라미터 사용, 자세한 내용은 Reasoning 설정 참고) | null | | { “enable_thinking”: true } |
| reasoning | - | object | ❌ | gpt-oss-120b 모델의 reasoning 설정. effort 필드로 추론 깊이 지정(low/medium/high, 기본값 medium) | null | | { “effort”: “high” } |
표. Responses API - Body Parameters
Example
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/responses \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-oss-120b",
"input": "한국의 수도는 어디입니까?"
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/responses \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-oss-120b",
"input": "한국의 수도는 어디입니까?"
}'
코드 블럭. Responses API Request ExampleResponse
200 OK
| Name | Type | Description |
|---|
| id | string | 응답의 고유 식별자 |
| object | string | 응답 객체 타입(항상 “response”) |
| created_at | integer | 생성 시각(Unix timestamp, 초 단위) |
| completed_at | integer or null | 완료 시각(completed 상태일 때만 존재) |
| status | string | 응답 상태(completed/failed/in_progress/cancelled/queued/incomplete) |
| model | string | 사용된 모델 이름 |
| output | array | 모델이 생성한 출력 항목 배열 |
| output[].type | string | 출력 항목 타입(예시: “message”) |
| output[].id | string | 출력 항목 ID |
| output[].status | string | 항목 상태(예시: “completed”) |
| output[].role | string | 메시지 작성자 역할(예시: “assistant”) |
| output[].content | array | 콘텐츠 배열 |
| output[].content[].type | string | 콘텐츠 타입(예시: “output_text”) |
| output[].content[].text | string | 생성된 텍스트 |
| output[].content[].annotations | array | 어노테이션 배열 |
| error | object or null | 오류 정보 |
| incomplete_details | object or null | 미완료 사유(reason: max_output_tokens / content_filter) |
| instructions | string or null | 시스템/개발자 메시지 |
| max_output_tokens | integer or null | 최대 출력 토큰 수 |
| parallel_tool_calls | boolean | 병렬 도구 호출 허용 여부 |
| previous_response_id | string or null | 이전 응답 ID |
| reasoning | object or null | reasoning 구성(effort, summary) |
| store | boolean | 응답 저장 여부 |
| temperature | number | 샘플링 온도 |
| text | object | 텍스트 응답 구성(format 등) |
| tool_choice | string / object | 도구 선택 방식 |
| tools | array | 도구 목록 |
| top_p | number | Top P 값 |
| truncation | string | 잘라내기 전략 |
| usage | object | 토큰 사용량 통계 |
| usage.input_tokens | integer | 입력 토큰 수 |
| usage.input_tokens_details.cached_tokens | integer | 캐시된 토큰 수 |
| usage.output_tokens | integer | 출력 토큰 수 |
| usage.output_tokens_details.reasoning_tokens | integer | reasoning 토큰 수 |
| usage.total_tokens | integer | 전체 토큰 수 |
| metadata | object | 메타데이터 |
표. Responses API - 200 OK
Error Code
| HTTP status code | ErrorCode 설명 |
|---|
| 400 | Bad Request |
| 422 | Prompt Guard 등 정책에 의해 요청이 거절된 경우 |
| 500 | Internal Server Error |
표. Responses API - Error Code
Example
{
"id": "resp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"object": "response",
"created_at": 1741476542,
"status": "completed",
"completed_at": 1741476543,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "openai/gpt-oss-120b",
"output": [
{
"type": "message",
"id": "msg_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "한국의 수도는 서울입니다.",
"annotations": []
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 54,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 8,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 62
},
"metadata": {}
}
{
"id": "resp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"object": "response",
"created_at": 1741476542,
"status": "completed",
"completed_at": 1741476543,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "openai/gpt-oss-120b",
"output": [
{
"type": "message",
"id": "msg_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "한국의 수도는 서울입니다.",
"annotations": []
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 54,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 8,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 62
},
"metadata": {}
}
코드 블럭. Responses API Response ExamplePrompt Guard 응답
prompt_safety_model 파라미터를 설정한 경우, guard 모델이 prompt를 먼저 검사합니다.
- safe:
model 파라미터에 지정된 모델로 요청이 그대로 처리됩니다. - unsafe: 아래와 같은 형태의 guard 결과를 반환하며 요청이 중단됩니다.
{
"guard_result": "unsafe",
"categories": ["S1", "S2"],
"categories_description": ["Violent Crimes", "Non-Violent Crimes"],
"messages": [
"Cannot fulfill the request due to violent content.",
"Cannot respond as it may promote illegal activities."
]
}
{
"guard_result": "unsafe",
"categories": ["S1", "S2"],
"categories_description": ["Violent Crimes", "Non-Violent Crimes"],
"messages": [
"Cannot fulfill the request due to violent content.",
"Cannot respond as it may promote illegal activities."
]
}
코드 블럭. Responses API Prompt Guard 응답 Example (unsafe)Reasoning 설정
chat_template_kwargs 또는 reasoning 파라미터를 통해 모델별 reasoning(추론 모드) 설정을 제어할 수 있습니다.
| 모델 | 파라미터 | 기본 reasoning | 설정 방법 |
|---|
| openai/gpt-oss-120b | reasoning | medium | { “effort”: “low” } / { “effort”: “medium” } (기본) / { “effort”: “high” } |
| 기타 모델 | chat_template_kwargs | 모델마다 상이 | Chat Completions API - Reasoning 설정 참고 |
표. Responses API - 모델별 Reasoning 설정
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/responses \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-oss-120b",
"input": "복잡한 수학 문제를 풀어주세요.",
"reasoning": {
"effort": "high"
}
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/v1/responses \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-oss-120b",
"input": "복잡한 수학 문제를 풀어주세요.",
"reasoning": {
"effort": "high"
}
}'
코드 블럭. Responses API Reasoning 설정 Example참고
Tokenize API
개요
Tokenize API는 텍스트를 토큰 ID로 변환합니다. Completion 방식(prompt 기반)과 Chat 방식(messages 기반) 두 가지 요청 타입을 지원합니다. vLLM의 Tokenize API와 호환됩니다.
Request
Context
| Key | Type | Description | Example |
|---|
| Base URL | string | API 요청을 위한 Simple AI Inference URL | Simple AI Inference 엔드포인트 |
| Request Method | string | API 요청에 사용되는 HTTP 메서드 | POST |
| Headers | object | 요청 시 필요한 헤더 정보 | { “Content-Type”: “application/json”, “Authorization”: “bearer sai-xxxxxxx…” } |
| Body Parameters | object | 요청 본문에 포함되는 파라미터 | { “model”: “openai/gpt-oss-120b”, “prompt”: “Hello, world!” } |
표. Tokenize API - Context
Path Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Tokenize API - Path Parameters
Query Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Tokenize API - Query Parameters
Body Parameters - 공통
| Name | Name Sub | type | Required | Description | Default value | Boundary value | Example |
|---|
| model | - | string | ✅ | 토큰화에 사용할 모델을 지정 | | | “openai/gpt-oss-120b” |
표. Tokenize API - Body Parameters (공통)
Body Parameters - Completion 방식 (prompt 기반)
| Name | Name Sub | type | Required | Description | Default value | Boundary value | Example |
|---|
| prompt | - | string | ✅ | 토큰화할 텍스트 | | | “Hello, world!" |
| add_special_tokens | - | boolean | ❌ | true이면 특수 토큰(BOS 등)을 프롬프트에 추가 | true | true / false | true |
| return_token_strs | - | boolean | ❌ | true이면 토큰 ID에 해당하는 토큰 문자열도 함께 반환 | false | true / false | true |
표. Tokenize API - Body Parameters (Completion 방식)
Body Parameters - Chat 방식 (messages 기반)
| Name | Name Sub | type | Required | Description | Default value | Boundary value | Example |
|---|
| messages | role | string | ✅ | 대화 내역을 포함하는 메시지 리스트 | | | [{ “role”: “user”, “content”: “hi” }] |
| add_generation_prompt | - | boolean | ❌ | true이면 chat template에 생성 프롬프트를 추가. continue_final_message와 동시에 true로 설정 불가 | true | true / false | true |
| continue_final_message | - | boolean | ❌ | true이면 마지막 메시지가 EOS 없이 열린 형태로 포맷됨. 모델이 새 메시지를 시작하는 대신 해당 메시지를 이어감. add_generation_prompt와 동시에 true로 설정 불가 | false | true / false | false |
| add_special_tokens | - | boolean | ❌ | true이면 chat template가 추가하는 특수 토큰 외에 BOS 등의 특수 토큰을 추가로 삽입. 대부분의 모델은 chat template가 특수 토큰을 처리하므로 기본값 false 사용 권장 | false | true / false | false |
| return_token_strs | - | boolean | ❌ | true이면 토큰 ID에 해당하는 토큰 문자열도 함께 반환 | false | true / false | true |
| chat_template | - | string | ❌ | 변환에 사용할 Jinja 템플릿. 토크나이저에 정의되지 않은 경우 제공 필요 | null | | |
| chat_template_kwargs | - | object | ❌ | 템플릿 렌더러에 전달할 추가 키워드 인자 | null | | { “add_generation_prompt”: true } |
| tools | - | array | ❌ | 모델이 호출할 수 있는 Tool의 리스트 | null | | |
표. Tokenize API - Body Parameters (Chat 방식)
Example
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/tokenize \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-oss-120b",
"prompt": "Hello, world!"
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/tokenize \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-oss-120b",
"prompt": "Hello, world!"
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/tokenize \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-oss-120b",
"messages": [
{
"role": "user",
"content": "hi"
}
]
}'
curl -X 'POST' \
{Simple AI Inference 엔드포인트}/tokenize \
-H 'Authorization: bearer sai-xxxxxxx...' \
-H 'Content-Type: application/json' \
-d '{
"model": "openai/gpt-oss-120b",
"messages": [
{
"role": "user",
"content": "hi"
}
]
}'
코드 블럭. Tokenize API Request ExampleResponse
200 OK
| Name | Type | Description |
|---|
| count | integer | 토큰화된 토큰의 개수 |
| max_model_len | integer | 모델이 지원하는 최대 토큰 길이 |
| tokens | array | 토큰화된 토큰 ID 목록 |
| token_strs | array or null | 토큰 ID에 해당하는 토큰 문자열 목록(return_token_strs가 true인 경우에만 반환) |
표. Tokenize API - 200 OK
Error Code
| HTTP status code | ErrorCode 설명 |
|---|
| 400 | Bad Request (model 필드 누락, request body 누락 등) |
| 404 | Model Not Found (지원하지 않는 모델) |
| 500 | Internal Server Error |
표. Tokenize API - Error Code
Example
{
"max_model_len": 1024,
"count": 6,
"tokens": [638357778, 638357778, 399020470, 1618501362, 2382766391, 2765235376],
"token_strs": null
}
{
"max_model_len": 1024,
"count": 6,
"tokens": [638357778, 638357778, 399020470, 1618501362, 2382766391, 2765235376],
"token_strs": null
}
{
"max_model_len": 1024,
"count": 6,
"tokens": [638357778, 638357778, 399020470, 1618501362, 2382766391, 2765235376],
"token_strs": ["<|im_start|>", "user", "<|im_sep|>", "hi", "<|im_end|>", ""]
}
{
"max_model_len": 1024,
"count": 6,
"tokens": [638357778, 638357778, 399020470, 1618501362, 2382766391, 2765235376],
"token_strs": ["<|im_start|>", "user", "<|im_sep|>", "hi", "<|im_end|>", ""]
}
코드 블럭. Tokenize API Response Example참고
Models API
개요
Models API는 Simple AI Inference 모델의 목록을 반환합니다. OpenAI의 Models API와 호환됩니다.
Request
Context
| Key | Type | Description | Example |
|---|
| Base URL | string | API 요청을 위한 Simple AI Inference URL | Simple AI Inference 엔드포인트 |
| Request Method | string | API 요청에 사용되는 HTTP 메서드 | GET |
| Headers | object | 요청 시 필요한 헤더 정보 | { “Authorization”: “bearer sai-xxxxxxx…” } |
| Body Parameters | - | - | GET 요청이므로 Body가 없습니다. |
표. Models API - Context
Path Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Models API - Path Parameters
Query Parameters
| Name | type | Required | Description | Default value | Boundary value | Example |
|---|
| None | | | | | | |
표. Models API - Query Parameters
Body Parameters
GET 요청이므로 Body가 없습니다.
Example
curl -X 'GET' \
{Simple AI Inference 엔드포인트}/v1/models \
-H 'Authorization: bearer sai-xxxxxxx...'
curl -X 'GET' \
{Simple AI Inference 엔드포인트}/v1/models \
-H 'Authorization: bearer sai-xxxxxxx...'
코드 블럭. Models API Request ExampleResponse
200 OK
| Name | Type | Description |
|---|
| object | string | 응답 객체의 타입(“list”) |
| data | array | 모델 객체 목록 |
| data[].id | string | 모델의 식별자 |
| data[].object | string | 객체의 타입(“model”) |
| data[].created | integer | 모델이 생성된 시각(Unix timestamp, 초 단위) |
| data[].owned_by | string | 모델의 소유자 |
표. Models API - 200 OK
Error Code
| HTTP status code | ErrorCode 설명 |
|---|
| 401 | Unauthorized (apikey 누락 또는 유효하지 않음) |
| 500 | Internal Server Error |
표. Models API - Error Code
Example
{
"data": [
{
"id": "openai/gpt-oss-120b",
"created": 1780979126,
"object": "model",
"owned_by": "SCP Simple AI Inference"
},
{
"id": "Qwen/Qwen3-VL-Embedding-8B",
"created": 1781512915,
"object": "model",
"owned_by": "SCP Simple AI Inference"
},
{
"id": "Qwen/Qwen3-VL-Reranker-8B",
"created": 1781512915,
"object": "model",
"owned_by": "SCP Simple AI Inference"
}
],
"object": "list"
}
{
"data": [
{
"id": "openai/gpt-oss-120b",
"created": 1780979126,
"object": "model",
"owned_by": "SCP Simple AI Inference"
},
{
"id": "Qwen/Qwen3-VL-Embedding-8B",
"created": 1781512915,
"object": "model",
"owned_by": "SCP Simple AI Inference"
},
{
"id": "Qwen/Qwen3-VL-Reranker-8B",
"created": 1781512915,
"object": "model",
"owned_by": "SCP Simple AI Inference"
}
],
"object": "list"
}
코드 블럭. Models API Response Example참고