All API endpoints require authentication using Ed25519 digital signatures.Documentation Index
Fetch the complete documentation index at: https://docs-polymarket-us.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Ed25519 elliptic curve digital signature algorithm
- Request signing with private keys
- 256-bit security level (equivalent to RSA-3072 or higher)
- Required for trading, portfolio, and WebSocket endpoints
Generate API Keys
Visit the developer portal to generate your Ed25519 API keys. Your private key will be shown only once.
How It Works
Each API request must be signed with your private Ed25519 key. The signature proves that the request came from you without exposing your private key.Signature Construction
Required Headers
Every authenticated request must include these three headers:| Header | Value | Description |
|---|---|---|
X-PM-Access-Key | API key ID (UUID) | Your public API key identifier |
X-PM-Timestamp | Unix timestamp in milliseconds | Current time when making the request |
X-PM-Signature | Base64-encoded Ed25519 signature | Signature of timestamp + method + path |
Example Request
Python Example
Getting Started
- Visit the web portal to generate your API keys
- Receive your API key ID and private key - the private key is shown only once
- Store your private key securely - you cannot retrieve it later
- Sign each request using the Ed25519 signature method above
Key Structure
Your Ed25519 private key is 64 bytes (base64-encoded):- Bytes 0-31: Seed (used to derive the key pair)
- Bytes 32-63: Public key
Security Features
- Immediate revocation: Keys can be revoked instantly via the developer portal
- No token expiration: Keys remain valid until explicitly revoked
- Fast verification: Ed25519 signature verification is extremely fast
- Kalshi-compatible: Same algorithm used by other prediction market platforms
API Key Security
- Store keys securely - treat them like passwords
- Never commit keys to version control - use environment variables
- Rotate keys regularly - generate new keys periodically
- Revoke compromised keys immediately - use the developer portal
- Use separate keys for different environments - dev, staging, production
- Private key shown only once - save it immediately when generated
Timestamp Validation
Requests must have a timestamp within 30 seconds of the server time to prevent replay attacks. If your request fails with a timestamp error:- Ensure your system clock is synchronized (use NTP)
- Generate a fresh timestamp for each request
- Check that you’re using milliseconds, not seconds