client.api_keys lists and streams API key metadata and generates local Ed25519 keypairs. Methods
are authenticated and account-scoped (account / sub_account_id).
The secret half of a keypair is generated locally and never leaves your process. You send only the public key when creating a key elsewhere (app / TypeScript session client).
Methods (API-key SDK)
| Method | Summary |
|---|---|
generate_keypair | Local Ed25519 keypair. Never sends the secret. |
list | List non-revoked keys for the account scope. |
get | Fetch one key by ak_... id. |
subscribe | Stream private key updates. |
There is no create / update / delete on this SDK. Creating or revoking keys is a
JWT/session product flow (TypeScript / browser), often with MFA step-up.
Generate keypair
pair = client.api_keys.generate_keypair()
# pair.public_key_hex / pair.secret_key_hex, persist secret yourselfList and get
keys = await client.api_keys.list()
for key in keys.api_keys:
print(key.key_id, key.label, key.status)
one = await client.api_keys.get(key_id="ak_...")
if one:
print(one.key_id, one.status, one.revision)Subscribe
Channel private:auth:api-keys:{account_id}:proto. Needs API key + Account ID.
The API key must include the API-key administration read permission. The method returns only after
the subscription-token request and Centrifugo handshake succeed.
sub = await client.api_keys.subscribe(account_id=client.default_account_id)
async with sub:
async for key in sub:
print(key.key_id, key.status)
breakCreate is JWT/session only
Do not invent a create-key call on the Python API-key SDK. Generate a keypair here, then create
the key in the Polyester app or TypeScript client.
Related
Related Topics
Address book Saved destinations and whitelist views. Auth Auth service helpers including nested profile access. Balances Read ledger balances, history, holds, and stream live balance updates. Candles Read and stream public spot OHLCV candles via market data (candles alias). Catalog Spot and Zipper catalog hydration, symbol lookups, and quantity scales used by decimal order writes. Chain helpers On-chain Funding โ Trading and Funding withdraw helpers. Chain analytics Chain analytics read APIs. Client configuration Constructor options, URLs, catalogs, wire format, and from_env behavior. Deposit Create and list per-account chain deposit addresses for funding your Polyester account. Errors Python SDK error types, MFA auth codes, realtime overflow, and retry guidance. Guard signer Guard signer approval helpers. Heatmap L2 order book heatmap reads. Internal transfers Move trading balances between Polyester accounts without touching a chain. Layout Layout collaboration APIs (reference-only). Lifecycle Deposit/withdraw lifecycle flows and subscribe. Market overview List and subscribe to per-market stats with optional snapshot-then-stream merge. Order book Depth snapshots and a stateful live order book that reconstructs the book for you. Orders Place, modify, cancel, batch, and stream spot orders, with optional attached take-profit, stop-loss, and trailing-stop risk. Policies Realtime API-key and subaccount-policy updates. Polychart Polychart collaboration APIs (reference-only). Profile Profile identity reads and subscribe helpers. Public trades Public trade tape reads and subscribe via market data. Realtime Shared Centrifugo WebSocket client, subscription contract, handshake-before-return, and fail-closed overflow. Social verification Social verification APIs (reference-only). Subaccounts Subaccount reads, members, invites, activity. User trades List and stream your private spot fills (not the public tape). Transfers Transfer history reads. Triggers Create, manage, pause/resume, and stream standalone automations that place a child order when a market condition fires. Whiteboard Whiteboard collaboration APIs (reference-only). Withdrawals Trading withdraw intents to funding or external chain destinations (signed payload). Zipper Deposit/withdraw config and related Zipper reads.