Referensi API
API kompatibel dengan OpenAI Chat Completions. Base URL: ROUTER_BASE_URL (sudah termasuk /v1). Autentikasi: Authorization: Bearer.
Endpoint
| Endpoint | Arti |
|---|---|
| POST /v1/chat/completions | OpenAI Chat Completions: messages, stream, tools, response_format, max_tokens, temperature, reasoning. usage adds cost (IDR), cost_micro_idr and cached_tokens. |
| GET /v1/models | Public model list with pricing (prompt_idr, completion_idr, idr_per_1k_words_out) and providers. |
| GET /v1/models/{vendor}/{model}/endpoints | Per-provider prices, uptime and latency. |
| GET /v1/generation?id=gen-… | Metadata and final cost of one request of your account. |
| GET /v1/key | Current key: name, prefix, pdp_mode, budgets and remaining limit. |
| GET /v1/credits | balance_idr, held_idr, available_idr, totals. |
| GET /v1/providers | Public provider list: slug, name, models, data_regions, pdp_eligible_endpoints and per-endpoint data policy (region, retention, training, ZDR, PDP, terms URL and review date). |