Skip to main content

Headless Domains Python SDK

The official Python SDK for Headless Domains (https://headlessdomains.com). Build decentralized identities, register agent names, and execute Machine-to-Machine (M2M) payments effortlessly. For full API documentation, visit https://docs.headlessdomains.com.

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 lookup 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)

Note on Registration Auth: To register or renew domains, an agent must either be claimed by a human account (GFAVIP) or you must authenticate directly using a gfavip_token. Using an unclaimed hd_agent_ key alone will return a 401 Authentication Error.

The SDK natively catches and parses 402 Payment Required responses, giving you structured data to execute smart contract transactions.

from headlessdomains import Client, PaymentRequiredError

# Use a GFAVIP token (or a fully claimed agent api_key) for registration
client = Client(gfavip_token="gfavip_XXXXX")

try:
    client.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 ...

4. Workflows and MCP (Model Context Protocol)

You can register agents with rich workflows (such as MCP tool connections) directly at registration time. This allows agents to seamlessly integrate with GitHub Company OS, Claude, and other agentic workflows:

from headlessdomains import Client

client = Client(gfavip_token="gfavip_XXXXX")

# Register an agent and configure workflows in a single line
me = client.register(
    "mystore", 
    "agent", 
    workflows={
        "mcp": {
            "version": "2024-11",
            "enabled": True,
            "servers": [
                {
                    "name": "catalog-tool",
                    "endpoint": "mcp://tools/catalog",
                    "description": "Agentic product feed & enrichment"
                }
            ],
            "claude_compatible": True,
            "auto_map_skills": True
        }
    }
)

# You can also update workflows on an existing agent
client.update_bio("mystore.agent", workflows={"mcp": {"enabled": False}})

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())

Release files for headlessdomains 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for headlessdomains 0.1.6
File Size Uploaded
headlessdomains-0.1.6.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for headlessdomains 0.1.6
File Interpreter ABI Platform
headlessdomains-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / headlessdomains-0.1.6.tar.gz

Download URL headlessdomains-0.1.6.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7f3ca6192528da32916d38f7d2a79f49a25fb925518a6566a0f82b678a9a3200
BLAKE2b-256 checksum
How to use checksums
9b36fd29005acca0bcc125127a91c362c42bc5e9a5280faef08b4f93b129f5ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 3, 2026.

Transparency log

Release files / headlessdomains-0.1.6-py3-none-any.whl

Download URL headlessdomains-0.1.6-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df1dee31f1ad47fe57d992617eac41de5f7c984ceb5c443dad008efaf5dc83f4
BLAKE2b-256 checksum
How to use checksums
02a5a61d6962530eab2cb9568d1772966b6805d0992687d4f0645a2f93cb1177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page