from py_blink_client import ClobClient# Public data only (no auth needed)client = ClobClient(host="https://api.blink15.com")# Trading (requires wallet private key)client = ClobClient( host="https://api.blink15.com", key="0xYOUR_PRIVATE_KEY",)# Create API credentials (one-time — cached on the client)creds = client.create_or_derive_api_creds()print(f"API Key: {creds.api_key}")
Your private key never leaves your machine. It’s only used locally to sign an EIP-712 message that proves wallet ownership.
Blink uses two auth levels (same as Polymarket):Level 1 — EIP-712 (one-time setup)Your wallet signs a typed data message to create API credentials. This happens once when you call create_or_derive_api_creds().Level 2 — HMAC-SHA256 (every request)All trading requests are signed with HMAC. The SDK handles this automatically after credentials are created.
# After create_or_derive_api_creds(), all calls use HMAC authorders = client.get_orders() # authenticatedclient.create_and_post_order(...) # authenticatedclient.cancel(...) # authenticated