Agent API
Rally your community to engage with your posts across Twitter/X, Instagram, TikTok, LinkedIn, Reddit, and Farcaster. CLI, Agent Skill, and REST API for community-powered growth.
Overview
The ProductClank Agent API lets you rally your community to engage with your posts across Twitter/X, Instagram, TikTok, LinkedIn, Reddit, and Farcaster. Two ways to use it:
Boost
Rally community around a specific post — replies, likes, reposts (6 platforms)
Discover
AI finds relevant conversations, generates replies, community posts them
CLI
npm i -g github:covariance-network/communiply-cli
Agent Skill
For AI agents — auto-loaded from GitHub
REST API
Bearer API key + USDC on Base
How It Works
Two entry points, one execution layer. Discover relevant conversations or rally your community around a specific post — both end with real people posting authentic engagement from their personal accounts.
Discovery
Find relevant posts by keywords, topics, and intent. Not every search leads to a campaign — search is reusable.
POST /discovery/searchDirect Post
Already have a post you want to amplify? Skip discovery — go straight to campaign creation.
Provide post URL directlyCampaign Creation
POST /campaignsChoose action type
Who executes
Community members execute
Real people act from personal accounts — authentic, trusted, rewarded
User journeys
I have a post I want to amplify
Register Your Agent
Self-serve registration — no approval needed. Register your agent and get an API key instantly. Works for both human builders registering an agent via the API, and agents registering themselves programmatically.
/api/v1/agents/registerNo auth requiredcurl -X POST https://api.productclank.com/api/v1/agents/register \
-H "Content-Type: application/json" \
-d '{
"name": "MyGrowthAgent",
"description": "AI agent for Twitter growth campaigns",
"wallet_address": "0x1234...abcd",
"erc8004_agent_id": "22965"
}'{
"success": true,
"agent": {
"id": "uuid",
"name": "MyGrowthAgent",
"status": "active",
"rate_limit_daily": 10
},
"api_key": "pck_live_abc123def456...",
"credits": { "balance": 300, "plan": "free" },
"_warning": "Store this API key securely. It will not be shown again."
}Important: The API key is shown exactly once. Store it securely — there is no way to retrieve it later.
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Agent name (must be unique) |
| description | string | No | What the agent does |
| wallet_address | string | No | Base wallet address (0x...) |
| erc8004_agent_id | string | No | ERC-8004 on-chain identity ID |
| role | string | No | Agent role (Growth, Research, Creative, etc.) |
| logo | string | No | Logo URL |
| website | string | No | Agent website |
ERC-8004 Identity Import
If your agent has an ERC-8004 on-chain identity, you can import its profile data before registering to auto-fill name, description, logo, and website.
/api/v1/agents/importNo auth requiredcurl -X POST https://api.productclank.com/api/v1/agents/import \
-H "Content-Type: application/json" \
-d '{"source": "erc8004", "erc8004_agent_id": "22965"}'Use the returned data to pre-fill the registration request. Pass the erc8004_agent_id and erc8004_metadata into the register endpoint.
Authentication
All requests (except registration and import) require a Bearer API key in the Authorization header. API keys are obtained via self-registration above.
Authorization: Bearer pck_live_<your_api_key>Keys are prefixed with pck_live_ and are hashed (SHA-256) server-side. Never share your raw key.
Create Campaign
/api/v1/agents/campaignsRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| product_id | UUID | Yes | Product to create campaign for |
| title | string | Yes | Campaign title |
| keywords | string[] | Yes | Keywords for finding relevant Twitter posts |
| search_context | string | Yes | Description of target conversations |
| estimated_posts | number | No | Estimated number of posts for cost calculation |
| mention_accounts | string[] | No | Twitter handles to mention in replies |
| reply_style_tags | string[] | No | Tone tags (e.g. "friendly", "technical") |
| reply_style_account | string | No | Twitter handle whose style to mimic |
| reply_length | string | No | "very-short" | "short" | "medium" | "long" | "mixed" |
| reply_guidelines | string | No | Custom AI reply instructions (auto-generated if omitted) |
| min_follower_count | number | No | Min followers for target posts (default: 100) |
| min_engagement_count | number | No | Min engagement for target posts |
| max_post_age_days | number | No | Maximum age of posts to target |
| require_verified | boolean | No | Only target verified accounts (default: false) |
| payment_tx_hash | string | No | Tx hash for direct USDC transfer (alternative to x402) |
Response Codes
{
"success": true,
"campaign": {
"id": "uuid",
"campaign_number": "CP-042",
"title": "My Campaign",
"status": "active",
"created_via": "api",
"creator_agent_id": "agent-uuid",
"url": "https://app.productclank.com/communiply/uuid"
},
"next_step": {
"action": "generate_posts",
"endpoint": "POST /api/v1/agents/campaigns/{id}/generate-posts",
"description": "Generate posts for this campaign. Optionally share the campaign URL with the user for review first."
}
}Note: Creating a campaign does NOT generate posts automatically. Call the generate-posts endpoint as a separate step. This allows the user to review campaign settings first.
{
"success": false,
"error": "insufficient_credits",
"message": "Not enough credits. Balance: 0, needed: 120",
"current_balance": 0,
"required_credits": 120,
"topup_url": "/api/v1/agents/credits/topup",
"bundles": {
"nano": { "credits": 40, "price_usdc": 2 },
"micro": { "credits": 200, "price_usdc": 10 },
"small": { "credits": 550, "price_usdc": 25 }
}
}{ "success": false, "error": "validation_error", "message": "Missing required fields: product_id, title, keywords (non-empty), search_context" }{ "success": false, "error": "unauthorized", "message": "Invalid API key" }{ "success": false, "error": "not_found", "message": "Product not found" }{ "success": false, "error": "rate_limit_exceeded", "message": "Daily campaign creation limit exceeded (10/day)" }Generate Posts
/api/v1/agents/campaigns/{campaignId}/generate-postsTriggers Twitter/X post discovery and AI reply generation for an existing campaign. Credits are deducted at the same rates as the webapp (~12 credits per post).
Recommended workflow:
- Create a campaign — receive the campaign URL in the response
- Share the URL with the user so they can review campaign settings
- Once confirmed, call this endpoint to discover posts and generate replies
Request
No request body required. The campaignId is passed as a URL path parameter.
curl -X POST https://api.productclank.com/api/v1/agents/campaigns/CAMPAIGN_UUID/generate-posts \
-H "Authorization: Bearer pck_live_YOUR_API_KEY" \
-H "Content-Type: application/json"Response Codes
{
"success": true,
"message": "Generated 5 posts with replies",
"postsGenerated": 5,
"repliesGenerated": 5,
"errors": 0,
"batchNumber": 1,
"credits": {
"creditsUsed": 60,
"creditsRemaining": 240
}
}{
"success": false,
"message": "Insufficient credits",
"creditsRequired": 60,
"creditsAvailable": 10,
"shortfall": 50,
"costPerPost": 12
}{ "success": false, "error": "forbidden", "message": "This campaign was not created by your agent" }{ "success": false, "error": "not_found", "message": "Campaign not found" }Boost a Post
/api/v1/agents/campaigns/boostRally your community to engage with a specific post — replies showing support, questions, and congrats, plus likes and reposts. Works across Twitter/X, Instagram, TikTok, LinkedIn, Reddit, and Farcaster. Platform is auto-detected from URL.
Supported Platforms
| Platform | Replies | Likes | Reposts |
|---|---|---|---|
| Twitter/X | Yes | Yes | Yes |
| Yes | Yes | — | |
| TikTok | Yes | Yes | — |
| Yes | Yes | — | |
| Yes | Yes | — | |
| Farcaster | Yes | Yes | Yes |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| post_url | string | Yes | Post URL to boost (platform auto-detected). tweet_url also accepted. |
| product_id | UUID | Yes | Product to associate with this boost |
| action_type | string | No | "replies" (default), "likes", or "repost" |
| reply_guidelines | string | No | Guidelines for community replies (e.g. "congratulate the team, ask about features") |
| post_text | string | No | Post text — pass directly to skip server-side fetch. tweet_text also accepted. |
| post_author | string | No | Post author username (used with post_text). tweet_author also accepted. |
Post text resolution: Client-provided post_text → server-side fetch → 503 error (for replies). Pass post_text to guarantee availability when the platform API is unreliable.
Action Types & Costs
| Action | Items | Credits |
|---|---|---|
| replies (default) | 10 community replies | 200 |
| likes | 30 community likes | 300 |
| repost | 10 community reposts | 300 |
Examples
curl -X POST https://api.productclank.com/api/v1/agents/campaigns/boost \
-H "Authorization: Bearer pck_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"post_url": "https://x.com/myproduct/status/123456789",
"product_id": "YOUR_PRODUCT_UUID",
"action_type": "replies",
"reply_guidelines": "Congratulate the team, ask about the new features"
}'curl -X POST https://api.productclank.com/api/v1/agents/campaigns/boost \
-H "Authorization: Bearer pck_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"post_url": "https://www.instagram.com/p/ABC123/",
"product_id": "YOUR_PRODUCT_UUID",
"action_type": "replies"
}'# Install: npm i -g github:covariance-network/communiply-cli
communiply boost https://x.com/myproduct/status/123 --action replies \
--guidelines "Congratulate the team, ask about features"
communiply boost https://www.instagram.com/p/ABC123/ --action replies
communiply boost https://www.tiktok.com/@user/video/123 --action replies
communiply boost https://www.linkedin.com/posts/user_activity-123 --action repliesResponse
{
"success": true,
"campaign": {
"id": "uuid",
"campaign_number": "CP-042",
"action_type": "replies",
"is_reboost": false,
"url": "https://app.productclank.com/communiply/uuid"
},
"post": {
"id": "123456789",
"platform": "twitter",
"url": "https://x.com/myproduct/status/123456789",
"text": "We just shipped v2.0! 10x faster API.",
"author": "myproduct"
},
"tweet": { ... },
"items_generated": 10,
"credits": {
"credits_used": 200,
"credits_remaining": 100,
"billing_user_id": "user-uuid"
}
}Re-boost: Calling boost again with the same post URL and action type generates additional items for the existing campaign (is_reboost: true).
Review Posts
/api/v1/agents/campaigns/{campaignId}/review-postsAI-powered review of discovered posts against user-defined relevancy rules. Scores every post, then deletes irrelevant ones. Run after generate-posts to clean up before the campaign goes live. Costs 2 credits per post reviewed.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| review_rules | string | Yes* | Freeform rules for what makes a post relevant. *Optional if rules were saved previously. |
| threshold | number | No | Score threshold (1-10). Posts below this are marked irrelevant. Default: 5. |
| dry_run | boolean | No | If true, scores posts but does NOT delete. Default: false. |
| save_rules | boolean | No | Save rules to campaign for future runs. Default: true. |
curl -X POST https://api.productclank.com/api/v1/agents/campaigns/CAMPAIGN_UUID/review-posts \
-H "Authorization: Bearer pck_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"review_rules": "Only posts where the builder announced their own product are relevant",
"threshold": 5,
"dry_run": false
}'Response Codes
{
"success": true,
"dry_run": false,
"summary": {
"total_reviewed": 88,
"deleted": 23,
"marked_irrelevant": 23,
"kept": 65,
"processing_time_ms": 142000
},
"credits": {
"charged": 176,
"remaining": 124,
"billing_user_id": "user-uuid"
},
"rules_saved": true
}{
"success": false,
"error": "insufficient_credits",
"message": "Insufficient credits. Need 176, have 100.",
"credits_required": 176,
"credits_available": 100,
"cost_per_post": 2
}Tip: Run with dry_run: true first to preview which posts will be deleted, then run again with dry_run: false to apply. Both runs consume credits.
Campaign Tiers
Three levels of sophistication for creating and managing campaigns. Choose the tier that matches your agent's capabilities and your campaign goals.
| Tier | Name | Typical Cost | Status |
|---|---|---|---|
| 1 | Quick Launch | ~70 credits ($2.92) | Available |
| 2 | Research-Enhanced | ~72-74 credits ($3.00) | Coming Soon |
| 3 | Iterate & Optimize | ~100-200 credits ($4-8) | Coming Soon |
Tier 1: Quick LaunchAvailable
Agent provides all inputs pre-computed. Create a campaign, generate posts, and optionally review for relevancy.
Best for: Agents with good domain knowledge, simple one-shot campaigns, cost-sensitive workflows.
Endpoints: See Create Campaign, Generate Posts, and Review Posts sections above.
Tier 2: Research-EnhancedComing Soon
AI-powered research before generation for better targeting. Research is free — the value is in higher-quality post discovery.
Planned Endpoints
/agents/generate-keywords2 creditsGenerate 8-15 keywords from natural language goals. Input: search_goals, optional product_name, product_tagline.
/agents/campaigns/{id}/researchfreeRun AI research analysis. Returns expanded keywords, high-intent phrases, key accounts, Twitter lists, hashtags, and competitors.
/agents/campaigns/{id}/verticalsfreeSelect which discovery sources to use: keywords, phrases, influencers, lists, competitors.
/agents/campaigns/{id}freeRead campaign details, settings, and stats.
/agents/campaignsfreeList all campaigns created by this agent.
Best for: Exploring new niches, campaigns targeting 10+ posts, maximizing discovery quality.
Tier 3: Iterate & OptimizeComing Soon
Full campaign lifecycle management. Read results, refine via AI chat, regenerate replies, and iterate until satisfied.
Planned Endpoints
/agents/campaigns/{id}/postsfreeRead discovered posts with replies. Filter by status, claimed/unclaimed. Includes author info, engagement metrics, relevance score.
/agents/campaigns/{id}/regenerate-replies5 credits/replyRegenerate replies for specific posts with new instructions. Input: postIds[], editRequest. Can optionally update permanent guidelines.
/agents/campaigns/{id}/refine3 credits/messageAI campaign optimization chat (synchronous). Send messages, receive advice + auto-executed actions. Actions: update keywords, regenerate replies, run discovery, update guidelines, cleanup posts.
/agents/campaigns/{id}freeDirect campaign setting updates. Modify keywords, guidelines, filters, scheduling, and visibility without using the AI chat.
Best for: Ongoing campaigns, A/B testing reply styles, building feedback loops, multi-iteration optimization.
Credit Cost Summary
| Operation | Credits | Tier |
|---|---|---|
| Create campaign | 10 | 1 |
| Generate posts (discover + reply) | 12/post | 1 |
| Review posts (AI relevancy) | 2/post | 1 |
| Generate keywords (AI) | 2 | 2 |
| Research analysis | free | 2 |
| Regenerate replies | 5/reply | 3 |
| Refine chat (AI) | 3/message | 3 |
| Boost — community replies | 200 | Boost |
| Boost — likes | 300 | Boost |
| Boost — reposts | 300 | Boost |
Credit-Based Pricing
ProductClank uses a pay-per-use credit system. Buy credits with USDC on Base (chain ID 8453), then create campaigns — credits are consumed as AI operations are performed (~12 credits per post).
Operation Costs
| Operation | Credits | ~Cost |
|---|---|---|
| Discover post + generate reply | 12 | ~$0.50 |
| Review post (AI relevancy) | 2 | ~$0.08 |
| Generate reply only | 8 | ~$0.33 |
| Regenerate reply | 5 | ~$0.21 |
| Boost — community replies (10 replies) | 200 | ~$8.33 |
| Boost — likes (30 likes) | 300 | ~$12.50 |
| Boost — reposts (10 reposts) | 300 | ~$12.50 |
Workflow
- Register agent via
POST /agents/register— receive API key + 300 free credits - Check credit balance via
GET /agents/credits/balance - Top up credits via
POST /agents/credits/topup(x402 or direct transfer) - Create a campaign via
POST /agents/campaigns - (Optional) Share the campaign URL with the user for review
- Generate posts via
POST /agents/campaigns/{id}/generate-posts— credits deducted here - (Optional) Review posts via
POST /agents/campaigns/{id}/review-posts— 2 credits/post, deletes irrelevant ones - View transaction history via
GET /agents/credits/history
Credit Endpoints
/api/v1/agents/credits/balance— Current balance and plan info/api/v1/agents/credits/topup— Purchase credits with a bundle/api/v1/agents/credits/history— Transaction history (paginated)Quick Start
Install dependencies:
npm install @x402/fetch viemFive-step flow: register, check balance, top up if needed, create campaign, generate posts:
import { wrapFetchWithPayment } from "@x402/fetch";
import { createWalletClient, http } from "viem";
import { base } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
const API = "https://api.productclank.com/api/v1";
// Step 0: Register your agent (one-time)
const registerRes = await fetch(API + "/agents/register", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "MyGrowthAgent",
description: "AI agent for Twitter growth campaigns",
wallet_address: "0xYOUR_WALLET_ADDRESS",
}),
});
const { api_key } = await registerRes.json();
// Store api_key securely — it won't be shown again!
const headers = {
"Authorization": `Bearer ${api_key}`,
"Content-Type": "application/json",
};
// Your agent's wallet (must hold USDC on Base for payments)
const account = privateKeyToAccount("0xYOUR_PRIVATE_KEY");
const walletClient = createWalletClient({ account, chain: base, transport: http() });
const x402Fetch = wrapFetchWithPayment(fetch, walletClient);
// 1. Check credit balance (300 free credits on signup)
const balanceRes = await fetch(API + "/agents/credits/balance", { headers });
const { balance } = await balanceRes.json();
console.log("Credits:", balance);
// 2. Top up if needed (x402 handles payment automatically)
if (balance < 120) {
await x402Fetch(API + "/agents/credits/topup", {
method: "POST",
headers,
body: JSON.stringify({ bundle: "micro" }), // $10 → 200 credits
});
}
// 3. Create campaign
const campaignRes = await fetch(API + "/agents/campaigns", {
method: "POST",
headers,
body: JSON.stringify({
product_id: "YOUR_PRODUCT_UUID",
title: "Launch Week Community Buzz",
keywords: ["AI tools", "productivity", "startup"],
search_context: "People discussing AI productivity tools",
estimated_posts: 10,
reply_style_tags: ["friendly", "authentic"],
reply_length: "short",
}),
});
const campaign = await campaignRes.json();
console.log("Campaign URL:", campaign.campaign.url);
// Optional: share campaign.campaign.url with user for review
// 4. Generate posts (credits deducted here)
const generateRes = await fetch(
API + "/agents/campaigns/" + campaign.campaign.id + "/generate-posts",
{ method: "POST", headers, body: JSON.stringify({}) }
);
const result = await generateRes.json();
console.log("Posts generated:", result.postsGenerated);x402 Payment Protocol
x402 is an open payment standard by Coinbase that uses HTTP 402 responses for programmatic crypto payments. Use it to purchase credit bundles with USDC on Base.
How it works:
- Your agent sends a POST to
/credits/topupwith the bundle name - Server responds with
402 Payment Required+ bundle price @x402/fetchautomatically signs a USDC payment on Base and retries with theX-PAYMENTheader- Server verifies payment and credits are added to your balance
Your agent wallet needs USDC on Base. Get Base ETH for gas from bridge.base.org and USDC from any exchange or DEX on Base.
Direct USDC Transfer
For wallets without private key access (smart contract wallets, MPC wallets, Bankr, etc.), you can buy credits by sending USDC directly and providing the transaction hash.
How it works:
- Send USDC on Base to:
0x876Be690234aaD9C7ae8bb02c6900f5844aCaF68 - Amount must match the exact bundle price (e.g. $10 for micro)
- Wait for transaction confirmation on Base
- Send POST to
/credits/topupwith the bundle name andpayment_tx_hash
// Step 1: Send USDC transfer via your wallet provider
// Amount must match bundle price ($10 for micro = 200 credits)
const txHash = "0x..."; // The confirmed transaction hash
// Step 2: Top up credits with tx hash
const response = await fetch(
"https://api.productclank.com/api/v1/agents/credits/topup",
{
method: "POST",
headers: {
"Authorization": "Bearer pck_live_YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
bundle: "micro",
payment_tx_hash: txHash,
}),
}
);
const { credits_added, new_balance } = await response.json();
console.log("Credits added:", credits_added, "Balance:", new_balance);Requirements: Transaction must be confirmed on Base, recent (within 1 hour), and each tx hash can only be used once (replay protection).
Credit Bundles
Purchase credits via POST /agents/credits/topup with your preferred bundle. Higher bundles offer better value per credit.
| Bundle | Credits | Price (USDC) | ~Posts |
|---|---|---|---|
| nano | 40 | $2 | ~3 posts |
| micro | 200 | $10 | ~16 posts |
| small | 550 | $25 | ~45 posts |
| medium | 1,200 | $50 | ~100 posts |
| large | 2,600 | $100 | ~216 posts |
| enterprise | 14,000 | $500 | ~1,166 posts |
Higher bundles offer better value per credit. Enterprise agents get 28 credits/$ vs 25 credits/$ on nano.
Register your agent at POST /api/v1/agents/register to get started. Questions? Reach out on Twitter