Authentication
Learn how to authenticate your API requests to access Digifi's services.
Overview
All API requests require authentication using an API key. Your API key identifies your account and tracks your usage against monthly limits.
Getting Your API Key
Step 1: Create an Account
Visit https://www.digifi.fun/api-key (opens in a new tab) and create an account using:
- Email address
- Google account
- Wallet authentication
Step 2: Generate API Key
Once logged in:
- Navigate to your API dashboard
- Click "Generate API Key"
- Copy your API key immediately
- Store it securely
Step 3: Verify Your Key
Test your API key with a simple request:
curl -X GET "https://api.digifi.fun/user-deployment-count?apiKey=YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_API_KEY"Authentication Methods
Bearer Token (Recommended)
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYExample:
curl -X POST https://api.digifi.fun/deployToken \
-H "Authorization: Bearer dg_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"name": "MyToken", "symbol": "MTK", "chain_id": "8453", "apiKey": "dg_YOUR_API_KEY_HERE"}'Query Parameter
Some endpoints also accept the API key as a query parameter:
?apiKey=YOUR_API_KEYExample:
curl -X GET "https://api.digifi.fun/checkRewards?tokenAddress=0x...&apiKey=YOUR_API_KEY"API Key Format
Digifi API keys follow this format:
dg_XXXXXXXXXXXXXXXXXXXX- Prefix:
dg_ - Length: 32 characters total
- Characters: Alphanumeric (A-Z, 0-9)
Security Best Practices
Never Expose Your API Key
DON'T:
// ❌ Don't hardcode API keys
const apiKey = "dg_1234567890ABCDEF";
// ❌ Don't commit to version control
git add config.js // Contains hardcoded keyDO:
// ✓ Use environment variables
const apiKey = process.env.DIGIFI_API_KEY;
// ✓ Use .env files (add to .gitignore)
DIGIFI_API_KEY=dg_YOUR_KEY_HEREEnvironment Variables
Node.js
// Load from .env file
require('dotenv').config();
const apiKey = process.env.DIGIFI_API_KEY;Python
import os
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv('DIGIFI_API_KEY')Shell/Bash
export DIGIFI_API_KEY="dg_YOUR_KEY_HERE"
echo $DIGIFI_API_KEYRotate Keys Regularly
Rotate your API keys every 90 days:
- Generate a new API key
- Update your applications
- Test the new key
- Revoke the old key
Limit Key Exposure
- Use separate keys for development and production
- Implement IP allowlisting when possible
- Monitor usage for suspicious activity
- Revoke unused keys immediately
Usage Limits
Each API key has usage limits:
| Limit Type | Free Tier |
|---|---|
| Deployments per Month | 150 |
| Requests per Minute | 60 |
| Concurrent Requests | 5 |
Checking Your Usage
Check your current usage:
curl -X GET "https://api.digifi.fun/user-deployment-count?apiKey=YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_API_KEY"Response:
{
"username": "yourUsername",
"monthlyDeployments": 45,
"monthlyLimit": 150,
"remainingDeployments": 105,
"currentMonth": "2025-11",
"isUnlimited": false
}Error Codes
Authentication Errors
| Status Code | Error | Description | Solution |
|---|---|---|---|
401 | Unauthorized | Invalid or missing API key | Check your API key |
401 | Invalid API key | API key not found | Verify key in dashboard |
429 | Rate limit exceeded | Too many requests | Wait and retry |
403 | Monthly limit reached | Deployment quota exceeded | Wait for monthly reset |
Example Error Response
{
"error": "Invalid API key",
"message": "The provided API key is not valid"
}Testing Authentication
Verify API Key
curl -X GET "https://api.digifi.fun/user-deployment-count?apiKey=YOUR_KEY" \
-H "Authorization: Bearer YOUR_KEY"Expected Success Response
{
"username": "yourUsername",
"monthlyDeployments": 0,
"monthlyLimit": 150,
"remainingDeployments": 150,
"currentMonth": "2025-11"
}FAQs
Q: Can I use multiple API keys?
A: Currently, each account has one API key. You can regenerate it as needed.
Q: What happens if my key is compromised?
A: Immediately regenerate your key in the API dashboard. All old requests will be rejected.
Q: Do API keys expire?
A: API keys don't expire automatically, but we recommend rotating them every 90 days.
Q: Can I share my API key?
A: No. API keys are tied to your account and usage limits. Never share your key.
Q: What if I lose my API key?
A: You can view your current key or generate a new one in your API dashboard.
Next Steps
Now that you understand authentication, learn about the available endpoints:
- Deploy Token - Create new tokens
- Check Rewards - Monitor token rewards
- Code Examples - Ready-to-use code
Need help? Contact us at digifievm999@gmail.com