Nivå 3 — Advanced

Claude API — getting started

The Claude API gives you full control over Claude in your own applications. Learn how to set up your first API request in under 10 minutes.
📅 21.05.2026 👁 61 views 🇳🇴 Les på norsk

Why use the API instead of claude.ai?

Claude.ai is perfect for daily use — but the API opens a completely different level. With the API you can build your own products, automate workflows, integrate Claude into existing systems and pay only for what you use.

🏗️
Build products — integrate Claude directly into websites, apps and systems you control.
⚙️
Full control — temperature, max tokens, system prompt, model selection — everything can be controlled programmatically.
💰
Pay per use — no monthly subscription price. You pay per token in and out.

Getting started — step by step

1️⃣
Create account at console.anthropic.com and add payment information.
2️⃣
Generate API key under Settings → API Keys. Save it securely — it is only shown once.
3️⃣
Choose model — claude-sonnet-4-5 for balance between quality and price, claude-opus-4-5 for maximum quality.

API response structure

⚠️ Security:
Never store the API key directly in the code. Use environment variables (getenv) or a secrets file outside public_html — just like you do with database passwords.
"The API is not an advanced tool for experts — it is the freedom to build exactly what you want." — On the value of direct API access
You can never fail doing the right thing.
— Florence Scovel Shinn

🎯 Test your knowledge

Test yourself — completely optional, but fun! 🎯

Question 1 of 3

Question 1 of 3

What is the most important security rule for the API key?

Never store the API key directly in the code — use environment variables or a secrets file outside public_html.

Question 2 of 3

Question 2 of 3

Which Claude model is recommended for most products that balance quality and price?

claude-sonnet-4-5 gives the best balance between quality and price — recommended for most production applications.

Question 3 of 3

Question 3 of 3

What is the most important advantage of the API over claude.ai for product building?

With the API you can integrate Claude directly into your own products and systems with full programmatic control over all parameters.
Share:

Read also