# AI social media posts

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.

- Framework: Next.js (JavaScript)
- Category: Apps / AI apps, Newsletters and links
- Creates: a server app
- Plan: Free
- Price: Free
- Author: Light Cloud
- Page: https://templates.light-cloud.com/apps/ai/ai-social-media-post-generator
- Updated: 2026-11-21

## 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

## 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.

## Variables

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

## Questions

### 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.
