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.3.2.tar.gz (76.3 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.3.2-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hexel-0.3.2.tar.gz
  • Upload date:
  • Size: 76.3 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.3.2.tar.gz
Algorithm Hash digest
SHA256 c36aebde160bfe08b396c8b9db18725a955c2bb8e8416a12cfbc0de660969fd6
MD5 1f88e723a542c162e0ea6145e9a474b6
BLAKE2b-256 71f221eb7f0d5ac5c58b75ffcd8ced7a4e5f5eb6b31be79ff20c6d76a0214c17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hexel-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 38.4 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.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76c1c1f12dac525beb18a7a1df86e631ce84470eb7f98cf27f8f1c4914df9387
MD5 773ffbba1745b892a04fbec9219af6b5
BLAKE2b-256 b7badbae1dcb018ba97cc41d1adb4348a3a9cbe353ef1737812c6be0f7af29ea

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