Official Python SDK for the MachineID.io API
Project description
MachineID.io Python SDK
Official Python client for the MachineID.io API.
This SDK provides a thin, explicit wrapper around MachineID’s device and usage endpoints. It is designed for AI agents and distributed systems that need predictable device-level control.
Installation
pip install machineid-io
Prerequisite
Create a free org and generate an org key at:
Set it as an environment variable:
export MACHINEID_ORG_KEY=org_your_key_here
Quick Start
from machineid_io import MachineID
client = MachineID.from_env()
device_id = "agent-01"
# Check usage / plan limits
usage = client.usage()
print("Plan:", usage["planTier"], "Limit:", usage["limit"])
# Register device (idempotent)
reg = client.register(device_id)
print("Register status:", reg["status"])
# Validate before performing work
val = client.validate(device_id)
if not val.get("allowed"):
raise SystemExit("Device blocked")
print("Device allowed:", val.get("reason"))
Supported Operations
This SDK supports:
register(device_id)validate(device_id)list_devices()revoke(device_id)unrevoke(device_id)remove(device_id)usage()
All requests authenticate via the x-org-key header and return raw API JSON.
Scope
This SDK intentionally does not:
- create orgs
- manage billing or checkout
- spawn or orchestrate agents
- perform analytics or metering
It is a device-level validation and control layer only.
Environment-Based Setup
from machineid_io import MachineID
client = MachineID.from_env()
Version
import machineid_io
print(machineid_io.__version__)
Documentation
- API reference: https://machineid.io/api
- Docs: https://machineid.io/docs
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file machineid_io-0.1.2.tar.gz.
File metadata
- Download URL: machineid_io-0.1.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
687cb3fa4bff959d508c2f29791e19a613aed308199039ecad4d0800ec4cd2a1
|
|
| MD5 |
c8e8f25028f830d654bf3139f5a81f76
|
|
| BLAKE2b-256 |
68cb96b8eb7496c6c1cca517c14d96413407fe965e07a4ae7008a8c3c8b98935
|
File details
Details for the file machineid_io-0.1.2-py3-none-any.whl.
File metadata
- Download URL: machineid_io-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07bef43e50bcd0f61da1e9a572f73bcb9cec35e914d874e818671f12e7491730
|
|
| MD5 |
6e57490a7a749a1a37bf2e176fd4b5bd
|
|
| BLAKE2b-256 |
0725c5f51121f73e66bf61295de87e24162d5f5221ee0266915aab3a0f173e20
|