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.1.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.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hexel-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0a6cc324ac442aae4cb807770490681d05fdfc767d408530ec499775f95fe125
MD5 10acc962e280c28ca380ea8ff4981b9b
BLAKE2b-256 b8ba1009e8395fbf6fe4177ef1b2f058c61381dfe07d51402429201dc733818b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hexel-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 252de2d898c9022fba439bdb8a6af04e2c22df090f552ec5eb27039e07467c8c
MD5 aa55d060db97e232b31f91f7a67e20a2
BLAKE2b-256 5963802657c87e31ec67624738cf1e8adfa09e9170f6d17f88c5ae5f94d6f5ca

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