API
Authentication

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:

  1. Navigate to your API dashboard
  2. Click "Generate API Key"
  3. Copy your API key immediately
  4. 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_KEY

Example:

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_KEY

Example:

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 key

DO:

// ✓ Use environment variables
const apiKey = process.env.DIGIFI_API_KEY;
 
// ✓ Use .env files (add to .gitignore)
DIGIFI_API_KEY=dg_YOUR_KEY_HERE

Environment 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_KEY

Rotate Keys Regularly

Rotate your API keys every 90 days:

  1. Generate a new API key
  2. Update your applications
  3. Test the new key
  4. 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 TypeFree Tier
Deployments per Month150
Requests per Minute60
Concurrent Requests5

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 CodeErrorDescriptionSolution
401UnauthorizedInvalid or missing API keyCheck your API key
401Invalid API keyAPI key not foundVerify key in dashboard
429Rate limit exceededToo many requestsWait and retry
403Monthly limit reachedDeployment quota exceededWait 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:


Need help? Contact us at digifievm999@gmail.com