Skip to content

Commit 5953ba7

Browse files
feat(api): enabling fast-mode in claude-opus-4-6
1 parent 7c42e4b commit 5953ba7

9 files changed

Lines changed: 87 additions & 7 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 34
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-267f913f89364cb8df3a758335a974b43eb98019a8ceef0a9b0a94ef34c2a3b5.yml
3-
openapi_spec_hash: aa708f3d3bc54992526cbf5894427446
4-
config_hash: d56fbaeeb3934b1a3b374590c9837ddd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-fee5dc365a4948e68639582c5301d4d0666c7d85a11628d7917e1477f76d3da1.yml
3+
openapi_spec_hash: d5543958074cd2bd74096cd69f3bb4f9
4+
config_hash: c4802b6c7f8ffae62f7d73b2ac61e635

src/anthropic/resources/beta/messages/messages.py

Lines changed: 56 additions & 0 deletions
Large diffs are not rendered by default.

src/anthropic/types/anthropic_beta_param.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
"context-management-2025-06-27",
3030
"model-context-window-exceeded-2025-08-26",
3131
"skills-2025-10-02",
32+
"fast-mode-2026-02-01",
3233
],
3334
]

src/anthropic/types/beta/beta_usage.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ class BetaUsage(BaseModel):
4646

4747
service_tier: Optional[Literal["standard", "priority", "batch"]] = None
4848
"""If the request used the priority, standard, or batch tier."""
49+
50+
speed: Optional[Literal["standard", "fast"]] = None
51+
"""The inference speed mode used for this request."""

src/anthropic/types/beta/message_count_tokens_params.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import List, Union, Iterable, Optional
6-
from typing_extensions import Required, Annotated, TypeAlias, TypedDict
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from ..._utils import PropertyInfo
99
from ..model_param import ModelParam
@@ -137,6 +137,12 @@ class MessageCountTokensParams(TypedDict, total=False):
137137
removed in a future release.
138138
"""
139139

140+
speed: Optional[Literal["standard", "fast"]]
141+
"""The inference speed mode for this request.
142+
143+
`"fast"` enables high output-tokens-per-second inference.
144+
"""
145+
140146
system: Union[str, Iterable[BetaTextBlockParam]]
141147
"""System prompt.
142148

