[KongchangAI]
· 1 min read· 760 words

Anthropic Python SDK v1.4.0 Released: Enhanced Usage Reporting Breakdowns and Workspace ID Support

Anthropic Python SDK v1.4.0 Released: Enhanced Usage Reporting Breakdowns and Workspace ID Support

Anthropic Python SDK v1.4.0 enhances enterprise usage reporting, multi-workspace support, and debugging experience.

Anthropic has released Python SDK v1.4.0, a minor version update centered on enterprise operational capabilities and engineering robustness. The release adds Claude Tag categorization and per-user breakdowns to usage reports for more granular token cost tracking, extends workspace ID support to more API endpoints, and introduces named types for compliance settings to improve type safety. On the bug fix side, clearer error messages for httpx version mismatches significantly improve the debugging experience. This update is fully backward compatible with no breaking changes, and enterprise users relying on usage reports or multi-workspace management are encouraged to upgrade.

Anthropic's official Python SDK has received a v1.4.0 update. As the core tool developers use to call Claude models, this release focuses on API capability expansion, client robustness fixes, and internal engineering improvements. While it's just a minor version bump, several new features carry real significance for enterprise users and multi-workspace management scenarios.

v1.4.0 Release Page

Core New Features

This release introduces three API-facing features, all targeting operational and organizational management needs.

The most noteworthy addition is the enhancement to usage reports. The new version adds Claude Tag categorization and per-user breakdown statistics to usage reports. This means team managers can track token consumption more granularly across different tags and team members — a practical observability improvement for organizations that need to handle cost allocation and budget control.

Second, the update introduces named types for organization compliance setting statuses. While this may seem like an engineering detail, it gives code involving compliance settings clearer type definitions, reduces the risk of misuse, and makes IDE type hints friendlier.

Third, the SDK now supports passing a workspace ID on more endpoints. Multi-workspace is Anthropic's organizational isolation mechanism for team and enterprise customers. Previously, not all API endpoints supported specifying a workspace; this expansion makes cross-workspace resource calls more flexible and consistent.

What is a Claude Tag? Claude Tag is a request-tagging mechanism provided by Anthropic that lets developers attach custom labels to API calls — similar to Resource Tagging in cloud services. By passing different tags in API calls, enterprises can associate token consumption with specific business lines, projects, or feature modules. For example, a platform product can tag a "customer service bot" and a "content generation" module separately, enabling precise differentiation of API usage for each in usage reports — without needing custom instrumentation at the application layer. This is especially valuable for scenarios requiring internal cost allocation or per-usage billing to customers.

Key Bug Fixes

Two client-level issues were fixed, one of which has a notable impact on developer experience.

When users incorrectly passed an httpx object (instead of the expected httpx2 object), older versions could throw ambiguous errors that made it difficult to pinpoint the root cause. v1.4.0 now throws a clear error message in this situation, helping developers quickly identify dependency version mismatches. This kind of improvement to error message readability often saves more debugging time than new features do.

The other fix addresses a merge logic issue for custom-code in the messages resource, resolving merge anomalies that occurred in certain scenarios.

httpx vs httpx2 httpx and httpx2 are two different version series of the Python HTTP client library. The Anthropic Python SDK relies on a specific version of httpx under the hood to handle HTTP requests. When a project environment has the wrong version installed (e.g., a leftover older httpx), object type mismatches cause runtime errors. Previously, these errors were often thrown as low-level exceptions with cryptic messages, making it hard for developers to directly identify the dependency version as the root cause. The new version addresses this by performing explicit type checks during client initialization, catching these issues early and providing clear error messages — significantly reducing the troubleshooting cost of mixed dependency environments.

Internal Improvements and Documentation Updates

While these changes aren't directly user-facing, they reflect the SDK's maintenance quality.

Internal changes include: bundling the mock server specification and updating the development toolchain, cleaning up code comments, fixing mypy unreachable errors in the detect-breaking-changes script, and narrowing the codeowners scope (subsequently reverted). On the testing side, outdated warning filters were removed, and the skip reason for path-level query parameter tests was reworded.

Example code has also been refreshed with updated platform model IDs, ensuring that the examples developers reference use currently valid model identifiers. On the documentation front, several docstrings were updated to improve the accuracy of interface descriptions.

Upgrade Recommendations

Upgrading from v1.3.0 to v1.4.0 is a backward-compatible minor version update with no breaking changes recorded. Teams using multi-workspace features or relying on usage statistics for cost management are encouraged to upgrade promptly to take advantage of more granular reporting capabilities.

One thing to watch for: if your project mixes httpx and httpx2, the stricter type checking in the new version will more quickly surface potential dependency configuration issues. Pay attention to any related error messages after upgrading.

Overall, v1.4.0 is an iteration focused on enterprise operational capabilities and engineering robustness. There are no revolutionary feature changes, but the refinements to usage observability and multi-workspace support represent solid improvements for Claude applications running in production environments.

#Anthropic Python SDK#Claude API#v1.4.0#usage reports#workspace ID#Claude Tag#httpx#enterprise cost allocation
Share:

Related articles