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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/anthropic-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand All @@ -41,7 +41,7 @@ jobs:
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/anthropic-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/anthropic-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
environment: production-release

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: stainless-api/trigger-release-please@v1
id: release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/detect-breaking-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run: |
echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV

- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
# Ensure we can check out the pull request base in the script below.
fetch-depth: ${{ env.FETCH_DEPTH }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
environment: production-release

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: github.repository == 'anthropics/anthropic-sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Check release environment
run: |
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.76.0"
".": "0.77.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 34
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-211390f4627177361550415b571a2b580b18c5882e3c2fc961b527e7b3474b0f.yml
openapi_spec_hash: c93ef3808c58e233b01966ff154f31ce
config_hash: 2438d3dc2e69cd23b9ed60c091eaffa7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-f7bcdc13402c6129b30be620021a724945de44cffc6add091798f9cce33a1e32.yml
openapi_spec_hash: e78807e31b9233abc50ccc00304bfa4d
config_hash: 92ca93edc068c543f2da38737239322d
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.77.0 (2026-01-17)

Full Changelog: [v0.76.0...v0.77.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.76.0...v0.77.0)

### Features

* **api:** migrate sending message format in output_config rather than output_format ([af405e4](https://github.com/anthropics/anthropic-sdk-python/commit/af405e473f7cf6091cb8e711264227b9b0508528))


### Chores

* **internal:** update `actions/checkout` version ([ea50de9](https://github.com/anthropics/anthropic-sdk-python/commit/ea50de95bd1e43b8f00a45ef472330a3c8b396c8))

## 0.76.0 (2026-01-13)

Full Changelog: [v0.75.0...v0.76.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.75.0...v0.76.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "anthropic"
version = "0.76.0"
version = "0.77.0"
description = "The official Python library for the anthropic API"
dynamic = ["readme"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/anthropic/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "anthropic"
__version__ = "0.76.0" # x-release-please-version
__version__ = "0.77.0" # x-release-please-version
80 changes: 56 additions & 24 deletions src/anthropic/resources/beta/messages/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,14 @@ def create(

metadata: An object describing metadata about the request.

output_config: Configuration options for the model's output. Controls aspects like how much
effort the model puts into its response.
output_config: Configuration options for the model's output. Controls aspects like output
format or how much effort the model puts into its response.

output_format: A schema to specify Claude's output format in responses.
output_format: Deprecated: Use `output_config.format` instead. See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.

service_tier: Determines whether to use priority capacity (if available) or standard capacity
for this request.
Expand Down Expand Up @@ -527,10 +531,14 @@ def create(

metadata: An object describing metadata about the request.

output_config: Configuration options for the model's output. Controls aspects like how much
effort the model puts into its response.
output_config: Configuration options for the model's output. Controls aspects like output
format or how much effort the model puts into its response.

output_format: Deprecated: Use `output_config.format` instead. See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

output_format: A schema to specify Claude's output format in responses.
A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.

service_tier: Determines whether to use priority capacity (if available) or standard capacity
for this request.
Expand Down Expand Up @@ -817,10 +825,14 @@ def create(

metadata: An object describing metadata about the request.

output_config: Configuration options for the model's output. Controls aspects like how much
effort the model puts into its response.
output_config: Configuration options for the model's output. Controls aspects like output
format or how much effort the model puts into its response.

output_format: A schema to specify Claude's output format in responses.
output_format: Deprecated: Use `output_config.format` instead. See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.

service_tier: Determines whether to use priority capacity (if available) or standard capacity
for this request.
Expand Down Expand Up @@ -1594,10 +1606,14 @@ def count_tokens(

mcp_servers: MCP servers to be utilized in this request

output_config: Configuration options for the model's output. Controls aspects like how much
effort the model puts into its response.
output_config: Configuration options for the model's output. Controls aspects like output
format or how much effort the model puts into its response.

output_format: Deprecated: Use `output_config.format` instead. See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

output_format: A schema to specify Claude's output format in responses.
A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.

system: System prompt.

Expand Down Expand Up @@ -1894,10 +1910,14 @@ async def create(

metadata: An object describing metadata about the request.

output_config: Configuration options for the model's output. Controls aspects like how much
effort the model puts into its response.
output_config: Configuration options for the model's output. Controls aspects like output
format or how much effort the model puts into its response.

output_format: A schema to specify Claude's output format in responses.
output_format: Deprecated: Use `output_config.format` instead. See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.

service_tier: Determines whether to use priority capacity (if available) or standard capacity
for this request.
Expand Down Expand Up @@ -2188,10 +2208,14 @@ async def create(

metadata: An object describing metadata about the request.

output_config: Configuration options for the model's output. Controls aspects like how much
effort the model puts into its response.
output_config: Configuration options for the model's output. Controls aspects like output
format or how much effort the model puts into its response.

output_format: Deprecated: Use `output_config.format` instead. See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

output_format: A schema to specify Claude's output format in responses.
A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.

service_tier: Determines whether to use priority capacity (if available) or standard capacity
for this request.
Expand Down Expand Up @@ -2478,10 +2502,14 @@ async def create(

metadata: An object describing metadata about the request.

output_config: Configuration options for the model's output. Controls aspects like how much
effort the model puts into its response.
output_config: Configuration options for the model's output. Controls aspects like output
format or how much effort the model puts into its response.

output_format: A schema to specify Claude's output format in responses.
output_format: Deprecated: Use `output_config.format` instead. See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.

service_tier: Determines whether to use priority capacity (if available) or standard capacity
for this request.
Expand Down Expand Up @@ -3252,10 +3280,14 @@ async def count_tokens(

mcp_servers: MCP servers to be utilized in this request

output_config: Configuration options for the model's output. Controls aspects like how much
effort the model puts into its response.
output_config: Configuration options for the model's output. Controls aspects like output
format or how much effort the model puts into its response.

output_format: Deprecated: Use `output_config.format` instead. See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

output_format: A schema to specify Claude's output format in responses.
A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.

system: System prompt.

Expand Down
9 changes: 9 additions & 0 deletions src/anthropic/types/beta/beta_output_config_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@
from typing import Optional
from typing_extensions import Literal, TypedDict

from .beta_json_output_format_param import BetaJSONOutputFormatParam

__all__ = ["BetaOutputConfigParam"]


class BetaOutputConfigParam(TypedDict, total=False):
effort: Optional[Literal["low", "medium", "high"]]
"""All possible effort levels."""

format: Optional[BetaJSONOutputFormatParam]
"""A schema to specify Claude's output format in responses.

See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
"""
8 changes: 4 additions & 4 deletions src/anthropic/types/beta/beta_server_tool_use_block.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Dict, Union
from typing import Dict, Union, Optional
from typing_extensions import Literal, Annotated, TypeAlias

from ..._utils import PropertyInfo
Expand All @@ -16,9 +16,6 @@
class BetaServerToolUseBlock(BaseModel):
id: str

caller: Caller
"""Tool invocation directly from the model."""

input: Dict[str, object]

name: Literal[
Expand All @@ -32,3 +29,6 @@ class BetaServerToolUseBlock(BaseModel):
]

type: Literal["server_tool_use"]

caller: Optional[Caller] = None
"""Tool invocation directly from the model."""
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
__all__ = ["BetaWebSearchToolResultErrorCode"]

BetaWebSearchToolResultErrorCode: TypeAlias = Literal[
"invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long"
"invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long", "request_too_large"
]
12 changes: 10 additions & 2 deletions src/anthropic/types/beta/message_count_tokens_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,19 @@ class MessageCountTokensParams(TypedDict, total=False):
output_config: BetaOutputConfigParam
"""Configuration options for the model's output.

Controls aspects like how much effort the model puts into its response.
Controls aspects like output format or how much effort the model puts into its
response.
"""

output_format: Optional[BetaJSONOutputFormatParam]
"""A schema to specify Claude's output format in responses."""
"""Deprecated: Use `output_config.format` instead.

See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.
"""

system: Union[str, Iterable[BetaTextBlockParam]]
"""System prompt.
Expand Down
12 changes: 10 additions & 2 deletions src/anthropic/types/beta/message_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,19 @@ class MessageCreateParamsBase(TypedDict, total=False):
output_config: BetaOutputConfigParam
"""Configuration options for the model's output.

Controls aspects like how much effort the model puts into its response.
Controls aspects like output format or how much effort the model puts into its
response.
"""

output_format: Optional[BetaJSONOutputFormatParam]
"""A schema to specify Claude's output format in responses."""
"""Deprecated: Use `output_config.format` instead.

See
[structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

A schema to specify Claude's output format in responses. This parameter will be
removed in a future release.
"""

service_tier: Literal["auto", "standard_only"]
"""
Expand Down
2 changes: 1 addition & 1 deletion src/anthropic/types/beta/messages/batch_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RequestParamsOutputFormat(TypedDict, total=False):
schema: Required[object]
"""The JSON schema of the format"""

type: Required[Literal["json_schema"]]



class Request(TypedDict, total=False):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@

class WebSearchToolRequestErrorParam(TypedDict, total=False):
error_code: Required[
Literal["invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long"]
Literal[
"invalid_tool_input",
"unavailable",
"max_uses_exceeded",
"too_many_requests",
"query_too_long",
"request_too_large",
]
]

type: Required[Literal["web_search_tool_result_error"]]
9 changes: 8 additions & 1 deletion src/anthropic/types/web_search_tool_result_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@


class WebSearchToolResultError(BaseModel):
error_code: Literal["invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long"]
error_code: Literal[
"invalid_tool_input",
"unavailable",
"max_uses_exceeded",
"too_many_requests",
"query_too_long",
"request_too_large",
]

type: Literal["web_search_tool_result_error"]
Loading
Loading