AI Social Media Post Generator for LinkedIn, X, Instagram and Facebook (Next.js and Claude)

A free, open-source AI social media post generator built with Next.js, TypeScript and the Claude API, for small businesses that post without a marketing team. Paste a brief, a product description or an article, set your brand voice once, and get several drafts per network with character counts and hashtags, ready to edit, copy or put on a weekly content calendar that exports to CSV and .ics.

by Light CloudAI apps, Newsletters and links

Build an AI social media post generator with Next.js and Claude

The generator: a brief for a free Saturday cupping morning at a Bristol coffee roastery, with all four networks ticked, and LinkedIn drafts with their character counts against the 3,000 limit, hashtags, and Copy and Schedule buttons
The generator: a brief for a free Saturday cupping morning at a Bristol coffee roastery, with all four networks ticked, and LinkedIn drafts with their character counts against the 3,000 limit, hashtags, and Copy and Schedule buttons, on a phone

Features

  • Three starting points: a short brief, a product description or a whole pasted article
  • Brand voice set once: business, audience, five tones, words to avoid, emoji on or off and hashtags for every post
  • Up to four drafts per network, each from a different angle, with a New variants button
  • Counted the way each network counts: X weighs links and emoji, and every draft shows its count against the limit
  • Drafts editable in place, with any word from your avoid list flagged by name
  • A weekly content calendar that suggests usual posting slots and exports the week as .ics or CSV
  • Claude writes the posts when ANTHROPIC_API_KEY is set; without it a labelled offline generator drafts them from your text
  • History, brand voice and calendar in the browser only, with rate limits on the generate endpoint and WCAG 2.2 AA in light and dark

Tech stack

What you need

  • Free plan: it runs as a server app, and the Free plan includes 3 server apps
  • To run it locally: Node.js 22.12 or newer and npm
  • No API keys: without ANTHROPIC_API_KEY it runs the offline generator
  • Optional: ANTHROPIC_API_KEY so Claude writes the posts, and ANTHROPIC_MODEL to choose the model (default claude-sonnet-5-5)
  • Recommended with a key: the app's visitor password, so only your team can spend your Anthropic credit

About

One route handler checks each request, counts it against the rate limits and asks Claude for structured drafts through the Anthropic SDK, falling back to the offline generator in src/lib/offline.ts; the prompt and per-network rules are in src/lib/ai.ts. The Claude path has not yet run with a real key, so its draft quality is unproven, and the offline drafts are formulaic starting points to edit. Rate limits are in memory and per instance, and the per-visitor limit trusts X-Forwarded-For, so anyone who opens an install with a key can spend credit within those limits; turn on the visitor password. X link counting recognises only http and https links. Everything you write stays in your browser's localStorage, the server stores nothing, and the app never posts to the networks for you.

FAQ

How do I write social media posts for my business with AI?

Start from something you already have: a few lines about what is happening, a product description or an article. Set your brand voice once (tone, audience, words to avoid, emoji, hashtags), pick the networks, and the generator writes several drafts for each one that you edit, copy or schedule.

What is the character limit for LinkedIn, X, Instagram and Facebook posts?

LinkedIn posts take up to 3,000 characters, with about 210 shown before see more. X allows 280 and a link always counts as 23; Instagram captions take 2,200 characters and at most 30 hashtags, and Facebook allows 63,206.

Can I use an AI post generator without an API key?

Yes. Without ANTHROPIC_API_KEY this one runs as an offline demo that builds drafts from your text with templates, so every fact comes from what you wrote, and it says so on every set. With a key, Claude writes the posts.

Can I plan social media posts for the week and add them to my calendar?

Yes. Schedule any draft for a day and time, see the week Monday to Sunday, move or edit posts, and download the week as an .ics file for Google Calendar, Outlook or Apple Calendar, or as CSV. It does not post to the networks for you.

Where are my posts and brand voice stored?

In your browser only, in localStorage. The server keeps nothing: it reads your text, returns the drafts and forgets it; when a Claude key is set, that text is also sent to the Anthropic API, which writes the posts.

Price
Free
Framework
Next.js · JavaScript
Plan
Free
Updated

Variables

  • ANTHROPIC_API_KEYOptional

    Without it a labelled offline generator writes the drafts. With it, turn on the visitor password so only your team spends the credit.

Related templates

All ai app templates