最安全的商用 AI API,200K 上下文,代码和推理能力顶尖。
注册 console.anthropic.com 获取 API Keypip install anthropicimport anthropic; client = anthropic.Anthropic(api_key='...')message = client.messages.create(model='claude-sonnet-4-20250514', max_completion_tokens=1100000, messages=[{'role':'user','content':'Hello'}])支持 Streaming + Tool Use + 200K 上下文在 AWS Bedrock 控制台启用 Claude 模型pip install boto3client = boto3.client('bedrock-runtime', region_name='us-east-1')调用 InvokeModel API,支持 IAM 权限控制 + VPC 私有网络pip install litellmlitellm --model claude-3-5-sonnet-20241022统一 OpenAI 格式调用所有模型