Skip to main content

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:

https://machineid.io

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


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

machineid_io-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

machineid_io-0.1.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

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

Hashes for machineid_io-0.1.2.tar.gz
Algorithm Hash digest
SHA256 687cb3fa4bff959d508c2f29791e19a613aed308199039ecad4d0800ec4cd2a1
MD5 c8e8f25028f830d654bf3139f5a81f76
BLAKE2b-256 68cb96b8eb7496c6c1cca517c14d96413407fe965e07a4ae7008a8c3c8b98935

See more details on using hashes here.

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

Hashes for machineid_io-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 07bef43e50bcd0f61da1e9a572f73bcb9cec35e914d874e818671f12e7491730
MD5 6e57490a7a749a1a37bf2e176fd4b5bd
BLAKE2b-256 0725c5f51121f73e66bf61295de87e24162d5f5221ee0266915aab3a0f173e20

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