Add Computer Use API support for Anthropic Claude#36
Merged
Conversation
Ensures required Computer Use headers are sent to Anthropic's API: - anthropic-version: 2023-06-01 (required by Anthropic API) - anthropic-beta: computer-use-2025-01-24 (enables Computer Use tools) Without these headers, Anthropic's API does not enable browser automation tools (screenshot, mouse, keyboard), causing Computer Use tasks to fail. Tested and confirmed working with Claude Max authentication. References: - https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool - https://platform.claude.com/docs/en/api/versioning Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2be6cf2 to
b27e9f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR ensures required Computer Use API headers are sent to Anthropic's API, enabling browser automation features.
Problem
CCProxy currently does not ensure that Computer Use headers reach Anthropic's API. Without these headers, Anthropic's API does not enable browser automation tools (screenshot, mouse control, keyboard input), causing Computer Use tasks to fail.
Solution
Add explicit header setting in
ccproxy/plugins/claude_api/adapter.pyto ensure these required headers are always sent:Why These Headers Are Required
anthropic-version: 2023-06-01Required header for all Anthropic API requests. From the official documentation:
anthropic-beta: computer-use-2025-01-24Enables Computer Use beta feature. From the Computer Use documentation:
Without this header, the API treats requests as normal chat without enabling the
computer_20250124tool.Testing
Tested with Claude Max authentication on browser automation tasks:
Before: Tasks requiring Computer Use tools failed
After: Tasks succeed (identical behavior to direct Anthropic API usage)
Changes
ccproxy/plugins/claude_api/adapter.py(5 lines added)Impact
This enables CCProxy users to access Anthropic's official Computer Use capabilities without requiring direct API access. Particularly valuable for:
Note: This is a minimal change (5 lines) that enables an official Anthropic API feature. The headers are documented requirements per Anthropic's official API documentation.