Get started with Claude
Make your first call to the Claude API from your terminal or your own code.
By the end of this quickstart, you’ll have sent Claude a question and gotten its answer. You create a Claude Console account and sign in with the ant CLI or create an API key. Then, you make one request with cURL, the ant CLI, or a short program in Python, TypeScript, C#, Go, Java, PHP, or Ruby.
Before you begin
Create a Claude Console account
Sign up for a Claude Console account, or sign in to the one you have.
Choose how to authenticate
Signing in with the CLI is recommended for local development.
For code that runs in CI or on a server with an identity provider, set up Workload Identity Federation instead. For other ways to authenticate, see Authentication.
CLIAPI key
Install the CLI
brew install anthropics/tap/antFor Linux environments, download the release binary directly.
VERSION=2.14.1 OS=$(uname -s | tr '[:upper:]' '[:lower:]') case $(uname -m) in x86_64) ARCH=amd64 ;; aarch64) ARCH=arm64 ;; esac curl -fsSL "https://github.com/anthropics/anthropic-cli/releases/download/v${VERSION}/ant_${VERSION}_${OS}_${ARCH}.tar.gz" \ | sudo tar -xz -C /usr/local/bin antYou can find all releases on the GitHub releases page.
You can also install the CLI from source with
go install, which requires Go 1.26.10 or later.go install github.com/anthropics/anthropic-cli/v2/cmd/ant@latestgo installplaces the binary in$(go env GOPATH)/bin. Add that directory to yourPATHif it isn’t already there:export PATH="$PATH:$(go env GOPATH)/bin"On Windows, you can install the CLI inside Windows Subsystem for Linux (WSL) with the Linux steps. If you sign in with the CLI inside WSL, also run your code there so that it finds your sign-in.
Sign in
CLIant auth loginYour browser opens. The first time you sign in, select an organization if you belong to more than one, and then a workspace.
After you sign in, the SDK and the CLI use your credentials automatically unless
ANTHROPIC_API_KEYis set (see Which credential is used).
Create an API key
Create an API key by following the steps in Get your Claude API key.
Set the environment variable
Set the key as an environment variable for your current shell session:
export ANTHROPIC_API_KEY="sk-ant-..."The SDK and the CLI read
ANTHROPIC_API_KEYautomatically. To set it for every new shell or on Windows, see API key on the CLI authentication options page.
Call the API
Create a project and install the SDK
mkdir claude-quickstart && cd claude-quickstart python3 -m venv .venv && source .venv/bin/activate pip install anthropicCreate your code
Create a file called
quickstart.py:Pythonimport anthropic client = anthropic.Anthropic() message = client.messages.create( model="claude-opus-5-5", max_tokens=1000, messages=[ { "role": "user", "content": "What should I search for to find the latest developments in renewable energy?", } ], ) for block in message.content: if block.type == "text": print(block.text)Run your code
python quickstart.pyOutputHere are some effective search strategies to find the latest developments in renewable energy: ## General Search Terms - "Renewable energy news 2025" - ...
Next steps
You made your first API call. Next, learn the Messages API patterns you’ll use in every Claude integration.
Learn multi-turn conversations, system prompts, stop reasons, and other core patterns.
Once you’re comfortable with the basics, explore further:
Compare Claude models by capability and cost.
Browse all Claude capabilities: tools, context management, structured outputs, and more.
Reference documentation for Python, TypeScript, C#, and other client libraries.
Compare CLI sign-in, Workload Identity Federation, App Attest, and API keys.
Was this page helpful?