airtop-agents
Original:🇺🇸 English
Translated
List, run, and monitor Airtop agents. Use when asked to run an Airtop agent, check agent status, list agents, or invoke a webhook agent.
3installs
Sourceairtop-ai/airtop-skill
Added on
NPX Install
npx skill4agent add airtop-ai/airtop-skill airtop-agentsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Airtop Agents Skill
You can list, run, monitor, and cancel Airtop agents using their REST API.
Authentication
The Airtop API key is required for all operations. Resolve it in this order:
- environment variable
$AIRTOP_API_KEY - A file in this skill's directory containing
.envAIRTOP_API_KEY=... - If neither is found, offer the user two options before proceeding:
Option A — Set it up yourself (recommended if you prefer not to share your key in chat):Run these commands in your terminal:cp "$(dirname "$SKILL_PATH")/.env.example" "$(dirname "$SKILL_PATH")/.env"Then open thefile and replace.envwith your key from https://portal.airtop.ai/api-keys.your-api-key-hereOnce done, say "done" and I'll pick it up automatically.Option B — Paste it here and I'll save it for you:Paste your API key (from https://portal.airtop.ai/api-keys) and I'll write it to thefile so it's available for future use..env
Print both options exactly as above (with the actual resolved path instead of the expression) and wait for the user to choose. Do not assume a preference.
$(dirname ...)Handling a pasted key (Option B)
Important — always load the key from the file, never use a pasted value directly.
.envWhen a user provides their API key interactively (e.g. pasting it into chat), text copied from web UIs or chat messages can contain invisible Unicode characters (zero-width spaces, byte-order marks, etc.) that silently break authentication. To avoid this:
- Write the key to first — this round-trips it through file I/O which strips invisible characters:
.envbashecho "AIRTOP_API_KEY=<pasted-value>" > "$(dirname "$SKILL_PATH")/.env" - Then read it back from the file to get a clean value:
bash
API_KEY=$(grep AIRTOP_API_KEY "$(dirname "$SKILL_PATH")/.env" | cut -d= -f2-)
Even when is already set in the environment, prefer loading from if the file exists — the environment variable may have been set in the same shell session from a pasted value and could carry the same invisible characters.
$AIRTOP_API_KEY.envNever assign a user-pasted key directly to a shell variable and use it in API calls (e.g. followed by ). Always go through the file write-then-read cycle to sanitize the value.
API_KEY="<pasted-value>"curl -H "Authorization: Bearer $API_KEY".envLoading and validating the key
Once the file exists (whether set up by the user or written by you), load and validate:
.envbash
API_KEY=$(grep AIRTOP_API_KEY "$(dirname "$SKILL_PATH")/.env" | cut -d= -f2-)Validate the key immediately after loading it:
bash
curl -sf -H "Authorization: Bearer ${API_KEY}" "https://api.airtop.ai/api/v2/agents?limit=1" > /dev/nullIf this returns a non-zero exit code, tell the user their API key appears invalid and link them to https://portal.airtop.ai/api-keys.
Base URL
All authenticated API endpoints use:
https://api.airtop.ai/apiWebhook endpoints (run agent, poll result) use the public path:
https://api.airtop.ai/api/hooks/Argument Parsing
Parse as follows:
$ARGUMENTSlist [--name <filter>] List agents
run <agent-name-or-id> [--vars {}] Run an agent with optional config variables
status <agentId> <invocationId> Check invocation status
cancel <agentId> <invocationId> Cancel a running invocation
history <agentId> View recent invocationsIf is empty or unrecognized, show the usage summary above and ask the user what they'd like to do.
$ARGUMENTSCommands
1. List Agents
bash
curl -s -H "Authorization: Bearer $API_KEY" \
"https://api.airtop.ai/api/v2/agents?limit=25&sortBy=lastRun&sortOrder=desc&createdByMe=true"Always include to show only agents owned by the current user (not the entire organization).
createdByMe=trueOptional query parameters to append:
- — case-insensitive partial match (use when
&name=<filter>is provided)--name - — filter to enabled agents only
&enabled=true - — filter to published agents only
&published=true
Display: Format the response as a markdown table with columns: Name, ID, Enabled, Last Run. Show the count in a header line.
pagination.totalExample output:
Found 3 agents:
| Name | ID | Enabled | Last Run |
|-------------------|--------------------------------------|---------|-------------|
| Price Tracker | 550e8400-e29b-41d4-a716-446655440000 | Yes | 2 hours ago |
| Lead Enricher | 6ba7b810-9dad-11d1-80b4-00c04fd430c8 | Yes | Yesterday |
| Competitor Monitor| 6ba7b811-9dad-11d1-80b4-00c04fd430c8 | No | Never |2. Run Agent
This is a multi-step process:
Step 1 — Resolve agent by name or ID.
If the argument looks like a UUID, use it directly as the agent ID. Otherwise, search by name:
bash
curl -s -H "Authorization: Bearer $API_KEY" \
"https://api.airtop.ai/api/v2/agents?name=$(printf '%s' '<agent-name>' | jq -sRr @uri)&createdByMe=true"- If exactly one agent matches, use it (but still validate it in Step 2).
- If multiple agents match, prefer enabled and published agents over disabled or draft-only ones. If there is still ambiguity, display them in a table (with Enabled and Published status columns) and ask the user to pick one.
- If no agents match, tell the user no agent was found and suggest running .
list
Step 2 — Validate the agent is runnable.
Fetch the full agent details (already available from step 1 if resolved by name, or fetch now):
bash
curl -s -H "Authorization: Bearer $API_KEY" \
"https://api.airtop.ai/api/v2/agents/<agentId>"Check the following before proceeding:
- Disabled agent (is
enabled): Tell the user the agent is disabled and cannot be run. Suggest they enable it in the Airtop portal.false - Draft-only agent (is
hasDraftANDtrueis absent): Tell the user the agent has only a draft version and has never been published. It must be published in the Airtop portal before it can be invoked via webhook.publishedVersion - Published agent with draft (is
hasDraftANDtrueis present): The agent is runnable. Note to the user that the agent has unpublished draft changes, and the published version will be used. Use thepublishedVersionvalue for the version parameter.publishedVersion - Published agent (is present,
publishedVersionishasDraft): The agent is runnable. Use thefalsevalue for the version parameter.publishedVersion
Step 3 — Check required configVars.
The agent details response includes a field. Inspect it for properties. If the user has not provided values for required configVars via , prompt them for the missing values before invoking.
versionData.configVarsSchemarequired--varsDisplay the required and optional parameters with their descriptions and defaults so the user knows what to provide.
Step 4 — Get the agent's webhook.
bash
curl -s -H "Authorization: Bearer $API_KEY" \
"https://api.airtop.ai/api/v2/agents/<agentId>/webhooks?limit=10"Use the first webhook from the array. If no webhooks exist, tell the user the agent needs a webhook configured in the Airtop portal (https://portal.airtop.ai).
webhooksStep 5 — Invoke the webhook.
bash
curl -s -X POST "https://api.airtop.ai/api/hooks/agents/<agentId>/webhooks/<webhookId>" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"configVars": { <user-provided key-value pairs from --vars, or empty object {}> },
"version": <publishedVersion from agent details>
}'Always use the value from the agent details as the parameter — never hardcode it.
publishedVersionversionThe response contains . Save this for polling.
{ "invocationId": "<uuid>" }Step 6 — Poll for the result.
bash
curl -s "https://api.airtop.ai/api/hooks/agents/<agentId>/invocations/<invocationId>/result" \
-H "Authorization: Bearer $API_KEY"Polling rules:
- Poll every 5 seconds
- Print a status update to the user after each poll (e.g., "Status: Running...")
- Terminal statuses: ,
Completed,FailedCancelled - Timeout after 5 minutes (60 polls). If not complete, tell the user the invocation is still running and provide the invocation ID so they can check later with the command.
status
Step 7 — Display the result.
- On : Show the
Completedfield. If it's JSON, format it nicely. If it's a string, display it directly.output - On : Show the
Failedfield and the full status.error - On : Inform the user the invocation was cancelled.
Cancelled
3. Check Status
Poll a specific invocation's result:
bash
curl -s "https://api.airtop.ai/api/hooks/agents/<agentId>/invocations/<invocationId>/result" \
-H "Authorization: Bearer $API_KEY"Display the field. If terminal, also display or .
statusoutputerrorNote: This requires both the agent ID and invocation ID. If the user only provides one, ask for the other.
4. Cancel Invocation
bash
curl -s -X DELETE -H "Authorization: Bearer $API_KEY" \
"https://api.airtop.ai/api/v2/agents/<agentId>/invocations/<invocationId>?reason=user_requested"Confirm to the user that the cancellation was requested.
5. View History
bash
curl -s -H "Authorization: Bearer $API_KEY" \
"https://api.airtop.ai/api/v2/agents/<agentId>/invocations?limit=10"Display results as a table with columns: Invocation ID, Status, Trigger, Started At.
Error Handling
- 401 Unauthorized: Tell the user their API key is invalid or expired. Direct them to https://portal.airtop.ai/api-keys.
- 404 Not Found: The agent or invocation doesn't exist. Suggest checking the ID or running .
list - 429 Rate Limited: Tell the user they've hit the rate limit and should wait before retrying.
- No webhook configured: Explain that the agent needs a webhook set up in the Airtop portal before it can be invoked from the CLI.
- Multiple name matches: List all matches and ask the user to pick one or use the agent ID directly.
- Empty API key: Guide the user to set or provide it interactively.
AIRTOP_API_KEY
Important Notes
- Always use (silent mode) to avoid progress bars in output.
curl -s - Parse all JSON responses with or inline JSON parsing in bash.
jq - The webhook invoke and poll endpoints are under (public path), NOT
/api/hooks/./api/v2/ - The list, webhooks, history, and cancel endpoints are under (authenticated path).
/api/v2/ - When displaying times, convert ISO timestamps to human-readable relative times (e.g., "2 hours ago").