AirDrop Skill

Install this skill to let your AI agent interact with AirDrop programmatically. Copy the files below into your agent project.

SKILL.md
# AirDrop Skill

AirDrop is a platform for funding AI agents with USDC on Solana. No wallets, no passwords — just X verification.

## Quick Start

1. Connect: POST /functions/connectAgent {"x_handle": "user_handle"} -> agent_id, verification_code, tweet_url
2. Share the tweet_url with the user — it opens X.com with the tweet text pre-filled. Tell them: "Click this link to post the verification tweet, then paste the URL of your tweet back to me so I can verify it."
3. Wait for the user to paste their tweet URL. Do NOT search for the tweet yourself. Once they paste it, call verifyAgentX: POST /functions/verifyAgentX {"agent_id": "...", "x_handle": "user_handle", "tweet_url": "the_tweet_url"} -> deposit_address, api_key
4. You RECEIVE the API key from the verifyAgentX response — do NOT ask the user for it. Immediately share with the user: the deposit address, the API key (tell them to save it), and a dashboard URL (call getDashboardUrl).
5. Tell the user: "Send USDC to this address: [DEPOSIT_ADDRESS]. Once you've sent it, paste the transaction hash (txhash) back to me so I can verify the deposit."
6. When the user pastes a txhash, call verifyAgentDeposit: POST /functions/verifyAgentDeposit {"agent_id": "...", "api_key": "...", "transaction_signature": "txhash"} -> credited amount, new balance
7. Check balance: POST /functions/getAgentData {"agent_id": "...", "api_key": "..."} -> balance, deposit_address, transactions
8. Withdraw: POST /functions/agentWithdraw {"agent_id": "...", "api_key": "...", "destination_address": "...", "amount": 5.0}

## Authentication

Pass api_key in the request body or as a Bearer token in the Authorization header.

## Base URL

https://airdrop.ad

## Endpoints

### POST /functions/connectAgent
Request: {"x_handle": "elonmusk"}
Response: {"agent_id": "...", "verification_code": "airdrop-XXXXXX", "x_handle": "...", "tweet_url": "https://x.com/intent/tweet?text=Verifying%20my%20AI%20Agent%20with%20code%20airdrop-XXXXXX%20so%20my%20agent%20can%20use%20airdrop.ad"}

### POST /functions/verifyAgentX
Request: {"agent_id": "...", "x_handle": "user_handle", "tweet_url": "optional"}
Response: {"verified": true, "deposit_address": "...", "api_key": "...", "dashboard_token": "..."}

### POST /functions/getAgentData
Request: {"agent_id": "...", "api_key": "..."}
Response: {"agent_id": "...", "x_handle": "...", "deposit_address": "...", "usdc_balance": 0, "api_key": "...", "transactions": [...]}

### POST /functions/getDashboardUrl
Request: {"agent_id": "...", "api_key": "..."}
Response: {"dashboard_url": "https://airdrop.ad/dashboard?token=...", "token": "..."}

### POST /functions/agentWithdraw
Request: {"agent_id": "...", "api_key": "...", "destination_address": "...", "amount": 5.0}
Response: {"success": true, "signature": "...", "new_balance": 0}

### POST /functions/verifyAgentDeposit
Request: {"agent_id": "...", "api_key": "...", "transaction_signature": "solana_txhash"}
Response: {"success": true, "amount": 5.0, "new_balance": 5.0}

### POST /functions/regenerateApiKey
Request: {"agent_id": "...", "api_key": "current_key"}
Response: {"api_key": "new_key..."}
run.py
"""AirDrop client for AI agents."""
import requests

BASE_URL = "https://airdrop.ad"


class AirDrop:
    def __init__(self, agent_id=None, api_key=None):
        self.agent_id = agent_id
        self.api_key = api_key

    def connect(self, x_handle):
        """Connect an X handle and get a verification code and pre-built tweet URL."""
        r = requests.post(f"{BASE_URL}/functions/connectAgent", json={"x_handle": x_handle})
        return r.json()

    def verify(self, agent_id, x_handle=None, tweet_url=None):
        """Verify the X account by checking for the verification tweet."""
        payload = {"agent_id": agent_id}
        if x_handle:
            payload["x_handle"] = x_handle
        if tweet_url:
            payload["tweet_url"] = tweet_url
        r = requests.post(f"{BASE_URL}/functions/verifyAgentX", json=payload)
        return r.json()

    def get_data(self):
        """Get agent balance, deposit address, and transactions."""
        r = requests.post(
            f"{BASE_URL}/functions/getAgentData",
            json={"agent_id": self.agent_id, "api_key": self.api_key},
        )
        return r.json()

    def get_balance(self):
        """Get the agent's USDC balance."""
        return self.get_data().get("usdc_balance", 0)

    def get_deposit_address(self):
        """Get the agent's Solana deposit address."""
        return self.get_data().get("deposit_address")

    def get_dashboard_url(self):
        """Get a shareable dashboard URL."""
        r = requests.post(
            f"{BASE_URL}/functions/getDashboardUrl",
            json={"agent_id": self.agent_id, "api_key": self.api_key},
        )
        return r.json()

    def withdraw(self, destination_address, amount):
        """Withdraw USDC to a Solana address."""
        r = requests.post(
            f"{BASE_URL}/functions/agentWithdraw",
            json={
                "agent_id": self.agent_id,
                "api_key": self.api_key,
                "destination_address": destination_address,
                "amount": amount,
            },
        )
        return r.json()

    def verify_deposit(self, transaction_signature):
        """Verify a deposit by its Solana transaction hash."""
        r = requests.post(
            f"{BASE_URL}/functions/verifyAgentDeposit",
            json={
                "agent_id": self.agent_id,
                "api_key": self.api_key,
                "transaction_signature": transaction_signature,
            },
        )
        return r.json()

    def regenerate_api_key(self):
        """Generate a new API key."""
        r = requests.post(
            f"{BASE_URL}/functions/regenerateApiKey",
            json={"agent_id": self.agent_id, "api_key": self.api_key},
        )
        self.api_key = r.json().get("api_key")
        return r.json()

Installation

Save both files in your agent project. Import run.py as a module and use the AirDrop class to connect, verify, check balances, and withdraw.