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.1.3.tar.gz (21.2 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.1.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hexel-0.1.3.tar.gz
  • Upload date:
  • Size: 21.2 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.1.3.tar.gz
Algorithm Hash digest
SHA256 131384a8ac05082b7fffc9c1ffe0610d976dc40edbac776933c043fea3f41277
MD5 ef8e01f75c26734882981fdc4bc66f01
BLAKE2b-256 1b06e64d7a7bb26176d759ee9a6c468711c9f69e22a36bf18b7233a5b7173919

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hexel-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.7 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.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c444c83eeecffa6e6b73737ca8562546e838cd741c901f614fef855b16b34746
MD5 d909ce8a49fb9cd364cadb8b0704b683
BLAKE2b-256 1747baf694d2f7bf0e1bf9163c105bf5b949f7dd7cad9d8b1f41d47957e37f97

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