@@ -47,6 +47,7 @@ class Client:
4747 def __init__ (
4848 self ,
4949 private_key : str ,
50+ alpha_private_key : Optional [str ] = None ,
5051 email : Optional [str ] = None ,
5152 password : Optional [str ] = None ,
5253 twins_api_key : Optional [str ] = None ,
@@ -61,11 +62,13 @@ def __init__(
6162 Initialize the OpenGradient client.
6263
6364 Args:
64- private_key: Private key for OpenGradient transactions.
65+ private_key: Private key for LLM inference (Base Sepolia, x402 payments).
66+ alpha_private_key: Private key for Alpha Testnet features (on-chain inference).
67+ When omitted, falls back to ``private_key`` for backward compatibility.
6568 email: Email for Model Hub authentication. Optional.
6669 password: Password for Model Hub authentication. Optional.
6770 twins_api_key: API key for digital twins chat (twin.fun). Optional.
68- rpc_url: RPC URL for the blockchain network.
71+ rpc_url: RPC URL for the Alpha Testnet blockchain network.
6972 api_url: API URL for the OpenGradient API.
7073 contract_address: Inference contract address.
7174 og_llm_server_url: OpenGradient LLM server URL.
@@ -74,6 +77,12 @@ def __init__(
7477 blockchain = Web3 (Web3 .HTTPProvider (rpc_url ))
7578 wallet_account = blockchain .eth .account .from_key (private_key )
7679
80+ # Use a separate account for Alpha Testnet when provided
81+ if alpha_private_key is not None :
82+ alpha_wallet_account = blockchain .eth .account .from_key (alpha_private_key )
83+ else :
84+ alpha_wallet_account = wallet_account
85+
7786 hub_user = None
7887 if email is not None :
7988 hub_user = ModelHub ._login_to_hub (email , password )
@@ -90,7 +99,7 @@ def __init__(
9099
91100 self .alpha = Alpha (
92101 blockchain = blockchain ,
93- wallet_account = wallet_account ,
102+ wallet_account = alpha_wallet_account ,
94103 inference_hub_contract_address = contract_address ,
95104 api_url = api_url ,
96105 )
0 commit comments