POST
/api/tweet-writer$0.01🎨 AI Tweet Writer
Generate high-quality tweets or multi-tweet threads using Claude Haiku. Choose from four writing styles — professional (thought leader), casual (relatable friend), technical (developer-focused), or hype (crypto influencer energy). Single tweets are capped at 280 characters; threads produce 4–6 tweets with a strong narrative arc.
Request Body
Response Fields
Code Examples
cURL
bash
curl -X POST https://sparkforge.sh/api/tweet-writer \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <x402-payment-token>" \
-d '{
"topic": "Bitcoin hitting new all-time highs",
"style": "hype",
"thread": false
}'Python
python
import requests
response = requests.post(
"https://sparkforge.sh/api/tweet-writer",
headers={
"Content-Type": "application/json",
"X-PAYMENT": "<x402-payment-token>"
},
json={
"topic": "Why TypeScript is worth the boilerplate",
"style": "technical",
"thread": True,
"context": "Focus on type safety, IDE support, and long-term maintainability"
}
)
data = response.json()
if "thread" in data:
for i, tweet in enumerate(data["thread"], 1):
print(f"[{i}] {tweet}\n")
else:
print(data["tweet"])TypeScript / Node.js
typescript
import { wrapFetchWithPayment } from "@x402/fetch";
const fetch402 = wrapFetchWithPayment(fetch, wallet);
const res = await fetch402("https://sparkforge.sh/api/tweet-writer", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
topic: "Bitcoin hitting new all-time highs",
style: "hype",
thread: false,
}),
});
const { tweet, characterCount } = await res.json();
console.log(`(${characterCount} chars) ${tweet}`);Example Response
json
{
"topic": "Bitcoin hitting new all-time highs",
"style": "hype",
"tweet": "🚀 BTC IS MAKING HISTORY RIGHT NOW 🚀\n\nAll-time high SMASHED. This isn't just a pump — this is institutional adoption, ETF inflows, and a halving catalyst all converging at once.\n\nThe signal was loud. Most ignored it.\n\nDon't overthink it. #Bitcoin #BTC",
"characterCount": 248,
"timestamp": "2026-02-28T16:00:00Z"
}💳 Payment via x402
This endpoint costs $0.01 per call, paid in USDC on Base, Polygon, or Solana. Use the @x402/fetch library to handle payments automatically, or implement the x402 handshake manually.
bash
# Free demo mode (no payment)
curl https://sparkforge.sh/api/tweet-writer?demo=true
# Or try via MCP (Claude Desktop, Cursor, Windsurf)
# Add to mcp config: { "url": "https://sparkforge.sh/api/mcp" }