from anthropic import Anthropic
import os
client = Anthropic(
base_url="https://api.neosantara.xyz/anthropic",
api_key=os.environ["NEOSANTARA_API_KEY"]
)
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=4096,
thinking={
"type": "enabled",
"budget_tokens": 2048
},
messages=[
{"role": "user", "content": "How many 'r' letters are in the word 'strawberry'?"}
]
)
for block in response.content:
if block.type == "thinking":
print(f"[Thinking Process]:\n{block.thinking}\n")
elif block.type == "text":
print(f"[Final Answer]:\n{block.text}")