Skip to main content
The Polymarket Exchange API uses Private Key JWT authentication. You sign a JWT with your private key, exchange it for an access token, then include that token in every API request.
CRITICAL: Access tokens must be refreshed every 3 minutes.Access tokens have a short expiration. Your application MUST implement automatic token refresh before expiration to maintain uninterrupted API and streaming connections.

Authentication Flow

Authentication Configuration

Auth Domains

During onboarding, you’ll provide your public key and receive your client_id and audience values.

Step 1: Create Client Assertion JWT

Create a JWT with these claims, signed with your private key using RS256:

Step 2: Request Access Token

Exchange your signed JWT for an access token:

Response

The expires_in value is in seconds. With a 3-minute (180 second) expiration, you must refresh tokens frequently.

Step 3: Use Token in API Requests

Include the access token in the Authorization header for every request.

gRPC Streaming

Include the token in gRPC metadata:
The metadata key must be authorization (lowercase). Include Bearer prefix before the token.

Token Refresh Strategy

Since tokens expire every 3 minutes, implement automatic refresh:
Required packages:

Handling Authentication Errors

Common Authentication Errors

Streaming Scopes

Scopes are enforced on streaming RPCs the same way they are on REST endpoints. The most common gRPC streams and their required scopes: See the full scope reference in the trader guide authentication page.

Key Rotation

You can rotate your keys without downtime:
  1. Generate a new key pair
  2. Submit the new public key to us
  3. We add the new key (both old and new work during transition)
  4. Update your systems to use the new private key
  5. Notify us to remove the old public key

Next Steps

Authentication Setup

Complete onboarding guide with key generation

Market Data Streaming

Learn how to stream market data

Order Streaming

Subscribe to order updates

Error Handling

Handle errors and implement reconnection