src/anthropic/types/beta/message_create_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ class MessageCreateParamsBase(TypedDict, total=False):
161161
[service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
162162
"""
163163

164+
speed: Optional[Literal["standard", "fast"]]
165+
"""The inference speed mode for this request.
166+
167+
`"fast"` enables high output-tokens-per-second inference.
168+
"""
169+
164170
stop_sequences: SequenceNotStr[str]
165171
"""Custom text sequences that will cause the model to stop generating.
166172

tests/api_resources/beta/messages/test_batches.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def test_method_create_with_all_params(self, client: Anthropic) -> None:
119119
"type": "json_schema",
120120
},
121121
"service_tier": "auto",
122+
"speed": "standard",
122123
"stop_sequences": ["string"],
123124
"stream": False,
124125
"system": [
@@ -550,6 +551,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAnthropic)
550551
"type": "json_schema",
551552
},
552553
"service_tier": "auto",
554+
"speed": "standard",
553555
"stop_sequences": ["string"],
554556
"stream": False,
555557
"system": [

tests/api_resources/beta/test_messages.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def test_method_create_with_all_params_overload_1(self, client: Anthropic) -> No
105105
"type": "json_schema",
106106
},
107107
service_tier="auto",
108+
speed="standard",
108109
stop_sequences=["string"],
109110
stream=False,
110111
system=[
@@ -292,6 +293,7 @@ def test_method_create_with_all_params_overload_2(self, client: Anthropic) -> No
292293
"type": "json_schema",
293294
},
294295
service_tier="auto",
296+
speed="standard",
295297
stop_sequences=["string"],
296298
system=[
297299
{
@@ -462,6 +464,7 @@ def test_method_count_tokens_with_all_params(self, client: Anthropic) -> None:
462464
"schema": {"foo": "bar"},
463465
"type": "json_schema",
464466
},
467+
speed="fast",
465468
system=[
466469
{
467470
"text": "Today's date is 2024-06-01.",
@@ -663,6 +666,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
663666
"type": "json_schema",
664667
},
665668
service_tier="auto",
669+
speed="standard",
666670
stop_sequences=["string"],
667671
stream=False,
668672
system=[
@@ -850,6 +854,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
850854
"type": "json_schema",
851855
},
852856
service_tier="auto",
857+
speed="standard",
853858
stop_sequences=["string"],
854859
system=[
855860
{
@@ -1020,6 +1025,7 @@ async def test_method_count_tokens_with_all_params(self, async_client: AsyncAnth
10201025
"schema": {"foo": "bar"},
10211026
"type": "json_schema",
10221027
},
1028+
speed="fast",
10231029
system=[
10241030
{
10251031
"text": "Today's date is 2024-06-01.",

tests/lib/tools/test_runners.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
]
3838
),
3939
"result": snapshot(
40-
"ParsedBetaMessage(container=None, content=[ParsedBetaTextBlock(citations=None, parsed_output=None, text=\"The weather in San Francisco, CA is currently **68°F** and **Sunny**. It's a nice day! ☀️\", type='text')], context_management=None, id='msg_014x2Sxq2p6sewFyUbJp8Mg3', model='claude-haiku-4-5-20251001', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=BetaUsage(cache_creation=BetaCacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, inference_geo=None, input_tokens=770, iterations=None, output_tokens=33, server_tool_use=None, service_tier='standard'))\n"
40+
"ParsedBetaMessage(container=None, content=[ParsedBetaTextBlock(citations=None, parsed_output=None, text=\"The weather in San Francisco, CA is currently **68°F** and **Sunny**. It's a nice day! ☀️\", type='text')], context_management=None, id='msg_014x2Sxq2p6sewFyUbJp8Mg3', model='claude-haiku-4-5-20251001', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=BetaUsage(cache_creation=BetaCacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, inference_geo=None, input_tokens=770, iterations=None, output_tokens=33, server_tool_use=None, service_tier='standard', speed=None))\n"
4141
),
4242
},
4343
"custom": {
@@ -48,12 +48,12 @@
4848
]
4949
),
5050
"result": snapshot(
51-
"ParsedBetaMessage(container=None, content=[ParsedBetaTextBlock(citations=None, parsed_output=None, text='The weather in San Francisco, CA is currently **20°C** and **Sunny**. Nice weather!', type='text')], context_management=None, id='msg_01DSPL7PHKQYTe9VAFkHzsA3', model='claude-haiku-4-5-20251001', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=BetaUsage(cache_creation=BetaCacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, inference_geo=None, input_tokens=787, iterations=None, output_tokens=26, server_tool_use=None, service_tier='standard'))\n"
51+
"ParsedBetaMessage(container=None, content=[ParsedBetaTextBlock(citations=None, parsed_output=None, text='The weather in San Francisco, CA is currently **20°C** and **Sunny**. Nice weather!', type='text')], context_management=None, id='msg_01DSPL7PHKQYTe9VAFkHzsA3', model='claude-haiku-4-5-20251001', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=BetaUsage(cache_creation=BetaCacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, inference_geo=None, input_tokens=787, iterations=None, output_tokens=26, server_tool_use=None, service_tier='standard', speed=None))\n"
5252
),
5353
},
5454
"streaming": {
5555
"result": snapshot(
56-
"ParsedBetaMessage(container=None, content=[ParsedBetaTextBlock(citations=None, parsed_output=None, text='The weather in San Francisco, CA is currently **Sunny** with a temperature of **68°F**.', type='text')], context_management=None, id='msg_01Vm8Ddgc8qm4iuUSKbf6jku', model='claude-haiku-4-5-20251001', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=BetaUsage(cache_creation=BetaCacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, inference_geo=None, input_tokens=781, iterations=None, output_tokens=25, server_tool_use=None, service_tier='standard'))\n"
56+
"ParsedBetaMessage(container=None, content=[ParsedBetaTextBlock(citations=None, parsed_output=None, text='The weather in San Francisco, CA is currently **Sunny** with a temperature of **68°F**.', type='text')], context_management=None, id='msg_01Vm8Ddgc8qm4iuUSKbf6jku', model='claude-haiku-4-5-20251001', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=BetaUsage(cache_creation=BetaCacheCreation(ephemeral_1h_input_tokens=0, ephemeral_5m_input_tokens=0), cache_creation_input_tokens=0, cache_read_input_tokens=0, inference_geo=None, input_tokens=781, iterations=None, output_tokens=25, server_tool_use=None, service_tier='standard', speed=None))\n"
5757
)
5858
},
5959
"tool_call": {

0 commit comments

Comments
 (0)