Skip to main content

Hexel Studio SDK — deploy and run AI agents

Project description

Hexel Python SDK

The official Python SDK for Hexel Studio — build, deploy, and run AI agents.

Install

pip install hexel

Quick Start

from hexel import Hexel

client = Hexel(api_key="your_api_key")

# Create a sandbox and execute code
sandbox = client.compute.sandbox.create(tier="standard")
print(sandbox)  # {"vm_id": "...", "state": "allocated", ...}

# Register an agent
agent = client.compute.agent.register(
    name="my-agent",
    image="ghcr.io/org/agent:v1",
    capabilities=["chat", "streaming"],
)

# Deploy an agent
instance = client.compute.instance.deploy(agent["id"], env={"MODEL": "gpt-4"})
print(instance["endpoint"])  # https://zeal-isle-a620.compute.hexelstudio.com

Authentication

Two authentication methods are supported:

# API Key (recommended for development)
client = Hexel(api_key="studio_live_xxxx")

# OAuth Client Credentials (recommended for production)
client = Hexel(client_id="your_client_id", client_secret="your_client_secret")

Both methods exchange credentials for a short-lived STS token automatically. Tokens are cached and refreshed transparently.

Sandboxes

Sandboxes are isolated execution environments allocated instantly.

# Create
sandbox = client.compute.sandbox.create(tier="standard")

# Execute code (HTTP)
result = client.compute.sandbox.execute(sandbox["vm_id"], code="print(1+1)", language="python")

# List
sandboxes = client.compute.sandbox.list()

# Renew TTL
client.compute.sandbox.renew(sandbox["vm_id"], ttl_seconds=3600)

# Release
client.compute.sandbox.release(sandbox["vm_id"], recycle=True)

# Delete
client.compute.sandbox.delete(sandbox["vm_id"])

Agents

Agents are Docker images registered in the Hexel registry.

# Register
agent = client.compute.agent.register(
    name="fraud-detector",
    image="ghcr.io/org/fraud-agent:v1",
    capabilities=["fraud-detection"],
)

# List
agents = client.compute.agent.list()

# Get
agent = client.compute.agent.get("agent-id")

# Search
results = client.compute.agent.search(q="fraud")

# Delete
client.compute.agent.delete("agent-id")

Instances

Instances are running deployments of agents with permanent endpoints.

# Deploy
instance = client.compute.instance.deploy("agent-id", env={"MODEL": "gpt-4"})

# List
instances = client.compute.instance.list()

# Get
instance = client.compute.instance.get("deployment-id")

# Stop
client.compute.instance.stop("deployment-id")

# Redeploy
client.compute.instance.redeploy("deployment-id")

# Delete
client.compute.instance.delete("deployment-id")

Configuration

client = Hexel(
    api_key="...",
)

Requirements

  • Python 3.10+
  • httpx for HTTP
  • websockets for WebSocket connections

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hexel-0.2.2.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hexel-0.2.2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file hexel-0.2.2.tar.gz.

File metadata

  • Download URL: hexel-0.2.2.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hexel-0.2.2.tar.gz
Algorithm Hash digest
SHA256 8cc75ff1b27b3ff61bab4fc46f3e6946908ab3618d37d32dbece0b951a99735b
MD5 608b7f66a6183e0975b61829a6299ab1
BLAKE2b-256 6bc19d5579c9807f32f6668e8dec26c4b7548df136f6bd8641b57f43ceb86148

See more details on using hashes here.

File details

Details for the file hexel-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: hexel-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hexel-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8078fbba513841b83d62a7f0a968dd315763aa2aee524a7ee03542d095434388
MD5 cefe11afa84a6c04aef47c11079f2284
BLAKE2b-256 0d9c15ac25719eee146bc9d847e4e9ea243004aa9d905da66e825f283dfaaba1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page