Dokumentasi API
UNCS SSHAXOR 100% OpenAI-compatible. Ganti base URL + API key, sisanya sama.
Base URL
https://uncs.ioi.my.id/v1
Auth
Semua endpoint butuh header:
Authorization: Bearer sk-sxa-xxxx...
Endpoint
| Endpoint | Keterangan |
| GET /v1/models | List model tersedia |
| POST /v1/chat/completions | Chat, streaming & non-streaming |
Contoh cURL
curl https://uncs.ioi.my.id/v1/chat/completions \\
-H "Authorization: Bearer $UNCS_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"model": "atria",
"messages": [{"role": "user", "content": "halo"}],
"stream": true
}'
Python (openai SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://uncs.ioi.my.id/v1",
api_key="$UNCS_KEY",
)
r = client.chat.completions.create(
model="atria",
messages=[{"role": "user", "content": "halo"}],
)
print(r.choices[0].message.content)
Node.js (openai SDK)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://uncs.ioi.my.id/v1",
apiKey: process.env.UNCS_KEY,
});
const r = await client.chat.completions.create({
model: "atria",
messages: [{ role: "user", content: "halo" }],
});
console.log(r.choices[0].message.content);
Streaming
Set "stream": true — respon datang sebagai SSE, identik format OpenAI.
Error
| Status | Arti |
| 401 | API key invalid |
| 402 | Saldo token habis — tukar promocode baru di dashboard |
| 429 | Rate limit |
| 502 | Upstream bermasalah |