Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
],
},
],
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
)
print(response.model_dump_json(indent=2))
2 changes: 1 addition & 1 deletion examples/mcp_tool_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def main() -> None:

# Run a conversation with tool_runner()
runner = client.beta.messages.tool_runner(
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
max_tokens=1024,
tools=tools,
messages=[{"role": "user", "content": "List the files in /tmp"}],
Expand Down
4 changes: 2 additions & 2 deletions examples/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"content": "Hello!",
}
],
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
)
print(response)

Expand All @@ -30,6 +30,6 @@
"content": "How are you?",
},
],
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
)
print(response2)
2 changes: 1 addition & 1 deletion examples/messages_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async def main() -> None:
"content": "Say hello there!",
}
],
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
) as stream:
async for event in stream:
if event.type == "text":
Expand Down
2 changes: 1 addition & 1 deletion examples/text_completions_demo_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async def main() -> None:
client = AsyncAnthropic()

res = await client.completions.create(
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
prompt=f"{anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court? {anthropic.AI_PROMPT}",
max_tokens_to_sample=1000,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/text_completions_demo_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def main() -> None:
client = Anthropic()

res = client.completions.create(
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
prompt=f"{anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court? {anthropic.AI_PROMPT}",
max_tokens_to_sample=1000,
)
Expand Down
4 changes: 2 additions & 2 deletions examples/text_completions_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def sync_stream() -> None:
stream = client.completions.create(
prompt=f"{HUMAN_PROMPT} {question}{AI_PROMPT}",
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
stream=True,
max_tokens_to_sample=300,
)
Expand All @@ -29,7 +29,7 @@ def sync_stream() -> None:
async def async_stream() -> None:
stream = await async_client.completions.create(
prompt=f"{HUMAN_PROMPT} {question}{AI_PROMPT}",
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
stream=True,
max_tokens_to_sample=300,
)
Expand Down
2 changes: 1 addition & 1 deletion examples/thinking.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
client = anthropic.Anthropic()

response = client.messages.create(
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
max_tokens=3200,
thinking={"type": "enabled", "budget_tokens": 1600},
messages=[{"role": "user", "content": "Create a haiku about Anthropic."}],
Expand Down
2 changes: 1 addition & 1 deletion examples/thinking_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
client = anthropic.Anthropic()

with client.messages.stream(
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
max_tokens=3200,
thinking={"type": "enabled", "budget_tokens": 1600},
messages=[{"role": "user", "content": "Create a haiku about Anthropic."}],
Expand Down
4 changes: 2 additions & 2 deletions examples/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
]

message = client.messages.create(
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
max_tokens=1024,
messages=[user_message],
tools=tools,
Expand All @@ -32,7 +32,7 @@

tool = next(c for c in message.content if c.type == "tool_use")
response = client.messages.create(
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
max_tokens=1024,
messages=[
user_message,
Expand Down
2 changes: 1 addition & 1 deletion examples/tools_runner_search_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def main() -> None:
]
runner = client.beta.messages.tool_runner(
max_tokens=1024,
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
tools=[*tools, make_tool_searcher(tools)],
messages=[{"role": "user", "content": "What is the weather in SF?"}],
betas=["tool-search-tool-2025-10-19"],
Expand Down
2 changes: 1 addition & 1 deletion examples/tools_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
async def main() -> None:
async with client.messages.stream(
max_tokens=1024,
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
tools=[
{
"name": "get_weather",
Expand Down
2 changes: 1 addition & 1 deletion examples/web_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Create a message with web search enabled
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
max_tokens=1024,
messages=[{"role": "user", "content": "What's the weather in New York?"}],
tools=[
Expand Down
2 changes: 1 addition & 1 deletion examples/web_search_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def main() -> None:

# Create an async stream with web search enabled
async with client.beta.messages.stream(
model="claude-sonnet-4-5-20250929",
model="claude-sonnet-4-5",
max_tokens=1024,
messages=[{"role": "user", "content": "What's the weather in New York?"}],
tools=[
Expand Down