https://ai2.aiinplanet.com/v1/...)Authorization: Bearer <API_KEY> (키는 별도 안내)gemma-4-26b-a4b"stream": true)YOUR_API_KEY 자리에 발급받은 키(sk-aiin-…)를 넣어 사용하세요.
| 메서드 | 경로 | 설명 | 인증 |
|---|---|---|---|
| GET | /v1/models | 모델 목록 | 공개 |
| POST | /v1/chat/completions | 채팅 컴플리션 (메인) | Bearer 필수 |
| POST | /v1/completions | 텍스트 컴플리션 | Bearer 필수 |
| POST | /v1/embeddings | 임베딩 | Bearer 필수 |
/v1/models를 제외한 모든 경로는 올바른 Bearer 키가 없으면 401을 반환합니다.
# 모델 목록 (공개)
curl https://ai2.aiinplanet.com/v1/models
# 채팅 (Bearer 키 필요)
curl https://ai2.aiinplanet.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-4-26b-a4b",
"messages": [{"role": "user", "content": "안녕하세요"}],
"max_tokens": 1024
}'
from openai import OpenAI
client = OpenAI(
base_url="https://ai2.aiinplanet.com/v1",
api_key="YOUR_API_KEY",
)
resp = client.chat.completions.create(
model="gemma-4-26b-a4b",
messages=[{"role": "user", "content": "안녕하세요"}],
max_tokens=1024,
)
print(resp.choices[0].message.content)
const res = await fetch("https://ai2.aiinplanet.com/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gemma-4-26b-a4b",
messages: [{ role: "user", content: "안녕하세요" }],
max_tokens: 1024,
}),
});
const data = await res.json();
console.log(data.choices[0].message.content);
# SSE 스트리밍 — "stream": true 추가
curl -N https://ai2.aiinplanet.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-4-26b-a4b",
"messages": [{"role": "user", "content": "긴 글을 써줘"}],
"max_tokens": 2048,
"stream": true
}'
max_tokens를 너무 작게 주면 추론에 예산이 소진되어 content가 비고
finish_reason: "length"가 됩니다. 1024 이상을 넉넉히 주세요.
model 값은 gemma-4-26b-a4b 중 하나여야 합니다.401 Unauthorized가 반환됩니다.chat.completion 스키마와 동일합니다. OpenAI SDK의 base_url만 교체하면 그대로 동작합니다.