GET /credits
Total granted and total used
Returns how much credit has ever entered the account and how much has left it. Both figures are in Korean won (KRW).
GET https://openrouter.myip.co.kr/api/v1/creditsAuthentication
Authorization: Bearer <key> is required. Both key kinds are accepted — inference and management. Credit belongs to the account rather than to a key, so any key on the account gives the same answer.
/api/v1 does not accept cookies. A logged-in browser showing a balance uses the session cookie against /api/dashboard/credits instead.
Request parameters
None. The endpoint takes no query parameters and no body.
Request example
curl https://openrouter.myip.co.kr/api/v1/credits \
-H "Authorization: Bearer $MYIP_API_KEY"Response
total_creditsnumberSum of credit granted to the account, in won: the ledger's charge (paid top-ups) and bonus entries added together. It is a monotonically increasing total, not the current balance.
total_usagenumberSum of money that has left the account, in won: the absolute values of the ledger's deduct (usage) and expire entries. Also cumulative, so it never decreases. It is significant to six decimal places, because a single call often costs less than one won.
{
"data": {
"total_credits": 50000,
"total_usage": 12480.351200
}
}Getting a balance from this
balance ≈ total_credits - total_usageWhen the numbers move
- Right after a top-up:
total_creditsrises as soon as the payment is approved. - Right after a call:
total_usageis settled after the response is sent, so there is a short delay. A call that has just finished may not be reflected yet. - Streaming: settlement happens when the stream ends (
[DONE], or the connection closing).
If you need the exact cost of one call immediately, do not poll this endpoint. Use usage.cost in a non-streaming response, the X-MyIP-Cost-KRW response header, or the usage chunk in a stream. For an authoritative figure after the fact, use GET /generation.
Per-key spend
This endpoint is account-wide. To see what a single key has spent, read usage, usage_daily, usage_weekly and usage_monthly from GET /key. The spend of all keys on an account adds up to total_usage.
Errors
| Status | error_type | When |
|---|---|---|
| 401 | invalid_api_key | No header. A token without one of our prefixes. An unknown, switched-off, or revoked key |
| 401 | expired_api_key | The key has expired |
| 402 | insufficient_credits | The key is suspended_no_credit; metadata.balance_krw is attached |
| 403 | key_suspended | An administrator suspended the key |
| 500 | server | Any other server-side failure |
{
"error": {
"code": 402,
"message": "크레딧이 부족합니다.",
"metadata": { "error_type": "insufficient_credits", "balance_krw": "0.000000" }
}
}message is written in Korean, the service's primary locale. Branch on metadata.error_type, not on the message text.
Related
- Credits and payment — how to top up, one credit = one won, minimum payment
- How costs are calculated — the formula behind a single call
- Limits and 402 — running out of credit and key suspension
- GET /key and /auth/key — per-key spend
Last updated Sep 5, 2026