API Key Authentication
All requests to the Provider API require an API key passed via theX-API-Key header.
Getting an API Key
Sign Up
Create an account at portal.perps.studio.
Key Format
API keys follow this format:| Prefix | Environment |
|---|---|
ps_live_ | Production |
ps_test_ | Testnet only |
/v1/testnet/ endpoints. Live keys can access both production and testnet endpoints.
Error Responses
If authentication fails, you will receive a401 Unauthorized response:
| Scenario | Error Message |
|---|---|
| Missing header | Missing X-API-Key header |
| Invalid key | Invalid API key |
| Expired key | API key has expired |
Provider-Specific Auth (Trading)
Reading market data only requires an API key. However, placing orders, canceling orders, and modifying positions require provider-specific wallet authentication.Hyperliquid (EIP-712)
Hyperliquid uses EIP-712 typed data signing. You need to:- Create an API wallet (agent) approved by your main wallet
- Sign order payloads with the agent private key
- Include the signature in the request body
Aster DEX (EIP-712)
Aster uses a similar EIP-712 signing flow but with its own domain and type definitions. The Provider API normalizes the signing interface, so the request body shape is identical to Hyperliquid.Polymarket (HMAC)
Polymarket uses HMAC-based authentication for trading. You need API credentials (key, secret, passphrase) from your Polymarket account.WebSocket Authentication
WebSocket connections authenticate via theX-API-Key query parameter or header during the initial handshake.