Skip to main content

API Keys

All requests to the Polyhush API must be authenticated using an API key. Your API key should be kept secret and never shared publicly.

Getting Your API Key

1

Sign in to Polyhush

Navigate to polyhush.com and sign in to your account.
2

Go to Dashboard

Access your Dashboard.
3

Generate API Key

Click on “Generate API Key” or navigate to Settings to create a new key.
4

Copy and Store Securely

Copy your API key immediately. For security reasons, you won’t be able to view it again.

Using Your API Key

Option 1: Pass directly to client

from polyhush import PolyhushClient

client = PolyhushClient(api_key="your-api-key")
Set the POLYHUSH_API_KEY environment variable:
export POLYHUSH_API_KEY="your-api-key"
Then initialize without arguments:
from polyhush import PolyhushClient

client = PolyhushClient()  # Automatically uses POLYHUSH_API_KEY
Using environment variables is the recommended approach as it keeps your API key out of your codebase.

Security Best Practices

Never commit your API key to version control or share it publicly.
Store your API key in environment variables or a .env file (added to .gitignore).
# Load from .env file
from dotenv import load_dotenv
load_dotenv()

client = PolyhushClient()
Periodically regenerate your API keys, especially if you suspect they may have been compromised.
Use different API keys for development, staging, and production environments.
Regularly review your API usage in the dashboard to detect any unauthorized access.

Rate Limits

API requests are rate-limited to ensure fair usage. Current limits:
Endpoint TypeRate Limit
Read operations100 requests/minute
Write operations30 requests/minute
Order placement10 orders/second
If you exceed rate limits, you’ll receive a 429 Too Many Requests response. Implement exponential backoff in your retry logic.