Anthropic computer use is fully supported in Portkey. For more information on the computer use tool, please refer to the Anthropic documentation.

Usage

    from portkey_ai import Portkey

    # Initialize the Portkey client
    portkey = Portkey(
        api_key="PORTKEY_API_KEY",  # Replace with your Portkey API key
        virtual_key="VIRTUAL_KEY",
        strict_open_ai_compliance="false"


    )

    # Create the request
    response = portkey.chat.completions.create(
      anthropic_beta="computer-use-2025-01-24",
      model="claude-opus-4-20250514",
      max_tokens=3000,
      thinking={
          "type": "enabled",
          "budget_tokens": 2030
      },
      stream=False,

      tools=[
        {
            "type": "computer",
            "computer": {
                "name": "computer_20250124",
                "display_width_px": 1024,
                "display_height_px": 768,
                "display_number": 1,
            }
        },
        {
            "type": "text_editor_20250429",
            "name": "str_replace_based_edit_tool"
        },
        {
            "type": "bash_20250124",
            "name": "bash"
        }
      ],
      messages=[
        {
            "role": "user",
            "content": "Save a picture of a cat to my desktop."
        }
      ]
      )
      print(response)

Portkey Features

Now that you have enterprise-grade Anthropic Computer Use setup, let’s explore the comprehensive features Portkey provides to ensure secure, efficient, and cost-effective AI-assisted development.

1. Comprehensive Metrics

Using Portkey you can track 40+ key metrics including cost, token usage, response time, and performance across all your LLM providers in real time. Filter these metrics by developer, team, or project using custom metadata.

2. Advanced Logs

Portkey’s logging dashboard provides detailed logs for every request made by Anthropic Computer Use. These logs include:

  • Complete request and response tracking
  • Code context and generation metrics
  • Developer attribution
  • Cost breakdown per coding session

3. Unified Access to 250+ LLMs

Easily switch between 250+ LLMs for different coding tasks. Use GPT-4 for complex architecture decisions, Claude for detailed code reviews, or specialized models for specific languages - all through a single interface.

4. Advanced Metadata Tracking

Track coding patterns and productivity metrics with custom metadata:

  • Language and framework usage
  • Code generation vs completion tasks
  • Time-of-day productivity patterns
  • Project-specific metrics

Custom Metadata

5. Enterprise Access Management

6. Reliability Features

7. Advanced Guardrails

Protect your codebase and enhance security with real-time checks on AI interactions:

  • Prevent exposure of API keys and secrets
  • Block generation of malicious code patterns
  • Enforce coding standards and best practices
  • Custom security rules for your organization
  • License compliance checks

Guardrails

Implement real-time protection for your development environment with automatic detection and filtering of sensitive code, credentials, and security vulnerabilities.

FAQs

Next Steps

Join our Community

For enterprise support and custom features for your development teams, contact our enterprise team.