Quickstart

Dokumentasi API

1. Buat key

Buka Dashboard, tekan Buat API key, lalu simpan key saat ditampilkan.

2. Panggil API

curl https://domain-kamu.com/v1/chat/completions   -H "Authorization: Bearer $KUNCIAI_API_KEY"   -H "Content-Type: application/json"   -d '{"model":"kunciai/deepseek-v4-flash","messages":[{"role":"user","content":"Halo"}],"stream":true}'

3. Integrasi OpenCode

Simpan key sebagai environment variable:

# PowerShell
$env:KUNCIAI_API_KEY="key-kamu"

# macOS/Linux
export KUNCIAI_API_KEY="key-kamu"

Buat opencode.json di folder proyek:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "kunciai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "KunciAI",
      "options": {
        "baseURL": "https://domain-kamu.com/v1",
        "apiKey": "{env:KUNCIAI_API_KEY}"
      },
      "models": {
        "kunciai/deepseek-v4-flash": {
          "name": "DeepSeek V4 Flash"
        }
      }
    }
  },
  "model": "kunciai/kunciai/deepseek-v4-flash"
}

Jalankan opencode. Tambahkan model lain dari katalog ke bagian models bila diperlukan.

OpenAI-compatible

Atur base URL ke https://domain-kamu.com/v1. Endpoint tersedia: GET /models dan POST /chat/completions.

Billing

Credit dihitung dari input, cached input, dan output aktual. Request memerlukan reserve sementara. Selisih reserve dikembalikan setelah usage diterima.