Videos
tl;dr: I am looking for an API that tells me how much credit I have with Anthropic but cannot find one. And I have some questions.. :)
Hi, all. I hope you are having a great day.
I've been using Anthropic APIs for my side project, which so far has been fun.
For an admin dashboard, I am looking for an API to show how much credit I have left with Anthropic, and to my surprise, I cannot find it in the official documentation.
Upon inspecting network calls when visiting Anthropic Console page, I can see that they already have an internal endpoint, which is https://console.anthropic.com/api/organizations/{org-id}/prepaid/credits ( I haven't tried hitting it from my app, but I image they have CORS enabled ).
I also see a few other existing (internal) endpoints that seem to be useful [0] to make public and also bake into client SDK, such as /invoice_balance*,* /invoices*,* and /current_spend. And the below are my questions
If billing APIs already exist and I missed, I am terribly sorry. Can someone kindly point me to relevant doc(s) please?
Does anyone know if Anthropic plans to release "billing APIs"?
Is there a process to request APIs, and perhaps we can vote candidate APIs as a community?
I searched this community first and failed to find a similar question, so I decided to post.
Thanks everyone!
Warm regards
[0] With billing APIs, a few example use cases I can see are
dynamically change AI model depending on the remaining balance
set alerts based on current usage / remaining balance / invoice
maybe, if an app were to be powered by donation, you could show the current credit when asking for donations?
I'm trying to wrap my head around how Anthropic bills for the Claude API. Their pricing seems straightforward at first glance:
X $ per million input tokens
Y $ per million output tokens
But I'm not quite sure how this translates to actual billing. Does Anthropic:
Add up all input tokens across all API calls separately?
Add up all output tokens across all API calls separately?
Then charge based on these total counts?
Or is there more to it that I'm missing?
Sorry if this is a dumb question.. but I'm pretty confused and haven't been able to find clear info on this.
I have a Claude subscription, which says it includes Claude Code. But I've had to pay specifically for API credits in order to use CC inside Cline/VSCode?
I've been using Replit to build an app, hit my usage limit extremely fast, and read online that using something like Claude Code inside Replit or with Cline/VSCode would be a cheaper and better option. I've seen several threads/videos online of people saying you can do this and Claude Code has generous usage limits per 5 hours.. but my experience so far with CC/Cline/VSCode has been that I paid for $5 in credits, and used up $2 in credits after a couple of prompts where I barely did anything. Am I missing something? I'm v new to this stuff with zero coding experience so apologies if I'm missing something obvious.
Can I not just pay for a CC subscription and use it till I hit my hourly/monthly/whatever limits? Or do I need to literally pay per prompt when I'm using it via API?