AgentTier Python SDK
Programmatic client for AgentTier — manage isolated, persistent Kubernetes sandboxes for humans and AI agents from Python.
pip install agenttier
Synchronous quick start
from agenttier import AgentTierClient
with AgentTierClient(api_url="https://agenttier.company.com") as client:
sandbox = client.create_sandbox(template="general-coding", name="demo")
sandbox.wait_until_running()
result = sandbox.exec("echo 'hello from AgentTier'")
print(result.stdout, "exit", result.exit_code)
port = sandbox.forward_port(8080)
print("Forwarded:", port.preview_url or port.internal_url)
sandbox.terminate()
Async
import asyncio
from agenttier import AsyncAgentTierClient
async def main():
async with AsyncAgentTierClient(api_url="https://agenttier.company.com") as client:
sandbox = await client.create_sandbox(template="general-coding", name="demo")
await sandbox.wait_until_running()
result = await sandbox.exec("uname -a")
print(result.stdout)
await sandbox.terminate()
asyncio.run(main())
Authentication
The SDK auto-detects credentials in this order:
AGENTTIER_API_KEY— sent asX-API-Key.AGENTTIER_TOKEN— sent asAuthorization: Bearer <token>(OIDC JWT).- In-cluster ServiceAccount token at
/var/run/secrets/kubernetes.io/serviceaccount/token. - Unauthenticated (accepted only in the Router's dev mode).
Or pass an explicit provider:
from agenttier import AgentTierClient, APIKeyAuth, BearerTokenAuth
client = AgentTierClient(
api_url="https://agenttier.company.com",
auth=APIKeyAuth("sk_live_..."),
)
Error handling
Every error inherits from AgentTierError so you can catch them all at once.
The common subclasses you'll want to handle individually:
| Exception | When |
|---|---|
AuthenticationError |
401 — token / API key missing or invalid |
AuthorizationError |
403 — authenticated but not permitted |
PolicyViolationError |
403 with governance body; exposes .violations |
NotFoundError |
404 — resource doesn't exist |
ConflictError |
409 — operation invalid for current state |
SandboxTimeoutError |
wait_until_running timed out |
SandboxErrorState |
sandbox entered the Error phase while waiting |
APIError |
anything else; carries .status_code and .body |
Supported API surface (v0.1.1)
Only endpoints that the Router server implements in v0.1.0 are exposed:
- Sandboxes —
create_sandbox,list_sandboxes,get_sandbox,stop,resume,terminate,exec,wait_until_running,status. - Port forwarding —
forward_port,list_ports,remove_port. - Templates —
list_templates,get_template. - Identity —
current_user.
Endpoints that are not yet implemented on the server (file transfer, sharing, cloning, WebSocket terminal from Python) are not exposed by the SDK and will be added in a future release once the server ships them.
Supported Python versions
3.10, 3.11, 3.12, 3.13. Runtime dependencies: httpx and pydantic.
License
Apache-2.0. Source at github.com/agenttier/agenttier/tree/main/python-sdk.
Metadata
Release files for agenttier 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| agenttier-0.8.1.tar.gz | 40.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agenttier-0.8.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 80.1 kB
Release files / agenttier-0.8.1.tar.gz
| Download URL | agenttier-0.8.1.tar.gz |
|---|---|
| Size | 40.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64a8ec8b885c421a5391e54ea02e252b1d53a45ee736c2679c64b4d7897b3907
|
|
BLAKE2b-256 checksum How to use checksums |
792fd2890729132d39036a26a580a10e7fb1cf47f8c11f53a71169a79dcc4769
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / agenttier-0.8.1-py3-none-any.whl
| Download URL | agenttier-0.8.1-py3-none-any.whl |
|---|---|
| Size | 39.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
751c2a546e2af4fe198336c206f2898b6c135efaaeb90ddfd8ecaf59fb8401d4
|
|
BLAKE2b-256 checksum How to use checksums |
f43dfa66d4171d365b4e174a25674b82eac0e30185c2e2dd7d3e638363331e1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for agenttier 0.8.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.