Skip to content

Add Computer Use API support for Anthropic Claude#36

Merged
CaddyGlow merged 1 commit into
CaddyGlow:mainfrom
hanzili:add-computer-use-support
Jan 27, 2026
Merged

Add Computer Use API support for Anthropic Claude#36
CaddyGlow merged 1 commit into
CaddyGlow:mainfrom
hanzili:add-computer-use-support

Conversation

@hanzili
Copy link
Copy Markdown
Contributor

@hanzili hanzili commented Jan 26, 2026

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.py to ensure these required headers are always sent:

filtered_headers["anthropic-version"] = "2023-06-01"
filtered_headers["anthropic-beta"] = "computer-use-2025-01-24"

Why These Headers Are Required

anthropic-version: 2023-06-01

Required header for all Anthropic API requests. From the official documentation:

"When making API requests, you must send an anthropic-version request header, for example, anthropic-version: 2023-06-01"

anthropic-beta: computer-use-2025-01-24

Enables Computer Use beta feature. From the Computer Use documentation:

"Computer use is currently in beta and requires a beta header: computer-use-2025-01-24"

Without this header, the API treats requests as normal chat without enabling the computer_20250124 tool.

Testing

Tested with Claude Max authentication on browser automation tasks:

  • ✅ Screenshot capture
  • ✅ Mouse/keyboard control
  • ✅ Page navigation
  • ✅ Form interaction

Before: Tasks requiring Computer Use tools failed
After: Tasks succeed (identical behavior to direct Anthropic API usage)

Changes

  • Modified ccproxy/plugins/claude_api/adapter.py (5 lines added)
  • No breaking changes
  • Headers are specific to Anthropic Claude adapter only

Impact

This enables CCProxy users to access Anthropic's official Computer Use capabilities without requiring direct API access. Particularly valuable for:

  • Browser automation applications
  • Chrome extensions using Claude
  • Desktop automation tools

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.

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>
@hanzili hanzili force-pushed the add-computer-use-support branch from 2be6cf2 to b27e9f8 Compare January 26, 2026 20:51
@CaddyGlow CaddyGlow merged commit 80f7632 into CaddyGlow:main Jan 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants