The Anthropic Developer Platform – From First Call to Production By the end of this lesson, students should be able to: Setting up your API key. Never hardcode the key in source files. Use environment variables in development and a secrets manager (AWS Secrets Manager, Google Secret Manager, etc.) in production. Installing the SDK. Python: Always verify current SDK versions and installation instructions at docs.anthropic.com/en/docs/quickstart. Your first API call (Python example pattern). import anthropic client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY from environment message = client.messages.create( print(message.content[0].text) This is a minimal working call. The The response structure. The Messages API response contains: The Adding a system prompt. message = client.messages.create( The Enroll to continue this lesson. The preview above shows the lesson objectives and opening lesson content. Enroll to view the full lesson, complete the practice work, and take the lesson quiz.
Lesson 2: Authentication and Your First API Call
Lesson Objectives
Lesson Content
ANTHROPIC_API_KEY=sk-ant-...pip install anthropic TypeScript/Node: npm install @anthropic-ai/sdk
model="claude-sonnet-4-6", # replace with current model ID from docs
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello, Claude."}
]
)model parameter should use a current model ID from docs.anthropic.com – not hardcoded values from this course.id: unique message identifiertype: "message"role: "assistant"content: array of content blocks (typically a text block with .text property)model: the model that generated the responsestop_reason: why generation stopped (end_turn, max_tokens, tool_use)usage: input and output token counts for this requestusage field is important: log token counts in production to track costs and debug unexpectedly large requests.
model="claude-sonnet-4-6",
max_tokens=1024,
system="You are a helpful assistant for a software development team.",
messages=[
{"role": "user", "content": "What are the main risk factors in this PR?"}
]
)system parameter sets the persistent instruction context for the model – equivalent to Custom Instructions in the chat interface.
