Overview
API keys are required to authenticate x402 payment verification requests. They provide secure, programmatic access to Meridian’s payment infrastructure for your applications.Key Types
Meridian Protocol uses public keys for API authentication:- Public Key (pk_): Used for API authentication
- Test Mode Keys: Prefixed with
pk_test_
for development - Production Keys: Prefixed with
pk_
for live transactions
Secret keys are generated but only shown once during creation for security. The public key is used for all API requests.
Creating API Keys
Via Developer Dashboard
1
Sign in with Ethereum
Connect your wallet and authenticate using SIWE
2
Navigate to API Keys
Go to the API Keys section in your developer dashboard
3
Create New Key
Click “Create API Key” and provide a descriptive name
4
Choose Environment
Select test mode for development or production for live transactions
5
Save Your Keys
Copy and securely store both keys - the secret is only shown once!
Via API
You can also create API keys programmatically:The
api_secret_key
is only returned once during creation. Store it securely!Using API Keys
Authentication Header
Include your public key in the Authorization header:JavaScript/Node.js
Python
Managing API Keys
List All Keys
Get Single Key
Test vs Production Keys
Test Mode Keys (pk_test_
)
- Used for development and testing
- Process payments on testnets (Base Sepolia, etc.)
- No real money involved
- Separate analytics and transaction history
Production Keys (pk_
)
- Used for live applications
- Process real payments on mainnets
- Handle actual value transfers
- Production-level monitoring and support
Always use test keys during development. Switch to production keys only when your integration is complete and tested.
Security Best Practices
Key Storage
- Never commit API keys to version control
- Use environment variables or secure key management services
- Rotate keys regularly
- Use different keys for different environments
Access Control
- API keys are scoped to your organization
- Each key tracks usage and last access time
- Keys can be individually managed and revoked
Environment Variables
API Key Endpoints
Create API Key
POST /v1/api_keys
- Create a new API key pairList API Keys
GET /v1/api_keys
- Get all keys for your organizationGet API Key
GET /v1/api_keys/:id
- Get details for a specific keyDelete API Key
DELETE /v1/api_keys/:id
- Delete an API keyRate Limits
API keys have the following rate limits:- Payment Verification: 1,000 requests per hour
- Transaction Queries: 500 requests per hour
- API Key Management: 100 requests per hour
Troubleshooting
Common Errors
401 Unauthorized- Check that your API key is correct
- Ensure you’re using the right environment (test vs production)
- Verify the Authorization header format:
Bearer pk_...
- API key may be revoked or expired
- Check if you’re accessing the correct organization’s resources
- You’ve exceeded the rate limit for your API key
- Wait for the reset time or contact support for higher limits