Build on ProductClank. Enable your AI agent to create and manage Communiply campaigns programmatically with x402 crypto payments.
The ProductClank Agent API lets AI agents create Communiply campaigns — AI-powered Twitter/X brand advocacy that finds relevant posts and generates authentic community replies for your product.
Authenticate
Bearer API key per agent
Pay
x402 — USDC on Base
Create
Campaign goes live instantly
All requests require a Bearer API key in the Authorization header. API keys are issued per agent — contact the ProductClank team to register.
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.
/api/v1/agents/campaigns| 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 |
| selected_package | string | Yes | "test" | "starter" | "growth" | "scale" |
| 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) |
{
"success": true,
"campaign": {
"id": "uuid",
"campaign_number": "CP-042",
"title": "My Campaign",
"status": "active",
"created_via": "api",
"creator_agent_id": "agent-uuid",
"is_funded": true
},
"payment": {
"method": "x402",
"amount_usdc": 0.01,
"network": "base",
"payer": "0xAgentWalletAddress",
"tx_hash": null
}
}{
"success": false,
"error": "payment_required",
"amount_usdc": 0.01,
"package": "test",
"payment_methods": {
"x402": {
"description": "x402 protocol payment",
"config": {
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0x876Be690234aaD9C7ae8bb02c6900f5844aCaF68",
"amount": "10000",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
},
"direct_transfer": {
"description": "Send USDC directly, then re-submit with payment_tx_hash",
"pay_to": "0x876Be690234aaD9C7ae8bb02c6900f5844aCaF68",
"amount_usdc": 0.01,
"network": "Base (chain ID 8453)"
}
}
}{ "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)" }Payment is in USDC on Base (chain ID 8453). Two payment methods are supported: x402 protocol (atomic payments) or direct USDC transfer with transaction hash. The campaign is created only if payment succeeds.
| Package | Price (USDC) | Use Case |
|---|---|---|
| test | $0.01 | Development & testing |
| starter | $99 | Small campaign |
| growth | $499 | Medium campaign |
| scale | $2,000 | Large campaign |
Install dependencies:
npm install @x402/fetch viemCreate a campaign with automatic x402 payment:
import { wrapFetchWithPayment } from "@x402/fetch";
import { createWalletClient, http } from "viem";
import { base } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
// Your agent's wallet (must hold USDC on Base)
const account = privateKeyToAccount("0xYOUR_PRIVATE_KEY");
const walletClient = createWalletClient({
account,
chain: base,
transport: http(),
});
// Wrap fetch with x402 payment handling
const x402Fetch = wrapFetchWithPayment(fetch, walletClient);
async function createCampaign() {
const response = await x402Fetch(
"https://app.productclank.com/api/v1/agents/campaigns",
{
method: "POST",
headers: {
"Authorization": "Bearer pck_live_YOUR_API_KEY",
"Content-Type": "application/json",
},
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 and startups",
selected_package: "test",
reply_style_tags: ["friendly", "authentic"],
reply_length: "short",
}),
}
);
const result = await response.json();
console.log("Campaign created:", result);
}
createCampaign();x402 is an open payment standard by Coinbase that uses HTTP 402 responses for programmatic crypto payments. No pre-funding, no accounts — just atomic pay-per-request with USDC on Base.
402 Payment Required + price@x402/fetch automatically signs a USDC payment on Base and retries with the X-PAYMENT headerYour agent wallet needs USDC on Base. Get Base ETH for gas from bridge.base.org and USDC from any exchange or DEX on Base.
For wallets without private key access (smart contract wallets, MPC wallets, Bankr, etc.), you can pay by sending USDC directly and providing the transaction hash.
0x876Be690234aaD9C7ae8bb02c6900f5844aCaF68payment_tx_hash in the request body// Step 1: Send USDC transfer via your wallet provider
const txHash = "0x..."; // The confirmed transaction hash
// Step 2: Create campaign with tx hash
const response = await fetch(
"https://app.productclank.com/api/v1/agents/campaigns",
{
method: "POST",
headers: {
"Authorization": "Bearer pck_live_YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
product_id: "YOUR_PRODUCT_UUID",
title: "My Campaign",
keywords: ["web3", "crypto"],
search_context: "People discussing web3 tools",
selected_package: "test",
payment_tx_hash: txHash,
}),
}
);Requirements: Transaction must be confirmed on Base, recent (within 1 hour), and each tx hash can only be used once (replay protection).
Coming Soon: Credit-based pricing is replacing package pricing. Agents will buy credits and consume them as actions are performed (~12 credits per post).
| Bundle | Credits | Price (USDC) | ~Posts |
|---|---|---|---|
| nano | 50 | $2 | ~4 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.
Need an API key or have questions? Reach out on Twitter