Skip to main content

Axilio Python SDK — manage workflows, runs, devices, usage, and control devices remotely

Project description

Axilio Python SDK

The official Python SDK for Axilio. One pip package covers account management, device discovery, allocation, and the full remote control surface (tap, swipe, OCR, screenshot, ...).

Installation

pip install axilio

Quick start

from axilio import Client

# Reads AXILIO_API_KEY from the environment.
client = Client()

# One-shot device session — allocate, connect, control, clean up.
with client.devices.session(platform="android") as device:
    device.tap(540, 1200)
    device.type("hello world")
    device.screenshot("after.png")

The same code runs unmodified inside an Axilio sandbox VM — when you schedule a workflow in the dashboard, Hephaestus injects scoped auth and the paired Atlas endpoint at boot, and the Client auto-detects sandbox mode. No if local: ... else: ... branches in your code.

Authentication

export AXILIO_API_KEY=ax_live_...

Or pass explicitly:

client = Client(api_key="ax_...")
client = Client(api_key="ax_...", base_url="https://staging-api.axilio.ai")

Generate keys from the Axilio dashboard. API keys are scoped to one organization — multi-org users mint one key per org.

Resources

Resource Methods Notes
client.billing balance(), subscription(), invoices(), upgrade(), downgrade() Reads everywhere; upgrade/downgrade local-only
client.usage metrics(), sessions() Both modes
client.api_keys list(), create(), revoke() Local-only
client.org current(), members(), invite(), remove_member() Reads everywhere; member writes local-only
client.devices available(), locations(), supported_apps(), allocate(), connect(), deallocate(), session() Sandbox mode short-circuits allocate()
client.workflows list(), get(), create(), update(), delete() Both modes
client.runs list(), get(), create(), cancel() Both modes

For the full method surface, type signatures, and the device control vocabulary, see the SDK design doc in the monorepo.

Errors

All errors raised by the SDK subclass axilio.AxilioError:

from axilio import Client, NotFoundError, RateLimitError, SandboxPermissionError

client = Client()

try:
    run = client.runs.get("run_does_not_exist")
except NotFoundError:
    print("run not found")
except RateLimitError:
    # backoff + retry
    ...
except SandboxPermissionError:
    # tried a local-only write from inside a sandbox VM
    ...
Exception HTTP Notes
UnauthorizedError 401 API key missing, malformed, or rejected
NotFoundError 404 Resource doesn't exist or isn't visible
RateLimitError 429 Retry after backoff
ServerError 5xx Transient; safe to retry
SandboxPermissionError Local-only operation attempted from sandbox
AllocationMismatchError Sandbox kwargs don't match the bound allocation
AxilioError other Catch-all

Configuration

Env var Description
AXILIO_API_KEY API key for authentication. Required in local mode.
AXILIO_BASE_URL Override the API host (defaults to https://api.axilio.ai).
AXILIO_SANDBOX_TOKEN Scoped sandbox token. Injected by Hephaestus inside a sandbox VM; not set in local mode.
AXILIO_ATLAS_ENDPOINT Paired Atlas endpoint inside a sandbox VM. Injected by Hephaestus.
Constructor kwarg Default Description
api_key AXILIO_API_KEY env, then AXILIO_SANDBOX_TOKEN (sandbox mode) Bearer token
base_url AXILIO_BASE_URL env, then https://api.axilio.ai API host
timeout 30.0 Request timeout in seconds
max_retries 3 Retry budget for 429 + 5xx (TODO: wire)
retry_base_delay 0.5 Exponential backoff base

Status

This is the v0 scaffold. The public surface (Client + resource classes) matches the design doc; method bodies are stubs (NotImplementedError) until codegen lands the typed wire calls. The codegen pipeline is driven by repository_dispatch from the monorepo's publish-sdk-spec job on each backend deploy — see .github/workflows/sdk-regenerate.yml (landing next).

What's not here

  • Async client — sync only for v0.
  • In-sandbox device drivers (the implementation that actually drives a phone screen) — those live inside Atlas + the runner image, not in this SDK.
  • SSE / WebSocket subscriptions for live run events — REST only; SSE lands when a consumer needs it.

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

axilio-0.1.1.tar.gz (122.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

axilio-0.1.1-py3-none-any.whl (240.7 kB view details)

Uploaded Python 3

File details

Details for the file axilio-0.1.1.tar.gz.

File metadata

  • Download URL: axilio-0.1.1.tar.gz
  • Upload date:
  • Size: 122.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for axilio-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6b871e5f6c56eec5849aa3505d14d93702b290508aa7d961792b78c9ca345d43
MD5 37c23feba6421a922097cc47fd8be71f
BLAKE2b-256 41435eb0a1904d96e1c8e301ae35d787de107dfbbe9d5557dacdca025cdf9732

See more details on using hashes here.

File details

Details for the file axilio-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: axilio-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 240.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for axilio-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f6e71a776947256aef46456a6665fcad8a36741bb5d042cf4ce6c0e80c2f12fb
MD5 e7e3dc1454e2955ee8667590bf53cacd
BLAKE2b-256 a655ab2761018f5bfaccbd4f290e097a521f808cfa29dc04b1928e2f7fe7f614

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