Client Initialization
L1 methods require the client to initialize with a signer.- TypeScript
- Python
API Key Management
createApiKey()
Creates a new API key (L2 credentials) for the wallet signer. This generates a new set of credentials that can be used for L2 authenticated requests. Each wallet can only have one active API key at a time. Creating a new key invalidates the previous one.Signature
Params
Response
deriveApiKey()
Derives an existing API key (L2 credentials) using a specific nonce. If you’ve already created API credentials with a particular nonce, this method will return the same credentials again.Signature
Params
Response
createOrDeriveApiKey()
Convenience method that attempts to derive an API key with the default nonce, or creates a new one if it doesn’t exist. This is the recommended method for initial setup if you’re unsure if credentials already exist.Signature
Params
Response
Order Signing
createOrder()
Create and sign a limit order locally without posting it to the CLOB. Use this when you want to sign orders in advance or implement custom order submission logic. Place order via L2 methods postOrder or postOrders.Signature
Params
Response
createMarketOrder()
Create and sign a market order locally without posting it to the CLOB. Use this when you want to sign orders in advance or implement custom order submission logic. Place orders via L2 methods postOrder or postOrders.Signature
Params
Response
Troubleshooting
Error: INVALID_SIGNATURE
Error: INVALID_SIGNATURE
Your wallet’s private key is incorrect or improperly formatted.Solution:
- Verify your private key is a valid hex string (starts with “0x”)
- Ensure you’re using the correct key for the intended address
- Check that the key has proper permissions
Error: NONCE_ALREADY_USED
Error: NONCE_ALREADY_USED
The nonce you provided has already been used to create an API key.Solution:
- Use
deriveApiKey()with the same nonce to retrieve existing credentials - Or use a different nonce with
createApiKey()
Error: Invalid Funder Address
Error: Invalid Funder Address
Your funder address is incorrect or doesn’t match your wallet.Solution: Check your Polymarket profile address at polymarket.com/settings.If it does not exist or user has never logged into Polymarket.com, deploy it first before creating L2 authentication.
Lost API credentials but have nonce
Lost API credentials but have nonce
Lost both credentials and nonce
Lost both credentials and nonce
Unfortunately, there’s no way to recover lost API credentials without the nonce. You’ll need to create new credentials: