Docs🎨 CreativeAI Tweet Writer
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

ParameterTypeRequiredDescriptionDefault
topicstringrequiredSubject or idea to tweet about (max 500 chars)
stylestringoptionalWriting style: professional | casual | technical | hypecasual
threadbooleanoptionalGenerate a multi-tweet thread (4–6 tweets) instead of a single tweetfalse
contextstringoptionalAdditional context or talking points to weave in (max 1000 chars)

Response Fields

FieldTypeDescription
topicstringThe topic that was used
stylestringWriting style used
tweetstringGenerated tweet text (single-tweet mode only)
characterCountnumberCharacter count of the tweet (single-tweet mode only)
threadarrayArray of tweet strings (thread mode only)
totalCharactersnumberTotal character count across all thread tweets (thread mode only)
timestampstringISO 8601 timestamp

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" }
Previous
Crypto News Summarizer
Next
Email Verifier