An endpoint that returns the calling key’s API credit balance.
This was asked for in the GitHub tracker as api-discussion#327 in July 2025
and never answered before that repository was archived, so I am raising it
here where the conversation moved.
The case for it is what happens without it. A long job cannot check its own
runway before it starts, so it discovers the answer partway through as a wall
of failures. For any provider that has no such endpoint we keep a hand-entered
figure of what the balance was at the last top-up and subtract our own metered
spend, and we flag that figure as stale after forty-five days because it is a
guess, not a reading. OpenRouter exposes GET /api/v1/credits on an ordinary
inference key, and the practical difference is large: a batch can decide
whether to run.
A 401 body that names which balance is empty.
Your documentation is clearer than most on this point. It states
outright that API credits are separate from Computer credits, which is more
than several other providers manage. The failure mode is still easy to hit:
top up the wrong one and the Agent API keeps answering 401 with a message
about checking your plan and billing details, while the account page shows a
healthy balance. That is what happened to us, and the docs were not at
fault; we simply paid on the page we were already looking at.
An error that said “this key’s API credit balance is empty” would have ended
it in one line. As written, a Pro subscriber who follows the advice to check
plan and billing details lands on the page showing the money that cannot be
spent here.
Neither of these is a pricing change. Thanks for considering them.