Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
51fca79
chore: fix docstring
dgellow Nov 25, 2025
746ac05
chore: update uv.lock
stainless-app[bot] Nov 26, 2025
388bd0c
fix: ensure streams are always closed
stainless-app[bot] Dec 1, 2025
21c6374
chore(deps): mypy 1.18.1 has a regression, pin to 1.17
stainless-app[bot] Nov 27, 2025
536720d
codegen metadata
stainless-app[bot] Nov 27, 2025
90634f3
chore: bump required `uv` version
stainless-app[bot] Dec 1, 2025
d7ae1fc
chore: update lockfile
stainless-app[bot] Dec 2, 2025
87aa378
chore(docs): use environment variables for authentication in code sni…
stainless-app[bot] Dec 2, 2025
955c61d
feat: allow raw JSON schema to be passed to messages.stream()
karpetrosyan Dec 3, 2025
2163d26
codegen metadata
stainless-app[bot] Dec 3, 2025
1521316
feat(tool runner): add support for server-side tools (#1086)
karpetrosyan Dec 3, 2025
4547171
chore(internal): avoid using unstable Python versions in tests
stainless-app[bot] Dec 4, 2025
ede3242
fix(types): allow pyright to infer TypedDict types within SequenceNotStr
stainless-app[bot] Dec 8, 2025
d306605
chore: add missing docstrings
stainless-app[bot] Dec 11, 2025
adbd11c
codegen metadata
stainless-app[bot] Dec 11, 2025
c570bce
codegen metadata
stainless-app[bot] Dec 12, 2025
6285abc
chore(internal): add missing files argument to base client
stainless-app[bot] Dec 15, 2025
718fa8e
fix: use async_to_httpx_files in patch method
stainless-app[bot] Dec 17, 2025
8914b7a
chore(internal): add `--fix` argument to lint script
stainless-app[bot] Dec 18, 2025
62ee0a5
release: 0.76.0
stainless-app[bot] Dec 24, 2025
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 @@ -24,7 +24,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.8.11'
version: '0.9.13'

- name: Install dependencies
run: uv sync --all-extras
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.8.11'
version: '0.9.13'

- name: Install dependencies
run: uv sync --all-extras
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.8.11'
version: '0.9.13'

- name: Bootstrap
run: ./scripts/bootstrap
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 @@ -26,7 +26,7 @@ jobs:
if: ${{ steps.release.outputs.releases_created }}
uses: astral-sh/setup-uv@v5
with:
version: '0.8.11'
version: '0.9.13'

- name: Publish to PyPI
if: ${{ steps.release.outputs.releases_created }}
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 @@ -23,7 +23,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.8.11'
version: '0.9.13'
- name: Install dependencies
run: uv sync --all-extras
- name: Detect removed symbols
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 @@ -16,7 +16,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.8.11'
version: '0.9.13'

- name: Publish to PyPI
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.75.0"
".": "0.76.0"
}
2 changes: 1 addition & 1 deletion .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-a49e89deec4e00d1da490808099d66e2001531b12d8666a7f5d0b496f760440d.yml
openapi_spec_hash: c93ef3808c58e233b01966ff154f31ce
config_hash: 7e9dfe17ab5c80abee5372ce746a926e
config_hash: f7dc1cdbacd8d780699a470dbc7ff8f4
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 0.76.0 (2025-12-24)

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

### Features

