pip install phanes

Built for Developers

Three SDKs. 122 API endpoints. 45 MCP tools. A command line that issues and verifies Phanes IDs. Everything you need to build the agent economy.

Quick start

Install in seconds.

Python for the full protocol, TypeScript for typed clients, or Docker for a batteries-included API server.

Python
install.sh
# Core SDK
pip install phanes

# Optional: FastAPI server + REST surface
pip install phanes[server]
TypeScript
package.json
npm install @phanes/sdk
Docker
compose.yml
docker compose up -d

Phanes ID

An ID for your agent
in five commands.

Keys are generated on the agent and never travel. The registry seals the document, issues the 160-byte Mark and the printed token, evaluates certification and binds insurance; anyone verifies offline through the Rust core.

The same calls exist on the Python client, the /v1 REST routes and fourteen MCP tools.

Inside the Phanes ID
phanes-id.sh
# install with the server, renderer and post-quantum extras
pip install 'phanes[server,render,pq]'

phanes keygen --out agent.key
phanes apply --server https://registry.example --key agent.key --name "Ledger Agent" \
  --controller-did did:phanes:org:acme --controller-legal-name "Acme Inc" --jurisdiction USA \
  --model-provider Anthropic --model-id claude-fable-5-1 --capability transact \
  --bound max_transaction_value=2500000 --out agent.id.json
phanes token --server https://registry.example IA1234567   # https://phanes.app/id#...
phanes certify --server https://registry.example IA1234567
phanes insure --server https://registry.example --key agent.key IA1234567 --package professional

Verify anywhere: phanes anchors, then phanes verify-mark --anchors anchors.json --require-pq.

Code examples

Real APIs. Real primitives.

Identity, settlement, consensus, and a typed client — same objects from protocol to production.

Create agent identity

Python
identity.py
from aeos.identity import AgentIdentity, AgentType, CapabilityScope, AuthorityBounds
alice = AgentIdentity.create(
    controller_did="did:aeos:acme-corp",
    agent_type=AgentType.AUTONOMOUS,
    capabilities={CapabilityScope.TRANSACT, CapabilityScope.SIGN_CONTRACT},
    bounds=AuthorityBounds(max_transaction_value=100_000_00),
)

Stripe settlement

Python
settlement_stripe.py
from aeos.settlement import StripeSettlementEngine
engine = StripeSettlementEngine("sk_test_...")
result = engine.create_escrow("contract-001", 25000, "usd", "did:alice", "did:bob")
engine.capture_escrow("contract-001")    # On fulfillment
engine.refund_escrow("contract-001")    # On dispute

BFT consensus

Python
ledger.py
from aeos.bft_ledger import DistributedLedger
ledger = DistributedLedger(num_replicas=4)
result = ledger.submit({ "type": "agent_registered", "did": "did:aeos:alice" })
assert result["committed"]

TypeScript SDK

TypeScript
agent.ts
import { AgentIdentity, AgentType, Capability, PhanesClient } from "@phanes/sdk";
const agent = AgentIdentity.create("did:aeos:corp", AgentType.AUTONOMOUS,
  [Capability.TRANSACT, Capability.SIGN_CONTRACT],
  { maxTransactionValue: 100_000_00 });

SDKs

Polyglot by design

Same protocol semantics across runtimes — pick the surface that matches your stack.

Python SDK

pip install phanes

19 modules, full protocol access: identity through consensus and settlement.

  • 19 modules — full protocol access
  • Phanes ID: phanes CLI, PhanesClient, OfflineVerifier
  • MCP: python -m aeos.mcp_server
  • Stripe & USDC settlement engines
View on PyPI

TypeScript SDK

@phanes/sdk

Crypto, identity, contracts, a typed HTTP client against the REST API, and the Phanes ID stack with client-side signing.

  • Crypto, identity, contracts models
  • Typed HTTP client (OpenAPI-aligned)
  • PhanesIdClient: Phanes ID applications, the activity record, contracts, disputes and votes signed with the agent's own keys
  • inspectVerified: the registry's signed report, every ledger proof and every anchor checked in Node
  • Byte-compatible with the Python reference (vector tests) and run against a live registry
npm package

Rust

bulletproofs · Ristretto255

The bulletproofs crate powers range proofs with a Python FFI bridge.

  • Ristretto255 range proofs (bulletproofs)
  • Python FFI for aeos.zk workflows
  • Risk & settlement attestations
View documentation

REST API

FastAPI.
87 endpoints.

FastAPI server with OpenAPI at /docs: 17 protocol routes, 100 non-custodial routes under /v1 (47 for the Phanes ID, 19 for the agent stack: contracts, settlement, disputes, anchors, the inspector) and 4 public verification routes. Install phanes[server] for the full REST surface.

Export the schema for codegen; idempotent writes where the ledger requires them.

Full API reference (docs.phanes.app)
routes.txt
# Example endpoints
POST /v1/ids/apply
GET /v1/ids/{number}/mark.bin
POST /v1/marks/verify
POST /v1/agents/{number}/contracts
POST /v1/agents/{number}/contracts/{id}/sign
POST /v1/agents/{number}/disputes
GET /v1/agents/{number}/inspect
GET /v1/anchors/{id}
GET /v1/oversight/agents
GET /v1/oversight/agents/{number}
GET /v1/oversight/events
GET /v1/oversight/alerts
POST /v1/pay/{number}/authorise
GET /v1/keys/{kid}
POST /v1/witness/cosign
GET /v/{number}
GET /.well-known/phanes/anchors.json
# Complete list: /docs + documentation site

Interactive Swagger UI ships with every server build.

MCP integration

45 toolsfor Claude & GPT

Wire models to assistants via Model Context Protocol — structured tool calls instead of ad-hoc prompts.

mcp.json
{
  "mcpServers": {
    "aeos": {
      "command": "python",
      "args": ["-m", "aeos.mcp_server"]
    }
  }
}
Registered tools
phanes_id_applyphanes_id_showphanes_id_presentphanes_verify_challengephanes_id_verifyphanes_activity_recordphanes_activity_transcriptphanes_insurance_packagesphanes_insurance_quotephanes_insurance_bindphanes_insurance_claimphanes_mark_getphanes_mark_verifyphanes_certification_evaluatephanes_stack_summaryphanes_contract_proposephanes_contract_signphanes_contract_fulfillphanes_contract_getphanes_dispute_filephanes_dispute_evidencephanes_dispute_votephanes_agent_inspectphanes_oversight_agentsphanes_oversight_agentphanes_oversight_eventsphanes_oversight_alertsphanes_admission_pendingphanes_admission_decidephanes_pay_intentphanes_pay_tokenphanes_payphanes_pay_verify_receiptphanes_anchor_verifyaeos_create_agentaeos_get_agentaeos_create_contractaeos_sign_contractaeos_fulfill_obligationaeos_get_contractaeos_file_disputeaeos_resolve_disputeaeos_assess_riskaeos_ledger_statsaeos_network_health

Tools return structured JSON aligned with protocol events — receipts, not prose.

Documentation

Ship faster with docs.phanes.app

Guides, API reference, architecture, and security deep-dives — synced with protocol releases.

AEOS Protocol · Phanes.app