Authentication
API Keys
Testnet 122606
Section
Authentication
Documentation category
Type
Guide
Technical reference
Summary
Generate, use, and rotate your SWSS DevHub API keys.
Article Content
What are API Keys?
API keys are credentials used to authenticate requests to SWSS Chain endpoints that require developer identification. They are scoped to the testnet environment.
Generating a Key
- Navigate to API Keys in the developer portal
- Enter a descriptive name for the key (e.g.
Production Server,Local Dev) - Click Generate
The full key is shown exactly once at creation. Copy it immediately — it cannot be retrieved again. Only a masked prefix is stored for identification.
Key Format
swss_pk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Keys are 61 characters total, prefixed with swss_pk_test_.
Using Your Key
Pass the key in the X-SWSS-API-Key request header:
curl -X POST https://testnet.swssrpc.swss.io \
-H "Content-Type: application/json" \
-H "X-SWSS-API-Key: swss_pk_test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
Limits
| Limit | Value |
|---|---|
| Keys per account | 5 active keys |
| Environment | Testnet only |
Revoking a Key
Go to API Keys, locate the key by its prefix and name, then click the revoke icon. Revoked keys are immediately invalidated and cannot be restored.
Rotate keys regularly. If a key is compromised, revoke it immediately and generate a replacement.
