Claude Code subscriptions and costs

This issue has been raised on another thread here. I did not like the title because it was too vague. So, I decided to start a new post. This about the Claude Code assistant and its costs. There are two ways to start using the assistant locally. Obviously, first you have to create an account with Anthropic. Then you can chose to run Claude Code with the 1) $20 a month subscription/200 for annual, or 2) Anthropic API.

Initially, I knew I would have to sign up with Anthropic and get an API key. So, I did that before I even started the course. The minimum charge for that was $5. No biggie, most APIs for LLMs etc have some minimum charge. Then I started the course. Forked the git repo and loaded it up in PyCharm. Initially you are prompted with the choice of verification. I chose Claude and then was prompted with $20 subscription model. At the time I also noticed that the API version was available as well. I went and restarted the project and Claude and was prompted again. So this time I went with the API login. Immediately, I was prompted with my balance is too low and directed to add more money to my Anthropic API account. Now, I also subscribed to the Claude Code subscription but now my project is stuck and will not let me change the initial selection. :enraged_face: I presume the easiest solution is to kill the whole directory and start over. I’ll let you know how it turns out. :crossed_fingers:

Ok, I was able to scrap it and start over and everything worked well, for a second.

Then it threw an error: API Error: 401 {“type”:“error”,“error”:{“type”:“authentication_error”,“message”:"OAuth authentication is currently not supported , blah blah blah. Tried running claude doctor and npm i command. Same issue. Also it appears I was not alone: bug . Anyway, restarted and ran doctor and got this:

Ill keep cracking on. Also, for other reported issues see here.

It appears that despite the auto-update failed error still appearing, I am able to continue with the course. :slight_smile:

1 Like

I run into the similar issue here. At first when launching claude, I chose Anthropic Console Account(API usage billing). I found out $5 is used up very quickly, so I decided to go for monthly subscription choice. After subscription is done, claude code still complains that money is low and does not proceed. It took me some time to figure out how to solve this. Below is the step by step explanation.

  1. If you switch to monthly subscription, in claude code console, run /login again. This time choose the first choice to log in as Claude account with subscription. This will solve the issue when running claude code.
  2. However, the first step will not solve the issue when running the application without ANTHROPIC_API_KEY in .env file. The web application returns Query Failed without detailed information. In order to get ANTRROPIC_API_KEY, I went to console.anthropic.com. By now, I only see one key in Claude Codeworkspace and that key is obfuscated. There is no way to get the orignal key. That key was created when I first loginClaude Codethrough the 2nd optionAnthropic Console Account. That key is not visible to you. So I created a new key in default workspace. When creating it, it allows you to copy it. THAT IS THE ONLY CHANCE YOU KNOW THE KEY. So save it to .env` file right away.
  3. Now everything seems in the right place. In Claude Code I can ask questions such as analyze this file, but when I run the application, I still get Query Failed without any detailed information. So in Claude Code I asked why the application returns Query Failed error, Claude Code did run some test and replied to me that It might be due to rate exceeds limit and try some time later. This is due to external resource issue, not code itself. I am quite impressed by this diagnosis. I waited for sometime and tried again. This time App behaves correctly.

So long story short, when taking Claude Code course, I highly recommend the following steps to minimize your cost.

  1. Take Monthly subcription right away. You can cancel it two days before the next billing cycle if you only intend to use Claude Code for this course.
  2. Create an API key in default workspace and use that key to run the application in this course.
2 Likes