* allow raw JSON schema to be passed to messages.stream() ([955c61d](https://github.com/anthropics/anthropic-sdk-python/commit/955c61dd5aae4c8a2c7b8fab1f97a0b88c0ef03b))
* **tool runner:** add support for server-side tools ([#1086](https://github.com/anthropics/anthropic-sdk-python/issues/1086)) ([1521316](https://github.com/anthropics/anthropic-sdk-python/commit/15213160a016a70538c81163c49ce5948fe06879))


### Bug Fixes

* ensure streams are always closed ([388bd0c](https://github.com/anthropics/anthropic-sdk-python/commit/388bd0cbc53c4d8d8884d17a3051623728588eb4))
* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([ede3242](https://github.com/anthropics/anthropic-sdk-python/commit/ede32426043273f9b31e70893207ad6519240591))
* use async_to_httpx_files in patch method ([718fa8e](https://github.com/anthropics/anthropic-sdk-python/commit/718fa8e62aa939dd8c5d46430aa1d1b05a5906d9))


### Chores

* add missing docstrings ([d306605](https://github.com/anthropics/anthropic-sdk-python/commit/d306605103649320e900ab3a2413d0dbd6b118c5))
* bump required `uv` version ([90634f3](https://github.com/anthropics/anthropic-sdk-python/commit/90634f3ef0a9d7ae5a1945f005b13aad245f6b32))
* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([21c6374](https://github.com/anthropics/anthropic-sdk-python/commit/21c6374f3825f43e104bad4a5df71941bcf09844))
* **docs:** use environment variables for authentication in code snippets ([87aa378](https://github.com/anthropics/anthropic-sdk-python/commit/87aa378f13f64099bec9513cba85ba9723773ec4))
* fix docstring ([51fca79](https://github.com/anthropics/anthropic-sdk-python/commit/51fca7942b4e74e1357fb72828e8e39a8b8eea6a))
* **internal:** add `--fix` argument to lint script ([8914b7a](https://github.com/anthropics/anthropic-sdk-python/commit/8914b7abe9b98565f08f4965f7fd0da8cd9f1f08))
* **internal:** add missing files argument to base client ([6285abc](https://github.com/anthropics/anthropic-sdk-python/commit/6285abcba9945a7c6c6b713940ee0478dfe25008))
* **internal:** avoid using unstable Python versions in tests ([4547171](https://github.com/anthropics/anthropic-sdk-python/commit/4547171aba17e41ff2f2e2c13d319b6bc1a13e85))
* update lockfile ([d7ae1fc](https://github.com/anthropics/anthropic-sdk-python/commit/d7ae1fc9c06d7565b909e5c2d48ebeb63ee9d8c9))
* update uv.lock ([746ac05](https://github.com/anthropics/anthropic-sdk-python/commit/746ac05cbb18c7d596a381e2fe89d0ee3e4e94b9))

## 0.75.0 (2025-11-24)

Full Changelog: [v0.74.1...v0.75.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.74.1...v0.75.0)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,15 @@ pip install anthropic[aiohttp]
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from anthropic import DefaultAioHttpClient
from anthropic import AsyncAnthropic


async def main() -> None:
async with AsyncAnthropic(
api_key="my-anthropic-api-key",
api_key=os.environ.get("ANTHROPIC_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
message = await client.messages.create(
Expand Down
22 changes: 13 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
[project]
name = "anthropic"
version = "0.75.0"
version = "0.76.0"
description = "The official Python library for the anthropic API"
dynamic = ["readme"]
license = "MIT"
authors = [
{ name = "Anthropic", email = "[email protected]" },
]

dependencies = [
"httpx>=0.25.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"jiter>=0.4.0, <1",
"docstring-parser>=0.15,<1",
]

requires-python = ">= 3.9"
classifiers = [
"Typing :: Typed",
Expand All @@ -26,6 +28,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
Expand All @@ -46,7 +49,7 @@ Repository = "https://github.com/anthropics/anthropic-sdk-python"

[tool.uv]
managed = true
required-version = ">=0.5.0"
required-version = ">=0.9"
conflicts = [
[
{ group = "pydantic-v1" },
Expand All @@ -58,7 +61,7 @@ conflicts = [
# version pins are in uv.lock
dev = [
"pyright==1.1.399",
"mypy",
"mypy==1.17",
"respx",
"pytest",
"pytest-asyncio",
Expand All @@ -76,7 +79,8 @@ pydantic-v1 = [
"pydantic>=1.9.0,<2",
]
pydantic-v2 = [
"pydantic>=2,<3",
"pydantic~=2.0 ; python_full_version < '3.14'",
"pydantic~=2.12 ; python_full_version >= '3.14'",
]

[build-system]
Expand Down
92 changes: 55 additions & 37 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,40 @@
-e .
annotated-types==0.7.0
# via pydantic
anyio==4.8.0
anyio==4.12.0
# via
# anthropic
# httpx
asttokens==3.0.0
asttokens==3.0.1
# via inline-snapshot
boto3-stubs==1.40.69
botocore-stubs==1.40.69
backports-asyncio-runner==1.2.0 ; python_full_version < '3.11'
# via pytest-asyncio
boto3-stubs==1.41.5
botocore-stubs==1.41.6
# via boto3-stubs
certifi==2024.12.14
certifi==2025.11.12
# via
# httpcore
# httpx
colorama==0.4.6
# via
# griffe
# pytest
dirty-equals==0.9.0
dirty-equals==0.11
distro==1.9.0
# via anthropic
docstring-parser==0.17.0
# via anthropic
exceptiongroup==1.2.2 ; python_full_version < '3.11'
exceptiongroup==1.3.1 ; python_full_version < '3.11'
# via
# anyio
# pytest
execnet==2.1.1
execnet==2.1.2
# via pytest-xdist
executing==2.2.1
# via inline-snapshot
griffe==1.13.0
griffe==1.14.0 ; python_full_version < '3.10'
griffe==1.15.0 ; python_full_version >= '3.10'
h11==0.16.0
# via httpcore
httpcore==1.0.9
Expand All @@ -42,76 +45,91 @@ httpx==0.28.1
# via
# anthropic
# respx
idna==3.10
idna==3.11
# via
# anyio
# httpx
importlib-metadata==8.6.1
iniconfig==2.0.0
importlib-metadata==8.7.0
iniconfig==2.1.0 ; python_full_version < '3.10'
# via pytest
iniconfig==2.3.0 ; python_full_version >= '3.10'
# via pytest
inline-snapshot==0.31.1
jiter==0.12.0
# via anthropic
markdown-it-py==3.0.0
markdown-it-py==3.0.0 ; python_full_version < '3.10'
# via rich
markdown-it-py==4.0.0 ; python_full_version >= '3.10'
# via rich
mdurl==0.1.2
# via markdown-it-py
mypy==1.14.1
mypy-extensions==1.0.0
mypy==1.17.0
mypy-extensions==1.1.0
# via mypy
nodeenv==1.9.1
# via pyright
packaging==24.2
packaging==25.0
# via pytest
pluggy==1.5.0
pathspec==0.12.1
# via mypy
pluggy==1.6.0
# via pytest
pydantic==2.10.3
pydantic==2.12.5
# via anthropic
pydantic-core==2.27.1
pydantic-core==2.41.5
# via pydantic
pygments==2.19.1
pygments==2.19.2
# via
# pytest
# rich
pyright==1.1.399
pytest==8.4.1
pytest==8.4.2 ; python_full_version < '3.10'
# via
# inline-snapshot
# pytest-asyncio
# pytest-xdist
pytest==9.0.1 ; python_full_version >= '3.10'
# via
# inline-snapshot
# pytest-asyncio
# pytest-xdist
pytest-asyncio==0.24.0
pytest-xdist==3.7.0
python-dateutil==2.9.0.post0
pytest-asyncio==1.2.0 ; python_full_version < '3.10'
pytest-asyncio==1.3.0 ; python_full_version >= '3.10'
pytest-xdist==3.8.0
python-dateutil==2.9.0.post0 ; python_full_version < '3.10'
# via time-machine
respx==0.22.0
rich==13.9.4
rich==14.2.0
# via inline-snapshot
ruff==0.9.4
six==1.17.0
ruff==0.14.7
six==1.17.0 ; python_full_version < '3.10'
# via python-dateutil
sniffio==1.3.1
# via
# anthropic
# anyio
time-machine==2.16.0
tomli==2.2.1 ; python_full_version < '3.11'
# via anthropic
time-machine==2.19.0 ; python_full_version < '3.10'
time-machine==3.1.0 ; python_full_version >= '3.10'
tomli==2.3.0 ; python_full_version < '3.11'
# via
# inline-snapshot
# mypy
# pytest
types-awscrt==0.28.2
types-awscrt==0.29.1
# via botocore-stubs
types-s3transfer==0.14.0
types-s3transfer==0.15.0
# via boto3-stubs
typing-extensions==4.12.2
typing-extensions==4.15.0
# via
# anthropic
# anyio
# boto3-stubs
# exceptiongroup
# mypy
# pydantic
# pydantic-core
# pyright
# rich
zipp==3.21.0
# pytest-asyncio
# typing-inspection
typing-inspection==0.4.2
# via pydantic
zipp==3.23.0
# via importlib-metadata
9 changes: 7 additions & 2 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ set -e

cd "$(dirname "$0")/.."

echo "==> Running ruff"
uv run ruff check .
if [ "$1" = "--fix" ]; then
echo "==> Running ruff with --fix"
uv run ruff check . --fix
else
echo "==> Running ruff"
uv run ruff check .
fi

echo "==> Running pyright"
uv run pyright
Expand Down
Loading