Day 1, 20 minutes · beginner
Why it matters
Chatting with Claude in a browser is handy, but it stops at the chat window. With the Claude API, your own script sends Claude a question and gets the answer back as data. That is how you put Claude inside a tool of your own: a script that sorts emails, a button on a website, a helper that drafts replies.
This course follows Linde, who runs a small made-up online shop, Harbour Lane Tea Co. She gets reviews every week and wants a script that drafts a friendly reply to each one. Over seven days you build that script with her. Today you do the paperwork: an account, some credits and a key. At the end you have a working API key stored safely, and you know what you are paying for.
The words you need today
- API (application programming interface): a way for one program to talk to another. The Claude API lets your code talk to Claude.
- Endpoint: one address of the API that does one job. Sending a message to Claude goes to the Messages endpoint,
https://api.anthropic.com/v1/messages. You use it from lesson 3. - Claude Console: the website at
platform.claude.comwhere you manage everything for the API: credits, keys, usage and limits. - Organization: your account in the Console. Billing and limits belong to it.
- Workspace: a folder inside your organization for keys and limits, for example one per project. Every organization has a default workspace that you cannot delete.
- API key: a secret text that proves a request comes from you. The Console calls it an API key; the docs call it a Developer API key. Anyone who has it can spend your credits.
The Claude app and the Claude API are two different things
The Claude app (claude.ai, the desktop and phone apps) is where you chat. You pay for it with a plan, such as Free, Pro or Max.
The Claude API is for code. It has its own account in the Claude Console and its own billing. You pay for what you use, counted in tokens (small pieces of text; lesson 7 explains them). The pricing page says there is no free tier and no self-serve trial: you buy credits first, at least 5 US dollars. One exception: the Max, Ultra and Team plans include monthly API credits that you can link to a Console organization. Those credits do not roll over to the next month.
So treat them as two separate accounts: paying for the Claude app does not fill up your API credits, and API credits do not give you more chats in the app.
Keys, expiry and why you only see a key once
When you create a key, you choose:
- a name, so you know later what it was for;
- an expiry: 3 hours, 1 day, 7 days, 30 days, a date of your own, or never. You cannot change it later. A key that expires on its own is a key that cannot leak forever;
- who it acts as: for this course, a personal key linked to you;
- its scope: one workspace, or the whole organization. Pick one workspace. A key for the whole organization needs an extra workspace setting on every request.
The Console shows the full key only once. Copy it straight into a password manager. If you lose it, you do not get it back: you make a new one. Tomorrow you learn how to give the key to your scripts without ever typing it into your code.
There is also a way without a key
The docs recommend signing in with the ant command line tool for work on your own computer: you run ant auth login, sign in through the browser and there is no key to copy. On Windows, the docs install that tool inside WSL (Linux inside Windows). This course uses a key, because it works the same on Windows, macOS and Linux. The notes under the steps say more.
The steps
- Create your Console account and add credits, or link the credits of your plan.
- Optional: make a workspace for Linde's project, if you are an admin of your organization.
- Create a key with a clear name, an expiry, yourself as the linked account and one workspace as the scope.
- Store the key in your password manager straight away.
- Check the key in the table on the API keys page.
Follow the steps below.
Today's actions
Ticks are not saved without an accountDo it in Claude API
Claude API
- Go to the Claude Console at
platform.claude.comand sign up for an account, or sign in to the one you have. - Open the Billing page at
platform.claude.com/spending/billingand buy credits. The minimum purchase is 5 US dollars. On a Max or Ultra plan you can claim its monthly API credits on claude.ai under Settings > Billing instead; on Team, under Organization settings > Billing. - Optional: open the Workspaces page at
platform.claude.com/settings/workspaces, click Create workspace, enter the nameharbour-lane, pick a colour and click Create workspace. Only organization admins can do this; everyone else uses the default workspace. - Open the API keys page at
platform.claude.com/keys/api-keysand click Create key. If the dialog first offers other ways to connect, click Somewhere else or Continue with an API key. - Name the key
harbour-lane-dev. Under Expires, pick a preset such as 30 days. Under Linked account, pick your own name, marked (you). Under Scope, pick your workspace, not Organization. - The Console shows the full key only once. Copy it and save it in your password manager under the name harbour-lane-dev. Do not paste it into a chat, an email or a file in your project.
- Back on the API keys page, find harbour-lane-dev in the table and check its expiry date. If you lose the key later, you cannot see it again: create a new one.
Note: On macOS or Linux you can also skip the key: install the ant CLI and run ant auth login, which signs you in through the browser. On Windows the docs install the CLI inside WSL. This course uses a key, because it works the same on every system. If Create key is missing or greyed out, ask your organization admin.
Paid planPay as you go: buy prepaid credits in the Claude Console (minimum 5 US dollars). There is no free tier. Max, Ultra and Team plans include monthly API credits.
Create a free account to save your progress
Free, and no payment details. Your ticks and finished lessons are kept, on every device.
Create a free account I already have an accountCreate a free account to save your progress. Sign in or sign up