Official Python SDK for HeadlessDomains - The Autonomous Identity Layer
Project description
Headless Domains Python SDK
The official Python SDK for the Headless Domains API. Build decentralized identities, register agent names, and execute Machine-to-Machine (M2M) payments effortlessly.
Installation
pip install headlessdomains
Quick Start
1. Anonymous Agent Provisioning (Zero-Human Start)
AI Agents can onboard themselves without a human account:
from headlessdomains import Client
client = Client() # No auth needed to provision
agent = client.agents.provision("my-cool-agent")
print(f"My API Key: {agent.api_key}")
print(f"Give this code to my human owner: {agent.claim_code}")
2. Authenticated Usage
Once you have an API key, use it to search and register domains:
from headlessdomains import Client
client = Client(api_key="hd_agent_XXXXX")
# Check availability
availability = client.domains.search("janice.agent")
if availability.is_available:
print(f"Domain is available for {availability.price} Gems")
# Get domain profile
profile = client.domains.lookup("janice.agent")
print(f"Bio: {profile.bio}")
print(f"Skills: {profile.skills}")
3. Machine-to-Machine Payments (MPP)
The SDK natively catches and parses 402 Payment Required responses, giving you structured data to execute smart contract transactions.
from headlessdomains import Client, PaymentRequiredError
client = Client(api_key="hd_agent_XXXXX")
try:
client.domains.register("mybot.chatbot", years=1)
print("Registered successfully with existing Gems!")
except PaymentRequiredError as e:
print(f"Payment Required!")
print(f"Send {e.amount} wei to {e.recipient}")
print(f"Currency Contract: {e.currency} on Chain {e.chain_id}")
print(f"Session ID to use in Memo: {e.session_id}")
# ... execute your web3 transaction ...
Async Support
An asynchronous client is also available for high-concurrency systems:
import asyncio
from headlessdomains import AsyncClient
async def main():
async with AsyncClient(api_key="hd_agent_XXXXX") as client:
profile = await client.domains.lookup("janice.agent")
print(profile.status)
asyncio.run(main())
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 headlessdomains-0.1.0.tar.gz.
File metadata
- Download URL: headlessdomains-0.1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ca08727223b852240416658642eaedd258a39f9dedf48d0a8f508dc5822d4b9
|
|
| MD5 |
794cda3b44bc0219b6039ba22ada90f2
|
|
| BLAKE2b-256 |
df3722d199927bc325cf18a27021675c8954f647e9462fb19a3f2425375cd9d9
|
Provenance
The following attestation bundles were made for headlessdomains-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on shadstoneofficial/headlessdomains-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
headlessdomains-0.1.0.tar.gz -
Subject digest:
8ca08727223b852240416658642eaedd258a39f9dedf48d0a8f508dc5822d4b9 - Sigstore transparency entry: 1389044248
- Sigstore integration time:
-
Permalink:
shadstoneofficial/headlessdomains-python-sdk@c068ca38d825ddb5f733ff322b69361c4cd4c561 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shadstoneofficial
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c068ca38d825ddb5f733ff322b69361c4cd4c561 -
Trigger Event:
release
-
Statement type:
File details
Details for the file headlessdomains-0.1.0-py3-none-any.whl.
File metadata
- Download URL: headlessdomains-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
045fb5a55152ca983cfeca34b560768c600d86be781fd260372c0e1610677971
|
|
| MD5 |
ea7fb3c47b66e33fd5f21f5395fcb683
|
|
| BLAKE2b-256 |
1a51725d4b2af3ef3b8815707bcaa190310ef561af71bf2ebc33aa868a8d7503
|
Provenance
The following attestation bundles were made for headlessdomains-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on shadstoneofficial/headlessdomains-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
headlessdomains-0.1.0-py3-none-any.whl -
Subject digest:
045fb5a55152ca983cfeca34b560768c600d86be781fd260372c0e1610677971 - Sigstore transparency entry: 1389044345
- Sigstore integration time:
-
Permalink:
shadstoneofficial/headlessdomains-python-sdk@c068ca38d825ddb5f733ff322b69361c4cd4c561 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shadstoneofficial
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c068ca38d825ddb5f733ff322b69361c4cd4c561 -
Trigger Event:
release
-
Statement type: