Skip to content

Authentication

Semua request API butuh API key di header.

Terminal window
Authorization: Bearer sk-xxx

Atau via x-api-key:

Terminal window
x-api-key: sk-xxx

Rate Limit & backpressure

LayerLimitBalas
Nginx burst500 req / IP—
Nginx concurrent100 conn / IP—
Per-user RPMtergantung plan / RateLimitRPM (v2)429 rate_limit_exceeded
Max concurrent (proxy)200 (MAX_CONCURRENT) / timeout 3000ms (ACQUIRE_TIMEOUT_MS)503 server_busy — retry dengan backoff
Max body10 MB400 invalid_request

Berlaku untuk v2 & v3

Satu API key yang dibuat di Console (/api-keys) bisa dipakai di dua jalur:

Terminal window
# v3 (utama)
curl https://balitechsolution.com/v3/models -H "Authorization: Bearer sk-xxx"
# v2 (cadangan)
curl https://balitechsolution.com/v2/models -H "Authorization: Bearer sk-xxx"
# atau x-api-key
curl https://balitechsolution.com/v3/models -H "x-api-key: sk-xxx"

Jika 401 authentication_error cek header & expires_at key. Jika 403 forbidden / model_not_allowed berarti plan tidak mengizinkan model itu — lihat Settings dan Errors.

Settings opencode.json

{
"provider": {
"balitech-v3": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://balitechsolution.com/v3", "apiKey": "sk-xxx" } },
"balitech-v2": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://balitechsolution.com/v2", "apiKey": "sk-xxx" } }
}
}