Documentation Index
Fetch the complete documentation index at: https://hexelstudio.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Initialize
from hexel import Hexel
client = Hexel(api_key="your_api_key")
Execute Code in a Sandbox
# Create a sandbox
sandbox = client.compute.sandbox.create(tier="standard")
# Execute Python code
result = client.compute.sandbox.execute(
sandbox["vm_id"],
code="print('Hello from Hexel!')",
language="python"
)
# Run a shell command
result = client.compute.sandbox.execute(
sandbox["vm_id"],
command="ls -la /workspace"
)
# Release when done
client.compute.sandbox.release(sandbox["vm_id"])
Deploy and Call an Agent
# Register an agent
agent = client.compute.agent.register(
name="my-agent",
image="ghcr.io/org/agent:v1",
capabilities=["chat"],
)
# Deploy
instance = client.compute.instance.deploy(
agent["id"],
env={"MODEL": "gpt-4"}
)
print(f"Endpoint: {instance['endpoint']}")
# https://zeal-isle-a620.compute.hexelstudio.com
Full Reference
| Client | Methods |
|---|
client.compute.sandbox | create, list, get, execute, renew, release, delete |
client.compute.agent | register, list, get, update, delete, search |
client.compute.instance | deploy, list, get, stop, redeploy, delete |