All Lessons

A junior developer is setting up their first Claude API integration. They have generated an API key from the Anthropic console and are writing code to make their first request. They look at existing code examples in the documentation and see various header configurations. The developer tries using an Authorization Bearer token (as with many other APIs) but receives a 401 authentication error. What header should they be using instead?

1 / 3
beginner 20 min

API Fundamentals

Loading lesson content...

A developer is building an application that processes streaming responses from the Messages API. They receive a response with content blocks and need to correctly identify which block types can appear in the response from the model. One of their downstream parsers is crashing because it expects a content block type that only appears in requests. Which content block type will the model NEVER generate in a response?

1 / 2

How does a streaming client know the model finished?

1 / 3