Ecosystem
LLMs
- Overview
- OpenAI
- Anthropic
- Google Gemini
- Google Vertex AI
- Azure
- Bedrock
- AWS SageMaker
- Ollama
- More
- Bring Your Own LLM
Anthropic
Computer use tool
Anthropic computer use is fully supported in Obiguard. For more information on the computer use tool, please refer to the Anthropic documentation.
Usage
Python
Copy
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
# Create the request
response = client.chat.completions.create(
model="claude-4-opus-20250514",
max_tokens=3000,
thinking={
"type": "enabled",
"budget_tokens": 2030
},
stream=False,
tools=[
{
type: "computer",
computer: {
name: "computer_20250124", # This is the version of the tool
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)
Python
Copy
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
# Create the request
response = client.chat.completions.create(
model="claude-4-opus-20250514",
max_tokens=3000,
thinking={
"type": "enabled",
"budget_tokens": 2030
},
stream=False,
tools=[
{
type: "computer",
computer: {
name: "computer_20250124", # This is the version of the tool
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)
OpenAI Python
Copy
from openai import OpenAI
from obiguard import OBIGUARD_GATEWAY_URL, createHeaders
openai = OpenAI(
api_key='Anthropic_API_KEY',
base_url=OBIGUARD_GATEWAY_URL,
default_headers=createHeaders(
provider="anthropic",
obiguard_api_key="OBIGUARD_API_KEY",
strict_open_ai_compliance=False
)
)
response = client.chat.completions.create(
model="claude-4-opus-20250514",
max_tokens=3000,
thinking={
"type": "enabled",
"budget_tokens": 2030
},
stream=False,
tools=[
{
type: "computer",
computer: {
name: "computer_20250124", # This is the version of the tool
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)
cURL
Copy
curl "https://gateway.obiguard.ai/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "x-obiguard-api-key: $OBIGUARD_API_KEY" \
-H "x-obiguard-provider: anthropic" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "x-obiguard-strict-open-ai-compliance: false" \
-d '{
"model": "claude-4-opus-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."
}
]
}'
On this page
Assistant
Responses are generated using AI and may contain mistakes.