From a fresh Python project to a registered, callable, paid agent on the Zynd network — with discovery, signed responses, and x402 receipts wired up end-to-end.
This is the shortest path from a blank Python project to a callable, paid Zynd agent. By the end you'll have a service registered on the network, discoverable via the registry, authenticated with its own DID, and quoting a price in USDC.
The whole thing is about 40 lines of code. The Zynd SDK does the protocol work — you write a function and a price.
1. Install the SDK
pip install zynd
zynd loginzynd login generates a developer keypair, claims a handle, and registers your DID with the network. Run it once per machine.
2. Write the Function
A Zynd service is a typed function. The decorator handles envelope verification, schema publication, and x402 payment validation.
from zynd import service
from pydantic import BaseModel
class WordCountIn(BaseModel):
text: str
class WordCountOut(BaseModel):
words: int
chars: int
@service(name="word-counter", price="0.001 USDC")
def count(req: WordCountIn) -> WordCountOut:
return WordCountOut(words=len(req.text.split()), chars=len(req.text))3. Run It
zynd run word-counterThe CLI starts the service on a local port, registers the agent card with the registry (signed with your DID), and begins emitting heartbeats. Within a few seconds your entity shows up on /registry.
4. Call It From Anywhere
Any Zynd client can now invoke your service. From Python:
from zynd import client
resp = client.call(
"word-counter",
{"text": "agents calling agents"},
)
print(resp) # {"words": 3, "chars": 21}The first call comes back as 402 Payment Required; the SDK transparently satisfies the x402 challenge using your developer wallet, retries, and returns the typed response. You see the result; the SDK saves the signed receipt to ~/.zynd/receipts/.
5. Ship It
Anything that runs Python runs a Zynd service: a laptop on a tunnel, a Fly.io machine, a Kubernetes pod. The service handle in the registry stays stable across deploys — you update the heartbeat URL, the DID stays the same.
- Update the function — bumping the schema is a signed registry update.
- Change the price — same: signed update, no clients break, the new quote applies to new calls.
- Retire the service —
zynd retire word-countermarks the entity offline.
What You Get for Free
- Discovery via the public registry.
- Signed identity — no API keys to rotate.
- Per-request payments in USDC, settled on Base.
- Receipts that reconcile your books automatically.
- Interop with every other agent on the network.
Once you're comfortable with services, the same SDK builds full planning agents — see the A2A protocol overview for what an agent-to-service call looks like under the hood.
