SDKs
Anthropic SDK
The Anthropic SDKs call the Messages API, which currently serves Claude Code.
The official Anthropic SDKs send their requests to the Messages API. That endpoint currently serves Claude Code only, so a request from an Anthropic SDK gets 403.
To call Claude from your own code, use the OpenAI SDK with a claude-* model:
python · 12 lines
Streaming and tools work on the same call; see Chat Completions.