from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY", # Replace with your Portkey API key
provider="@PROVIDER",
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
},
tools=[
{
"type": "computer_20250124",
"name": "computer",
"type": "computer",
"computer": {
"name": "computer_20250124",
"display_width_px": 1024,
"display_height_px": 768,
"display_number": 1,
}
},
{
"type": "str_replace_editor",
"str_replace_editor": {
"name": "text_editor_20250124",
}
},
{
"type": "bash",
"bash": {
"name": "bash_20250124",
}
}
],
messages=[
{
"role": "user",
"content": "Save a picture of a cat to my desktop."
}
]
)
print(response)