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

Uploaded Python 3

File details

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

File metadata

  • Download URL: hexel-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5d454a0f685ee8dcc0d85edae48770626a5c2bf14d6197c1b18b9fec0dc39eb8
MD5 1261052fac5ccaab0b44b833ed26414f
BLAKE2b-256 a62549cde74b755daad66cda95891439f19bf2d768c2715813ae5753b1fd20cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hexel-0.3.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bde9cead9d26cdc9c899afaf3db73eac1400c2f56a004f896adfa1f7ef54ffd1
MD5 16125f8f58d9de56da2c45477630f996
BLAKE2b-256 ad66dcb008be50b392b70e2f87612edba76692a4b486da5d5bbe5b1da7811046

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