Date: 2026-06-19 Changes: - Fixed 98 empty .md files that had failed to scrape - Updated changelog with latest entries (Jun 15, 2026: CLOB DELETE /orders limit reduced to 1000) - Refreshed FAQ, Polymarket Learn, Developers, and other sections Notable updates: - Jun 15, 2026: CLOB DELETE /orders maximum batch size reduced to 1000 - Jun 1, 2026: Increased CLOB order rate limits - May 18, 2026: builderCode added to builders endpoints - May 14, 2026: GET /markets/keyset limit reduced to 100
11 KiB
Documentation Index
Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt Use this file to discover all available pages before exploring further.
L1 Methods
These methods require a wallet signer (private key) but do not require user API credentials. Use these for initial setup.
Client Initialization
L1 methods require the client to initialize with a signer.
```typescript theme={null} import { ClobClient } from "@polymarket/clob-client-v2"; import { createWalletClient, http } from "viem"; import { privateKeyToAccount } from "viem/accounts";const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const signer = createWalletClient({ account, transport: http() });
const client = new ClobClient({
host: "https://clob.polymarket.com",
chain: 137,
signer, // Signer required for L1 methods
});
// Ready to create user API credentials
const apiKey = await client.createApiKey();
```
```python theme={null}
from py_clob_client_v2 import ClobClient
import os
private_key = os.getenv("PRIVATE_KEY")
client = ClobClient(
host="https://clob.polymarket.com",
chain_id=137,
key=private_key # Signer required for L1 methods
)
# Ready to create user API credentials
api_key = client.create_api_key()
```
Never commit private keys to version control. Always use environment variables
or a secure key management system.
API Key Management
createApiKey
Creates a new API key (L2 credentials) for the wallet signer.
async createApiKey(nonce?: number): Promise<ApiKeyCreds>
deriveApiKey
Derives an existing API key using a specific nonce. If you've already created credentials with a particular nonce, this returns the same credentials.
async deriveApiKey(nonce?: number): Promise<ApiKeyCreds>
createOrDeriveApiKey
Convenience method that attempts to derive an API key with the default nonce, or creates a new one if it doesn't exist. Recommended for initial setup.
async createOrDeriveApiKey(nonce?: number): Promise<ApiKeyCreds>
Order Signing
In CLOB V2, `expiration` is still accepted in order payloads for GTD/order expiry handling, but it is not part of the EIP-712 signed order struct. The signed struct uses `timestamp`, `metadata`, and `builder` instead of the V1 `expiration`, `nonce`, `feeRateBps`, and `taker` fields.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 submission logic. Submit via postOrder() or postOrders().
async createOrder(
userOrder: UserOrder,
options?: Partial<CreateOrderOptions>
): Promise<SignedOrder>
createMarketOrder
Create and sign a market order locally without posting it to the CLOB. Submit via postOrder() or postOrders().
async createMarketOrder(
userMarketOrder: UserMarketOrder,
options?: Partial<CreateOrderOptions>
): Promise<SignedOrder>
Troubleshooting
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
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()`
Your funder address is incorrect or doesn't match your wallet.
**Solution:** New API users should use the deposit wallet address as the
funder with signature type `3`. Existing Safe and Proxy users should use
their current smart-wallet address.
Use `deriveApiKey()` with the original nonce:
```typescript theme={null}
const recovered = await client.deriveApiKey(originalNonce);
```
There's no way to recover lost credentials without the nonce. Create new ones:
```typescript theme={null}
// Create fresh credentials with a new nonce
const newCreds = await client.createApiKey();
// Save the nonce this time!
```