Kode error
Kesalahan dikembalikan dengan struktur yang sama dengan format yang kamu pakai (OpenAI atau Anthropic), plus header yang konsisten di level transport.
Di luar saldo
Section titled “Di luar saldo”| HTTP | Berarti | Solusi |
|---|---|---|
401 |
API key tidak valid atau hilang | Cek header Authorization: Bearer <API_KEY> atau x-api-key. |
403 |
Key valid tetapi saldo habis | Top up via QRIS, atau (untuk Token Plan) lanjutkan pakai saldo. |
404 |
Model tidak dikenal | Cek daftar model; identifikasi harus provider/nama. |
429 |
Kuota Token Plan / rate limit tercapai | Tunggu jendela 5 jam atau mingguan reset, atau naikkan paket. |
5xx |
Gangguan di hulu | Coba ulang; request yang gagal tidak ditagih. |
Prinsip
Section titled “Prinsip”- Request yang ditolak tidak ditagih. Semua kegagalan — key salah, model tidak ada, error hulu — tidak memotong saldo.
- Failover otomatis. Kalau satu penyedia bermasalah, request dialihkan ke cadangan tanpa mengubah response.
- Streaming terputus. Kalau koneksi terputus di tengah stream, tagihannya mengikuti token yang benar-benar dikirim.
Debug cepat
Section titled “Debug cepat”# Tampilkan status + body errorcurl -s https://api.datago.id/v1/chat/completions \ -H "Authorization: Bearer API_KEY_KAMU" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-5.6-terra", "messages": [{"role": "user", "content": "hi"}]}' \ | head -c 500Body error format OpenAI memakai struktur {"error": {"message": ..., "type": ..., "code": ...}}; format Anthropic memakai {"type": "error", "error": {"type": ..., "message": ...}}.