Authentication
Semua request API butuh API key di header.
Header
Authorization: Bearer sk-xxxAtau via x-api-key:
x-api-key: sk-xxxRate Limit & backpressure
| Layer | Limit | Balas |
|---|---|---|
| Nginx burst | 500 req / IP | — |
| Nginx concurrent | 100 conn / IP | — |
| Per-user RPM | tergantung 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 body | 10 MB | 400 invalid_request |
Berlaku untuk v2 & v3
Satu API key yang dibuat di Console (/api-keys) bisa dipakai di dua jalur:
# 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-keycurl 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" } } }}