PeaqosClient via client.orchestration. Flat methods, sync, snake_case, frozen-slotted dataclasses.
Setup
client.orchestration without orchestration_url raises OrchestrationConfigError.
Configuration
Constructor kwargs
Env vars (via PeaqosClient.from_env())
| Var | Required | Purpose |
|---|---|---|
PEAQOS_RPC_URL | yes | peaq RPC for on-chain |
PEAQOS_PRIVATE_KEY | yes | signer for on-chain |
IDENTITY_REGISTRY_ADDRESS, IDENTITY_STAKING_ADDRESS, EVENT_REGISTRY_ADDRESS, MACHINE_NFT_ADDRESS, DID_REGISTRY_ADDRESS, BATCH_PRECOMPILE_ADDRESS | yes | on-chain contract addresses |
PEAQOS_ORCHESTRATION_URL | optional | enables client.orchestration |
PEAQOS_API_KEY | optional | platform API key (x-api-key header) |
PEAQOS_MCR_API_URL | optional | MCR base URL |
User-Agent: peaqos-sdk-py/<version>. Per-method timeout overrides are not exposed on public methods yet.
Envelopes
204 No Content returns None. validate_list_limit rejects limit < 1 or limit > 500 with OrchestrationValidationError.
Machines
Machine shape:
Machine agents
enroll_machine_agent returns ItemResponse[MachineAgent] whose item.provisioning_token is populated once at enrollment. machine_agent_heartbeat uses no auth header — agent_token rides in the JSON body.
Machine identity challenges
did:peaq:0x... or peaqos:machine:<id> identity reference. The DID controller signs item.message with EIP-191 personal_sign and submits the resulting {challengeId, signature} as identity_proof when creating or updating the machine record.
Agent pairings
create_agent_pairing_challengereturns a server-issued challenge keyed toagent_address,agent_provider,agent_role, and optionalagent_did.- The
item.message(EIP-191) with the key behindagent_address. create_agent_pairingaccepts the proof inparams.agent_proofand returns the pairing with a signed HS256 session JWT inpairing_token. The token is returned once at create.create_agent_pairing_sessionrotates the session token before expiry with a fresh proof. Required after anyupdate_agent_pairingto the , since policy changes invalidate the current token’sdelegation_policy_hash.
pairing_token exactly once each. AgentPairing.__repr__ redacts the token to keep it out of logs.
CreateAgentPairingRequest now requires agent_proof: AgentPairingProof and accepts optional agent_did. delegation_policy.allowed_service_ids and delegation_policy.denied_service_ids join the existing skill-level allow/deny lists.
Runtime endpoints
upsert_runtime_endpoint validates that endpoint_base_url parses as http/https with a non-empty host. auth_token is treated as a secret in error redaction.
Skills
Market services
Market search
search_market uses x-agent-pairing-token auth — the token rides as the second argument and is sent per call. get_market_search uses platform auth.
Market orders
list_market_orders and get_market_order use platform auth; the four mutating calls require the agent’s pairing_token.
execute_market_order returns a union narrowed by execution.status_code: 200 for a native run (with run + outcome), 202 for an external handoff (with handoff: { label, url, notes }).
Payment settlement
submit_payment_proof accepts both EVM and Solana proof shapes; verification_mode is "recorded" | "rpc". RPC verification cross-checks the ERC-20 Transfer log against expected token, payer_address, payee_address, and amount.
Pagination
Six sync auto-paginated iterators ship in this release:*_all accepts the same filter kwargs as its non-iterator counterpart, minus cursor. limit controls page size; cursor is managed internally.
For manual pagination, the underlying list_* methods now accept cursor and limit as keyword-only args:
MarketSearch:
Coming next
These endpoints ship on the HTTP API (see Machine Markets API: Orchestration). SDK method bindings follow shortly:- Tasks:
create_task,discover_task,resolve_task,execute_task,get_task,list_tasks - Graph:
get_machine_graph,create_graph_node,update_graph_node,delete_graph_node,create_graph_edge,update_graph_edge,delete_graph_edge - Policies:
list_policies,create_policy,get_policy,update_policy - Observability:
list_audit_events,list_runs,get_run,get_readiness,get_health - Order family extras:
cancel_market_order,retry_market_order
peaq_os_sdk so application code can prepare for the methods landing.
Errors
All extendpeaq_os_sdk.exceptions.base.PeaqosError:
CommonErrorCode literal: AUTH_REQUIRED, AUTH_INVALID, AGENT_AUTH_REQUIRED, AGENT_AUTH_INVALID, AGENT_AUTH_EXPIRED, VALIDATION_ERROR, NOT_FOUND, MACHINE_NOT_ACTIVE, MACHINE_NOT_ACTIVATED, MACHINE_IDENTITY_EXISTS, MACHINE_IDENTITY_IMMUTABLE, MACHINE_IDENTITY_PROOF_REQUIRED, MACHINE_IDENTITY_PROOF_INVALID, MACHINE_IDENTITY_PROOF_EXPIRED, PEAQOS_IDENTITY_UNAVAILABLE, AGENT_PAIRING_PROOF_REQUIRED, AGENT_PAIRING_PROOF_INVALID, AGENT_PAIRING_PROOF_EXPIRED, AGENT_PAIRING_UNAVAILABLE, AGENT_PAIRING_REQUIRED, AGENT_PAIRING_INACTIVE, AGENT_POLICY_DENIED, AGENT_SPEND_LIMIT_EXCEEDED, AGENT_DAILY_LIMIT_EXCEEDED, QUOTE_EXPIRED, ORDER_CLOSED, ORDER_NOT_DELIVERED, PAYMENT_REQUIRED, PAYMENT_RPC_REQUIRED, PAYMENT_RPC_ERROR, PAYMENT_TX_FAILED, EXECUTION_UNSUPPORTED, ENDPOINT_UNREACHABLE.
New types exported in 0.2.0:
MarketPaymentRailType adds "wdk-usdt-transfer" alongside the existing "x402" | "mpp" | "wallet" | "vault-stripe" | "escrow" | "onchain-escrow" | "offchain-record" | "external" | "not-required" set.
The transport synthesises BAD_RESPONSE (non-JSON body) and INVALID_RESPONSE_SHAPE (envelope mismatch) when the server response is malformed.
Sync vs async
Sync only on this branch. Every public function is plaindef over requests.Session. The transport reuses client.session, so users can wrap retries externally. First-class async support is on the roadmap.
Credential handling
- Platform (
x-api-key) — set once on the client viaapi_key, sent on every call by default. - Agent pairing (
x-agent-pairing-token) — passed per call tosearch_marketas the second argument. The SDK does not store or rotate it. - None — used only by
machine_agent_heartbeat(token rides in the body).
_sanitize_body redacts any field whose name contains token, key, secret, password, credential, or auth (case-insensitive) before attaching the body to an error.

